Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community

At 22 MAR 1998 09:40:58AM David Howell wrote:

I am wanting to include some "Hot Spots" (similar to multimedia apps) that highlight or display a border around a screen location whenever the mouse point moves over that location. I have examined the "Examples" app provided by Revelation, and while I am able to ascertain certain proceedures, it is not completely clear to me.

Can someone please expain the concept behind hot spotting and (Dear Santa, for Christmas I would like…) maybe a programming segment or utility to help explain.

Thanks a lot for your interest.

David Howell


At 22 MAR 1998 11:09PM Donald Bakke wrote:

David,

The problem/advantage with hotspots in OI is that there are a variety (or variations of the same) of ways to accomplish them, depending on the full effect you desire.

If your hotspots are rectangular shaped then the EXAMPLES application is the way to go. Otherwise if your hotspots are very irregular (like each state within the U.S.) then another approach will be necessary.

Can you elaborate on what effect you are going for? That way I can help you figure out how to get what you want.

[email protected]

SRP Computer Solutions


At 25 MAR 1998 04:43PM David Howell wrote:

Donald,

Thanks for responding. The application I'm prototyping calls for irregular hot spots for a bit map with multiple irregular shapes. Similar to a map but probably not as bad a say Maryland. It will call for some trapezoidal like hot spots.

I have examined the Examples examples, I'm a little confused with how OI "highlights" the spot when the mouse moves over the spot. Any light you can shed (or other source you can direct me to) would also be appreciated.

Whatever you can provide would be great.

Thanks


At 25 MAR 1998 10:41PM Donald Bakke wrote:

I have examined the Examples examples, I'm a little confused with how OI "highlights" the spot when the mouse moves over the spot. Any light you can shed (or other source you can direct me to) would also be appreciated.

The Example window has a single bitmap that shows all the "buttons" in their un-highlighted state. Underneath this bitmap are the individual buttons (initially invisible) each with a specific bitmap that shows the hot spot in its hightlighted state.

As the mouse is moved over the window, the form is trapping the physical location of the mouse pointer. If it detects that the position of the mouse is "over" one of the hot spots (i.e. the x,y coordinates of the mouse fall into the known x,y box dimensions of the hot spot), then the corresponding button is set to be visible. OI will force this button to appear "on top" of the bitmap therefore hiding the un-highlighted image portion of the single bitmap with the highlighted image that appears on the pushbutton.

As the mouse moves out of this area, the button is made invisible again and, if necessary, another button is made visible, and so on…

The application I'm prototyping calls for irregular hot spots for a bit map with multiple irregular shapes. Similar to a map but probably not as bad a say Maryland. It will call for some trapezoidal like hot spots.

Well, no matter what the true shape is, you will have to use rectangular shaped controls to display your hot spots. I'll assume that your shapes share boundaries with other shapes (like states on a map).

Given your needs, I would recommend just using BITMAP controls rather than pushbuttons with bitmaps on them. You will need to create a bitmap for every shape (or hot spot) with two images - the first image representing the "un-highlighted" look and the second image representing the "highlighted" look. Since these shapes are irregular and must fit into a rectangle, you will need to draw those portions of the surrounding shapes that would "spill over" into the rectangular boundaries. Once you've done this then lay them out appropriately and you should get the look of the entire image (i.e. all the hot spots) in their un-highlighted state.

Use the same technique in the Examples window for tracking mouse movement. If the mouse moves over one of your hot spots, then set the IMAGENUMBER property of the particular BITMAP to 2 thereby making this hot spot look highlighted - at the same time you would set the IMAGENUMBER of previous bitmaps to 1. The real trick here is determining if the mouse is technically within the boundaries of the true hot spot's shape rather than the rectangle that contains it. If you are using geometrical shapes then you should be able to write a formula to do this for you. Something very irregular, like a state border, would be very difficult without (internally) reducing the boundary to simple shapes.

Finally, use the BUTTONDOWN event to process whatever code you want to occur when a hot spot is clicked on. The BUTTONDOWN event passes the x and y coordinates of the mouse so you can use the same logic as above to detect which hot spot was clicked on.

That's the skeleton of what you need to do. I hope that's enough to put you on the right track.

[email protected]

SRP Computer Solutions

View this thread on the Works forum...

  • third_party_content/community/commentary/forums_works/e36ab60afee3603b852565cf004b299c.txt
  • Last modified: 2023/12/30 11:57
  • by 127.0.0.1