| |
|
|
RudiB. | Hello together,
here 5 functions-Button....in dependence from the place/Postion on which the Button clicked becomes.
left supra, right supra, left under, right under or middle.
Windowstyle 24
Windowtitle "5 functions Button"
Window 300,200-450,350
Declare bs#,posx%,posa%,posy%,posb%,half_b%,half_h%,neutral_b%,neutral_h%
Dim bs#,16'
Def @GetWindowRect(2) !"USER32", "GetWindowRect"
Def @ScreenToClient(2) !"USER32","ScreenToClient"
cls External("USER32","GetSysColor",15)
Var Test7&=Control("BUTTON","+",$54410000,150,70,200,100,%hwnd,0,%hinstance,$0)
Var text&=Create("Text",%hwnd,"5 functions-Button",140,173,140,22)
While 1
Waitinput
If getfocus(Test7&)
posx%=%mousex
posy%=%mousey
@GetWindowRect(Test7&,bs#)
@ScreenToClient(%hwnd,bs#)
@ScreenToClient(%hwnd,bs#+8)
half_b%=((LONG(bs#,8)-LONG(bs#,0))/2)
half_h%=((LONG(bs#,12)-LONG(bs#,4))/2)
neutral_b%=((LONG(bs#,8)-LONG(bs#,0))/5)
neutral_h%=((LONG(bs#,12)-LONG(bs#,4))/5)
posa%=Long(bs#,0)+half_b%
posb%=Long(bs#,4)+half_h%
setfocus(%Hwnd)
locate 1,1
Ifnot (posx%>posa%-neutral_b%) and (posx%<posa%+neutral_b%) and (posy%>posb%-neutral_h%) and (posy%<posb%+neutral_h%)
If (posx%<posa%) and (posy%<posb%)
print "letzter Click on left supra "
Endif
If (posx%>posa%) and (posy%<posb%)
print "letzter Click on right supra "
Endif
If (posx%>posa%) and (posy%>posb%)
Print "letzter Click on right under "
Endif
If (posx%<posa%) and (posy%>posb%)
Print "letzter Click on left under "
EndIf
Else
Print "letzter Click on middle "
EndIf
Endif
Endwhile
Waitinput
|
|
|
| Xprofan X4 Rudolf Beske / München
Hardware: NB Intel I9 - 16GByte RAM | 04/29/21 ▲ |
|
|
|
|
Michael W. | well for Bewegungskreuze a la "Map View" or "Google Earth". slight transparent and a couple Pfeilchen moreover. |
|
|
| |
|
|