Italia
Fonte/ Codesnippets

Buchstaben geschüttelt

 

H.Brill
Hier mal ein Rätsel, inspiriert durch die Sonntags-Bildzeitung :
 $H Windows.ph
 $H commctrl.ph
Declare Handle ilist, tblist, hPic, icon, Btn1, Btn2, Btn3
Declare Long IconListe[], x, ende, xoff, yoff
Declare 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
WindowTitle "Geschüttelte Buchstaben"
Window 780, 400
Btn1 = Create("Button", %HWnd, "Fertig", 600, 10, 60, 25)
Btn2 = Create("Button", %HWnd, "Neu",    600, 40, 60, 25)
Btn3 = Create("Button", %HWnd, "Ende",   600, 300, 60, 25)
DrawText 10,  5, "Bilde aus unten stehenden Buchstaben drei Wörter."
DrawText 10, 20, "Die Definitionen sollen dabei helfen."
DrawText 10, 35, "Ziehe mit der Maus die Buchstaben nacheinander in die Kästen."
DrawText 10, 50, "Wenn alle Wörter erstellt sind, drücke fertig zum Ü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

WhileNot Ende

    WaitInput

    If Mouse(20, 80 - 52, 112)

        DoDragDrop(0)

    ElseIf Mouse(70, 80 -  102, 112)

        DoDragDrop(1)

    ElseIf Mouse(120, 80 - 152, 112)

        DoDragDrop(2)

    ElseIf Mouse(170, 80 - 202, 112)

        DoDragDrop(3)

    ElseIf Mouse(220, 80 - 252, 112)

        DoDragDrop(4)

    ElseIf Mouse(270, 80 - 302, 112)

        DoDragDrop(5)

    ElseIf Mouse(320, 80 - 352, 112)

        DoDragDrop(6)

    ElseIf Mouse(370, 80 - 402, 112)

        DoDragDrop(7)

    ElseIf Mouse(420, 80 - 452, 112)

        DoDragDrop(8)

    ElseIf Mouse(470, 80 - 502, 112)

        DoDragDrop(9)

    ElseIf Mouse(520, 80 - 552, 112)

        DoDragDrop(10)

    ElseIf Clicked(Btn1)

        ' Fertig

        If w1 = zeile1

            DrawIcon tblist, 60, 700, 150

        Else

            DrawIcon tblist, 10, 700, 150

        EndIf

        If w2 = zeile2

            DrawIcon tblist, 60, 700, 200

        Else

            DrawIcon tblist, 10, 700, 200

        EndIf

        If w3 = zeile3

            DrawIcon tblist, 60, 700, 250

        Else

            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

    Declare Handle hIcon, tbpic
    Buchstaben[] = Explode("A,L,T,U,K,I,L,A,O,K,N", ",")
    MCls 32, 32, RGB(192, 192, 192)
    ilist = Create("ImageList", 32, 32)

    WhileLoop 0, 10

        hPic = Create("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 = Create("hSizedPic", 0, "TOOLBAR", 2368, 32, 0)
    tblist = Create("ImageList", 32, 32, tbpic)
    DrawIcon tblist, 32, 700, 150
    DrawIcon tblist, 32, 700, 200
    DrawIcon tblist, 32, 700, 250
    DeleteObject tbpic

EndProc

Proc DoDragDrop

    Parameters Long ix
    buchstabe = Buchstaben[ix]
    ~ImageList_BeginDrag(ilist, ix, (%MouseX - xoff - %MouseX), (%MouseY  - yoff  - 100))
    ~ImageList_DragEnter(%HWnd, %MouseX, %MouseY)

    While %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

Viel Divertimento damit
 
Benutze XPROFAN X3 + FREEPROFAN
Wir sind die XProfaner.
Sie werden von uns assimiliert.
Widerstand ist zwecklos!
Wir werden alle ihre Funktionen und Algorithmen den unseren hinzufügen.

Was die Borg können, können wir schon lange.
26.09.2023  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

Kein Systemprofil angelegt. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Bitte anmelden um einen Beitrag zu verfassen.
 

Topic-Options

669 Views

Untitledvor 0 min.
Karsten Mört19.07.2024
Thomas Freier06.01.2024
Michael W.08.12.2023
Thomas Zielinski02.12.2023
Di più...

Themeninformationen

Dieses Thema hat 1 subscriber:

H.Brill (1x)


Admins  |  AGB  |  Applications  |  Autori  |  Chat  |  Informativa sulla privacy  |  Download  |  Entrance  |  Aiuto  |  Merchantportal  |  Impronta  |  Mart  |  Interfaces  |  SDK  |  Services  |  Giochi  |  Cerca  |  Support

Ein Projekt aller XProfaner, die es gibt!


Il mio XProfan
Private Notizie
Eigenes Ablageforum
Argomenti-Merkliste
Eigene Beiträge
Eigene Argomenti
Zwischenablage
Annullare
 Deutsch English Français Español Italia
Traduzioni

Informativa sulla privacy


Wir verwenden Cookies nur als Session-Cookies wegen der technischen Notwendigkeit und bei uns gibt es keine Cookies von Drittanbietern.

Wenn du hier auf unsere Webseite klickst oder navigierst, stimmst du unserer Erfassung von Informationen in unseren Cookies auf XProfan.Net zu.

Weitere Informationen zu unseren Cookies und dazu, wie du die Kontrolle darüber behältst, findest du in unserer nachfolgenden Datenschutzerklärung.


einverstandenDatenschutzerklärung
Ich möchte keinen Cookie