English
Source / code snippets

request aray Clicked Controls lever Click Mouse button Multiple

 

Jörg
Sellmeyer
If one several same Controls created, is the request with XProfan X2 leichter become.
If the Handles in a aray stored go, can The request with IndexOf very komfortabel solve.
Declare cb&[10],btn&[10]

Proc ClickedMultiItem

    Parameters b&[]
    Declare I%
    I% = IndexOf(b&[],%getfocus)

    If (I%) > -1

        Return Clicked(%getfocus)

    EndIf

ENDPROC

Cls

WhileLoop 0,9

    cb&[&Loop] = Create("CheckBox",%hwnd,"CheckBox " + Str $(&Loop + 1),310,10 + &Loop * 25,120,24)
    btn&[&Loop] = Create("Button",%hwnd,"Button " + Str $(&Loop + 1),440,10 + &Loop * 25,120,24)

Wend

While 1

    WaitInput

    If ClickedMultiItem(cb&[])

        Print GetText$(%getfocus),"Hier are The Checkboxen"

    ElseIf ClickedMultiItem(btn&[])

        Print GetText$(%getfocus),"Hier are The Buttons"

    EndIf

Wend

 
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
10/28/11  
 




Jörg
Sellmeyer
too whom rechten Click can intercepting:
Declare cb&[10],ed&[10]
Var Button$ = "linken,rechten"

Proc RClicked

    Parameters h&
    Return (%childMessage = 516) And (&wparam = h&)

ENDPROC

Proc RClickedMultiItem

    Parameters b&[]
    Declare I%
    I% = IndexOf(b&[],&wparam)

    If (%childMessage = 516) And (I% > -1)

        Return &wparam

    Endif

ENDPROC

Proc ClickedMultiItem

    Parameters b&[]
    Declare I%
    I% = IndexOf(b&[],%getfocus)

    If (I%) > -1

        Return Clicked(%getfocus)

    EndIf

ENDPROC

Cls

WhileLoop 0,9

    cb&[&Loop] = Create("CheckBox",%hwnd,"CheckBox " + Str $(&Loop + 1),310,10 + &Loop * 25,120,24)
    ed&[&Loop] = Create("Edit",%hwnd,"Edit " + Str $(&Loop + 1),440,10 + &Loop * 25,120,24)

Wend

While 1

    WaitInput

    If ClickedMultiItem(cb&[])

        Print GetText$(%getfocus),"Dies is a "+ ClassOf(%getfocus)

    ElseIf RClickedMultiItem(cb&[])

        CreateMenu
        AppendMenu 100,GetText$(&wparam) + " these one "+ ClassOf(&wparam)
        TrackMenu()

    ElseIf ClickedMultiItem(ed&[])

        Print GetText$(%getfocus),"Dies is a "+ ClassOf(%getfocus) + " the with the " + SubStr$(Button$,%mousepressed,",") + " Mouse button geklicked wurde"

    ElseIf RClickedMultiItem(ed&[])

        'so can too the windowsinterne Menu for Edits aushebeln
        CreateMenu
        AppendMenu 100,"\q" + GetText$(&wparam) + "\q these one "+ ClassOf(&wparam) + " the with the " + SubStr$(Button$,%mousepressed,",") + " Mouse button geklicked wurde"
        Separator
        AppendMenu 101,"Ausschneiden"
        AppendMenu 102,"kopieren"
        AppendMenu 103,"einfügen"
        AppendMenu 103,"Delete"
        TrackMenu()

    EndIf

Wend

 
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
10/28/11  
 



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

9.603 Views

Untitledvor 0 min.
Axel Berse11/03/23
Thomas04/24/23
RudiB.09/02/22
Michael W.03/30/22
More...

Themeninformationen

this Topic has 1 subscriber:

Jörg Sellmeyer (2x)


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