How to use hotspots?
- Roger Seiler
- Posts: 223
- Joined: Thu Dec 01, 2005 3:34 pm
- Location: Nyack, New York, USA
- Contact:
How to use hotspots?
I seem to recall from some posting years ago that FiveWin has a way of implementing hotspots on top of a bitmap. But I don't remember how to do this and wonder whether this would work with the new transparent brush covering a dialog.
Can someone point me in the right direction, please?
- Roger
Can someone point me in the right direction, please?
- Roger
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Roger,
There are several ways to do it:
1. You may keep an array with subarrays containing the areas of the hotspots. When the mouse is clicked you search into those subarrays and fire a related action.
2. Another way is to place a transparent control on top of the bitmap (i.e. a TBtnBmp or a TPanel) with brush NULL, so when it is clicked, its action its fired or its bLClicked codeblock.
There are several ways to do it:
1. You may keep an array with subarrays containing the areas of the hotspots. When the mouse is clicked you search into those subarrays and fire a related action.
2. Another way is to place a transparent control on top of the bitmap (i.e. a TBtnBmp or a TPanel) with brush NULL, so when it is clicked, its action its fired or its bLClicked codeblock.
- reinaldocrespo
- Posts: 918
- Joined: Thu Nov 17, 2005 5:49 pm
- Location: Fort Lauderdale, FL
Roger/Antonio;
Were you able to get any of these two approaches to work?
I'm dealing with the same situation. Have a timage control on a dialog and want to execute different code if clicked on different areas of the image. I'm trying with the tBmpBtn placed on top of the tImage control, but it is always visible no matter what. If ltransparent set to .t., then the bmpbtn displays as a black box.
Here the code I'm using:
Any ideas?
Thank you,
Reinaldo.
Were you able to get any of these two approaches to work?
I'm dealing with the same situation. Have a timage control on a dialog and want to execute different code if clicked on different areas of the image. I'm trying with the tBmpBtn placed on top of the tImage control, but it is always visible no matter what. If ltransparent set to .t., then the bmpbtn displays as a black box.
Here the code I'm using:
Code: Select all
DEFINE DIALOG ::odlg NAME "xRayOrders" OF ::oWnd TITLE "Patient Xray Orders" BRUSH oBrush
REDEFINE BTNBMP aoBtn[ 1 ] ID 101 OF ::oDlg NOBORDER ACTION oSelf:addXray( "Head" ) TOOLTIP "Head xRays"
REDEFINE BITMAP oImage1 ID 100 OF ::oDlg FILE cPath + "Human_Front.jpg" //CURSOR oCursor //TRANSPARENT
REDEFINE BITMAP oImage2 ID 200 OF ::oDlg FILE cPath + "Human_Back.jpg" //CURSOR oCursor //TRANSPARENT
ACTIVATE DIALOG oSelf:oDlg CENTERED ON INIT oSelf:BuildXrayOrdersControls() ;
Valid SaveBrwState( oSelf:oLbx, "XrayOrders" )
Thank you,
Reinaldo.
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Roger, Reinaldo,
Here you have a working sample:
http://hyperupload.com/download/3041ea2 ... t.zip.html
Here you have a working sample:
http://hyperupload.com/download/3041ea2 ... t.zip.html
- RAMESHBABU
- Posts: 591
- Joined: Fri Oct 21, 2005 5:54 am
- Location: Secunderabad (T.S), India
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact: