$H Windows.ph
$H commctrl.ph
Declarar Handle ilist, tblist, hPic, icon, Btn1, Btn2, Btn3
Declarar Largo IconListe[], x, ende, xoff, yoff
Declarar String Buchstaben[], buchstabe, w1, w2, w3, zeile1, zeile2, zeile3
zeile1 = "KALKULATION"
zeile2 = "ALKALI"
zeile3 = "UNIKAT"
w1 = ""
ende = 0
xoff = ~GetSystemMetrics(32)
yoff = ~GetSystemMetrics(4) + xoff
Título de la ventana "Geschüttelte Buchstaben"
Ventana 780, 400
Btn1 = Crear("Button", %HWnd, "Fertig", 600, 10, 60, 25)
Btn2 = Crear("Button", %HWnd, "Neu", 600, 40, 60, 25)
Btn3 = Crear("Button", %HWnd, "Ende", 600, 300, 60, 25)
DrawText 10, 5, "Bilde de unten stehenden Buchstaben drei Wörter."
DrawText 10, 20, "Die Definitionen debería esta helfen."
DrawText 10, 35, "Ziehe con ratón el Buchstaben nacheinander en el Kästen."
DrawText 10, 50, "Wenn todos Wörter erstellt son, drücke fertig para Überprüfen."
InitIconListe()
DrawText 10, 150, "Kostenvoranschlag :"
RectAngle 200, 140, 680, 180
DrawText 10, 200, "laugenartige Verbindung :"
RectAngle 200, 190, 680, 230
DrawText 10, 250, "ein einzelnes Stück :"
RectAngle 200, 240, 680, 280
Sinestar encargado Ende
WaitInput
If Ratón(20, 80 - 52, 112)
DoDragDrop(0)
ElseIf Ratón(70, 80 - 102, 112)
DoDragDrop(1)
ElseIf Ratón(120, 80 - 152, 112)
DoDragDrop(2)
ElseIf Ratón(170, 80 - 202, 112)
DoDragDrop(3)
ElseIf Ratón(220, 80 - 252, 112)
DoDragDrop(4)
ElseIf Ratón(270, 80 - 302, 112)
DoDragDrop(5)
ElseIf Ratón(320, 80 - 352, 112)
DoDragDrop(6)
ElseIf Ratón(370, 80 - 402, 112)
DoDragDrop(7)
ElseIf Ratón(420, 80 - 452, 112)
DoDragDrop(8)
ElseIf Ratón(470, 80 - 502, 112)
DoDragDrop(9)
ElseIf Ratón(520, 80 - 552, 112)
DoDragDrop(10)
ElseIf Clicked(Btn1)
' Fertig
If w1 = zeile1
DrawIcon tblist, 60, 700, 150
Más
DrawIcon tblist, 10, 700, 150
EndIf
If w2 = zeile2
DrawIcon tblist, 60, 700, 200
Más
DrawIcon tblist, 10, 700, 200
EndIf
If w3 = zeile3
DrawIcon tblist, 60, 700, 250
Más
DrawIcon tblist, 10, 700, 250
EndIf
ElseIf Clicked(Btn2)
' Neu
RectAngle 200, 140, 680, 180
RectAngle 200, 190, 680, 230
RectAngle 200, 240, 680, 280
DrawIcon tblist, 32, 700, 150
DrawIcon tblist, 32, 700, 200
DrawIcon tblist, 32, 700, 250
w1 = ""
w2 = ""
w3 = ""
ElseIf Clicked(Btn3)
ende = 1
EndIf
EndWhile
Proc InitIconListe
Declarar Handle hIcon, tbpic
Buchstaben[] = Explode("A,L,T,U,K,I,L,A,O,K,N", ",")
MCLS 32, 32, RGB(192, 192, 192)
ilist = Crear("ImageList", 32, 32)
WhileLoop 0, 10
hPic = Crear("HPIC", 0, "& MEMBMP")
StartPaint hPic
UseFont "ARIAL", 24, 18, 1, 0, 0
DrawText 16, 4, Buchstaben[&LOOP], 6
EndPaint
ImageList("Add", ilist, hPic)
EndWhile
x = 20
WhileLoop 0, 10
DrawIcon ilist, &LOOP, x, 80
Inc x, 50
EndWhile
tbpic = Crear("hSizedPic", 0, "TOOLBAR", 2368, 32, 0)
tblist = Crear("ImageList", 32, 32, tbpic)
DrawIcon tblist, 32, 700, 150
DrawIcon tblist, 32, 700, 200
DrawIcon tblist, 32, 700, 250
DeleteObject tbpic
ENDPROC
Proc DoDragDrop
Parámetros Largo ix
buchstabe = Buchstaben[ix]
~ImageList_BeginDrag(ilist, ix, (%MouseX - xoff - %MouseX), (%MouseY - yoff - 100))
~ImageList_DragEnter(%HWnd, %MouseX, %MouseY)
Mientras que %MousePressed
~ImageList_DragMove(%MouseX, %MouseY)
EndWhile
~ImageList_EndDrag()
If Between(%MouseX, 200, 680, %MouseY, 140, 180)
w1 = w1 + buchstabe
DrawIcon ilist, ix, %MouseX , 145
ElseIf Between(%MouseX, 200, 680, %MouseY, 190, 230)
w2 = w2 + buchstabe
DrawIcon ilist, ix, %MouseX , 195
ElseIf Between(%MouseX, 200, 680, %MouseY, 240, 280)
w3 = w3 + buchstabe
DrawIcon ilist, ix, %MouseX , 245
EndIf
ENDPROC
DeleteObject ilist, tblist, hPic
End