English
Source / code snippets

5 functions Button

 

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.
 
Alle Sprachen
System: Windows 8/10, XProfan X4
Programmieren, das spannendste Detektivspiel der Welt.
05/02/21  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

1.260 Views

Untitledvor 0 min.
Gast.081508/24/24
Rainer Hoefs04/11/23
Walter11/28/22
Tommy08/08/21
More...

Themeninformationen

this Topic has 2 subscriber:

Michael W. (1x)
RudiB. (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie