| sandinzz@yahoo.com 2006-02-10, 6:55 pm |
| Long time no see.
Someone (edwfitzpatr...@aol.com ) on google group sugested me to put
region on window and to put some code
in MouseMove embed point for moving button (see Performing a code when
user "hover" the cursor over a control.)
1. set measurement units to pixels
QuickWindow{Prop:Pixels} = 1
2. set timer for window
! put code in window -> timer embed point which has to find out is or
not the mouse is positioned over any control.
TIMER_LOC ROUTINE
!
! SELECTEDB
! SELECTED_OLD - previous selection
!
! maybe you have to improve this code
SELECTED_OLD = SELECTEDB
LOOP IDX# = 1 TO 100 ! number of controls
GETPOSITION(MyFieldL[IDX#],XPOSB,YPOSB,W
IDTHB,HEIGHTB)
IF XPOSB =< MOUSEX() AND MOUSEX() < XPOSB + WIDTHB AND |
YPOSB =< MOUSEY() AND MOUSEY() < YPOSB + HEIGHTB
SELECTEDB = IDX#
MyFieldL[IDX#]{PROP:FLAT} = FALSE
BREAK
ELSE
SELECTEDB = 0
MyFieldL[SELECTED_OLD]{PROP:FLAT} = TRUE ! NE VIDI SE B.
END
END
If there are two controls which are one over another, the first created
button will be selected
3. Region
create an region, set IMM attrinute for it and place it all over the
window, for example.
For code, please see topic "Regions : Advice request"
I mannaged to move buttons using MouseLeft, to resize it using
MouseRight, to open new window
filled with data associated with selected button, to open help window
if no control is selected etc.
I have two kinds of button controls and everything works OK. Zoran
Sandin
|