Home
Add
Edit
Without Linenumbers
Code as Text
Download
#Define Quit Inkey=CHR(255,107) Dim Shared As Integer mx,my,mb,anz_win,move_win Type WizWindow As Integer id As String title As Integer x As Integer y As Integer w As Integer h End Type Dim Shared As WizWindow win() Dim Shared As UInteger winZ() 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) .x=anz_win * 25 .y=anz_win * 25 .w=300 .h=200 End With winZ(anz_win) = anz_win End Sub dim oldwin as integer Do oldwin = move_win Getmouse mx,my,,mb If move_win = 0 Then 'erstmal prüfen ob n fenster aktuell bewegt wird. (Drag-crosslock schutz) For i As Integer= anz_win to 1 step -1 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 if i < anz_win Then 'ist ganz sinvoll, um nicht jedes mal die liste zu durchlaufen, wenn das fenster sowieso schon am ende is. 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 End If 'einfach noch eine prüfung hinzu fügen (kann man natürlich optimieren) 'welche prüft, ob man auf das "bar" klickt. If (mx>win(winZ(i)).x And mx<win(winZ(i)).w+win(winZ(i)).x) And (my>win(winZ(i)).y And my<24+win(winZ(i)).y) And mb=1 Then 'wen dem so ist, dann: 'move move_win = winZ(i) End If exit for 'exit danach End If Next End if 'wenn move gesetzt, dann move es if mb=1 Then 'wenn knop gedrückt, dann move ausführen, wenn ... If move_win = oldwin Then '... fenster selectiert 'diese variante ist deutlich schöner, udn auch sicherer, bei schnellen mausbewegungen. win(move_win).x = mx win(move_win).y = my else oldwin = move_win 'ansonsten selektieren (wenn vorhanden) End If else: oldwin = 0 'beim loslassen wird auch drag gelöscht end if 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 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 End Sub
Linux - 0.20.0 (08-10-2008) - [using Linux-Debian-Compiler]
Linux - 0.18.5 (04-17-2008) - [using Linux-Debian-Compiler]
Windows - 0.23.0 (08-14-2011) - [using wine Windows-Compiler]
Windows - 0.22.0 (05-06-2011) - [using wine Windows-Compiler]
Windows - 0.21.1 (08-11-2010) - [using wine Windows-Compiler]
Windows - 0.20.0 (08-10-2008) - [using wine Windows-Compiler]
Windows - daily git build (2012-05-23) - [using wine Windows-Compiler]
DeltaLab's WebFBC