> vergleicht.....Denn Speed ist doch heutzutage wichtig ... --- .. Oder?
http://forums.purebasic.com/german/view ... 0324#50324

Grüße ... Kiffi
Code: Alles auswählen
Enumeration ; Fenster
#win_main
#main_statusbar
EndEnumeration
Enumeration ; gadgets
#main_image_icon
#main_button_source
#main_text_source
#main_button_target
#main_text_target
#main_frame_options
#main_checkbox_logging
#main_checkbox_md5
#main_checkbox_delete
#main_text_sourcefiles
#main_string_sourcefiles
#main_text_targetfiles
#main_string_targetfiles
#main_text_differentfiles
#main_string_differentfiles
#main_text_neueordner
#main_string_neueordner
#main_text_deletedfiles
#main_string_deletedfiles
#main_text_bytes
#main_string_bytes
#main_listview
#main_frame_statistic
#main_progressbar
#main_text_progress
#main_button_about
#main_button_start
EndEnumeration
Procedure wait4win()
Repeat
Delay(1)
Until WindowEvent()=0
EndProcedure
Procedure WindowCallback(hwnd, Message, wParam, lParam)
result = #PB_ProcessPureBasicEvents
Select Message
Case #WM_SIZE ; Größe ändern
Debug "Size changed:"
Select wParam
Case #SIZE_MINIMIZED
Debug "MINIMIZED"
Case #SIZE_RESTORED
Debug "RESTORED"
Case #SIZE_MAXIMIZED
Debug "MAXIMIZED"
EndSelect
Case #WM_RButtonDown ; Rechte Maus
Debug "Right Mousebutton"
Case #WM_LButtonDown ; LInks Maus
Debug "Left Mousebutton"
Case #WM_MButtonDown ; Mittlere Maus
Debug "Middle Mousebutton"
Case #WM_MOVE
Debug "Window moved"
EndSelect
ProcedureReturn result
EndProcedure
win_main=OpenWindow(#win_main,0,0,400,475,#PB_Window_ScreenCentered | #PB_Window_SystemMenu,"TEST")
If win_main And CreateGadgetList(win_main) And CreateStatusBar(#main_statusbar,win_main)
main_w=WindowWidth(): main_h=WindowHeight()
oben=10 : links=20 : buttonbreite=100 : hoehe=20 : abstand=10 : abstand_klein=5: textbreite=100 : stringbreite=100
TextGadget(#main_text_source, links, oben+5, main_w-links-buttonbreite-abstand*3, hoehe, "(Bitte Quell-Verzeichnis auswählen)", #PB_Text_Right)
ButtonGadget(#main_button_source, main_w-buttonbreite-abstand*2, oben, buttonbreite, hoehe, "Quelle", $8000)
oben+hoehe+abstand
TextGadget(#main_text_target, links, oben+5, main_w-links-buttonbreite-abstand*3, hoehe, "(Bitte Ziel-Verzeichnis auswählen)", #PB_Text_Right)
ButtonGadget(#main_button_target, main_w-buttonbreite-abstand*2, oben, buttonbreite, hoehe, "Ziel", $8000)
oben+hoehe+abstand*2
Frame3DGadget(#main_frame_options, links-10, oben, main_w-links, hoehe*4+abstand*3, "Optionen")
oben+abstand*2
CheckBoxGadget(#main_checkbox_logging, links, oben, main_w-links*2, hoehe, "Logging aktivieren (Datei: "+logfile$+")")
oben+hoehe+abstand
CheckBoxGadget(#main_checkbox_md5, links, oben, main_w-links*2, hoehe, "zusätzlich MD5-Fingerprint prüfen (hoher Zeitaufwand)")
oben+hoehe+abstand
CheckBoxGadget(#main_checkbox_delete, links, oben, main_w-links*2, hoehe, "Überflüssige Dateien auf Ziel löschen")
oben+hoehe+abstand*2
Frame3DGadget(#main_frame_statistic, links-10, oben, main_w-links, hoehe*6+abstand*6, "Statistik")
oben+abstand*2
TextGadget(#main_text_sourcefiles, links, oben, textbreite*2, hoehe, "Quell-Dateien")
StringGadget(#main_string_sourcefiles, main_w-textbreite-abstand*2, oben, stringbreite, hoehe, "0", #PB_String_ReadOnly | #PB_Text_Right)
oben+hoehe+abstand_klein
TextGadget(#main_text_targetfiles, links, oben, textbreite*2, hoehe, "Ziel-Dateien")
StringGadget(#main_string_targetfiles, main_w-textbreite-abstand*2, oben, stringbreite, hoehe, "0", #PB_String_ReadOnly | #PB_Text_Right)
oben+hoehe+abstand_klein
TextGadget(#main_text_differentfiles, links, oben, textbreite*2, hoehe, "Datei-Differenzen")
StringGadget(#main_string_differentfiles, main_w-textbreite-abstand*2, oben, stringbreite, hoehe, "0", #PB_String_ReadOnly | #PB_Text_Right)
oben+hoehe+abstand_klein
TextGadget(#main_text_neueordner, links, oben, textbreite*2, hoehe, "Neue Ordner angelegt")
StringGadget(#main_string_neueordner, main_w-textbreite-abstand*2, oben, stringbreite, hoehe, "0", #PB_String_ReadOnly | #PB_Text_Right)
oben+hoehe+abstand_klein
TextGadget(#main_text_deletedfiles, links, oben, textbreite*2, hoehe, "Gelöschte Dateien")
StringGadget(#main_string_deletedfiles, main_w-textbreite-abstand*2, oben, stringbreite, hoehe, "0", #PB_String_ReadOnly | #PB_Text_Right)
oben+hoehe+abstand_klein
TextGadget(#main_text_bytes, links, oben, textbreite*2, hoehe, "Bytes kopiert")
StringGadget(#main_string_bytes, main_w-textbreite-abstand*2, oben, stringbreite, hoehe, "0", #PB_String_ReadOnly | #PB_Text_Right)
oben+hoehe*2+abstand
ProgressBarGadget(#main_progressbar, links-10, oben, main_w-links-(textbreite/2)-abstand, hoehe, 1, 100, #PB_ProgressBar_Smooth)
TextGadget(#main_text_progress, main_w-(textbreite/2)-abstand*2, oben+5, textbreite/2, hoehe, "0%", #PB_Text_Right)
ButtonGadget(#main_button_start, links-10, main_h-50, buttonbreite*2, hoehe, "Starte Synchronisation",$8000)
ButtonGadget(#main_button_about, main_w-abstand-buttonbreite, main_h-50, buttonbreite, hoehe, "About", $8000)
AddStatusBarField(250)
StatusBarText(#main_statusbar,0,"Bitte Quell- und Zielverzeichnis wählen...")
AddStatusBarField(150)
StatusBarText(#main_statusbar,1,"(c) "+FormatDate(" %yyyy",Date()))
wait4win()
Else
MessageRequester(""+" FEHLER","Konnte Fenster nicht aufbauen!",#mb_iconerror)
End
EndIf
SetWindowCallback(@WindowCallback())
Repeat
Delay(1)
winevent=WindowEvent()
Until winevent=#PB_Event_CloseWindow Or main_exit=#True Or nowin=#True
Code: Alles auswählen
Repeat : Until WindowEvent()=0
Code: Alles auswählen
While WindowEvent() : Wend
Code: Alles auswählen
Procedure wait4win()
Repeat : Delay(1) : Until WindowEvent()=0
EndProcedure
Code: Alles auswählen
Procedure wait4win()
While WindowEvent() : Wend
EndProcedure
Code: Alles auswählen
Repeat
Delay(1)
wait4win()
winevent=WindowEvent()
;....gadgets abfragen...
Until winevent=#PB_Event_CloseWindow