Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Click on a map
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Divers
Thread ID:
00046665
Message ID:
00046803
Vues:
30
>>>>>>>>The user wants a map of the USA on a form. She would like to click on states and get data for those states. It amounts to making buttons that are state-shaped. I only know how to make rectangular buttons, which is fine for Colorado and Wyoming, but not many others. Can it be done?
>>>>>>>
>>>>>>>what about a map of the US. based on mouse location when click, show data for state mouse is on. we have something like that here, but not readily available (don't remember where it is)
>>>>>>
>>>>>>That sounds simple enough. Ideally, there would be a way to define the states as objects somehow, so that I could explicitely program Texas.click or Utah.mouseover. If I have to relate x and y position of the mouse to the complicated shapes of states based on a huge set of numbers, it sounds inefficient.
>>>>>
>>>>>Did you check third-party vendors, e.g. www.mapx.com or www.esri.com. They deliver Active-X components which are probably exactly what you are looking for.
>>>>
>>>>Also, instead of clicking on the state, which may be difficult on low-res monitors for states in the NE, you can also try capturing a click on the states' labels instead. No Active-X needed for that.
>>>>
>>>>HTH
>>>
>>>That's how we did it. After fooling around with making multiple buttons to fit them inside the states, and a 3rd party button ocx (ButtonMaker by FarPoint Technologies. They don't have invisible buttons though) we just used labels and their click methods. It was the easiest. We set the alignment to Center and made the labels as big as possible within the state boundary just to give more area for mouse-challenged people to hit.
>>
>>I thought of a potential way to fulfill the user's specific request. Here's what I wrote in the .click of an image control:
>>
>>Xposish = MCOL('usaformtest')
>>Yposish = MROW('usaformtest')
>>ncolor = THISFORM.Point(Xposish,Yposish)
>>
>>but it doesn't quite work, because MCOL() and MROW() return columns and rows, but the .Point method needs pixels. Columns and Rows aren't precise enough anyway. Is there a way to know the exact pixel position of the mouse pointer?
>
>You can get pixel positions as parameters (nXcoord,nYcoord) of MouseDown event.

That works. Thanks. Now, if the user really wants me to do this, I just have to get a hold of a USA outline map and give each state a unique color which I store in a lookup table.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform