| |
|
|
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 ▲ |
|
|
|