List
Add
Info
Contact
Stats
To edit this entry i need username and password!
Fields marked * are required!
* Username:
* Password:
Type:
Sourcecode (WITHOUT BBCode support)
Name:
westbeam_mit_focus_undopti.bas
* Data:
(max. 1 MB)
Available TAG's (new window)
#Define Quit Inkey=CHR(255,107) Dim Shared As Integer mx,my,mb,anz_win Type WizWindow As Integer id As String title ' As Integer active 'brauchste nicht As Integer x As Integer y As Integer w As Integer h End Type Dim Shared As WizWindow win() Dim Shared As UInteger winZ(50000) Declare Sub InitGUI() Declare Sub DrawGadgets() Declare Sub DrawWindow(id As Integer) declare Sub WinAdd() Screenres 640,480,32 InitGUI() dim shared anz_alloc as uinteger Sub WinAdd() anz_win+=1 if anz_win > anz_alloc then anz_alloc += 25 redim Preserve win(anz_alloc) as WizWindow redim Preserve winZ(anz_alloc) as UInteger end if With win(anz_win) .id=1 .title="Testwindow-" & Str(anz_win) ' .active=0 'brauchste nicht -> siehe: winActive .x=anz_win * 25 .y=anz_win * 25 .w=300 .h=200 End With winZ(anz_win) = anz_win End Sub Do Getmouse mx,my,,mb 'Das macht man nicht im "Draw"!!! For i As Integer= anz_win to 1 step -1 'rückwerts durchlaufen 'hier mit winZ prüfen If (mx>win(winZ(i)).x And mx<win(winZ(i)).w+win(winZ(i)).x) And (my>win(winZ(i)).y And my<win(winZ(i)).h+win(winZ(i)).y) And mb=1 Then 'in der "mit focus" variante müssen wir den Z-Speicher umsortieren. 'hierfür den eintrag aller folgenden fenster um 1 nach vorne verschieben, und am ende das aktuelle wieder eintragen Dim TWinID as UInteger = winZ(i) For X as uinteger = i to anz_win -1 winZ(x) = winZ(x + 1) Next winZ(anz_win) = TWinID exit for 'fertig. rest muss man nicht durchlaufen End If Next Sleep 10,1 Screenlock Cls Line (0,0)-(640,480),&h376ea5,BF DrawGadgets() Screenunlock Loop Until Quit End Sub InitGUI() For X as Uinteger = 1 to 10 WinAdd() next End Sub Sub DrawGadgets() For i As Integer=1 To anz_win If win(winZ(i)).id=1 Then DrawWindow(winZ(i)) Next End Sub Sub DrawWindow(id As Integer) If id=winZ(anz_win) Then 'hier auf active prüfen (unterschied zu "ohne focus" ist, das das aktive fenster IMMER das letzte in der ZListe is, da es ganz oben ist) Line (win(id).x,win(id).y)-(win(id).w+win(id).x,win(id).h+win(id).y),&hFFFFFF,BF Line (win(id).x,win(id).y)-(win(id).w+win(id).x,win(id).h+win(id).y),&h000000,B Else Line (win(id).x,win(id).y)-(win(id).w+win(id).x,win(id).h+win(id).y),&hc0c0c0,BF Line (win(id).x,win(id).y)-(win(id).w+win(id).x,win(id).h+win(id).y),&h000000,B End If 'is jetzt in der hauptschleife End Sub
Filetype / Highlight:
freeBASIC
Action: