Bei anklicken des Windows wird das Programm angehalten??
Verfasst: 17.12.2004 10:48
Hallo,
wenn man bei dem Folgenden Programm das Window mit der Maus anklickt um z.B. das Window zu verschieben wird das Programm währen des verschiebend angehalten. Das erkennt man daran dass die Progressbars nicht mehr weiterlaufen.
Ist das normal oder mache ich etwas falsch
BrunoF
wenn man bei dem Folgenden Programm das Window mit der Maus anklickt um z.B. das Window zu verschieben wird das Programm währen des verschiebend angehalten. Das erkennt man daran dass die Progressbars nicht mehr weiterlaufen.
Ist das normal oder mache ich etwas falsch
BrunoF
Code: Alles auswählen
#Window_0 = 0
Global quit.b
Enumeration
#Gadget_Window_0_Ueberschrift
#Gadget_Window_0_UeberPBar_1
#Gadget_Window_0_PBar_1
#Gadget_Window_0_Fortschritt_1
#Gadget_Window_0_UeberPBar_2
#Gadget_Window_0_PBar_2
#Gadget_Window_0_Fortschritt_2
#Gadget_Window_0_ButtonOK
EndEnumeration
quit = 0
Procedure OpenWindow0()
If OpenWindow(#Window_0, 100, 100, 350, 250, #PB_Window_SystemMenu, "Daten einlesen")
If CreateGadgetList(WindowID(#Window_0))
TextGadget(#Gadget_Window_0_Ueberschrift, 20, 20, 300, 25,"Die Daten weden eingelesen",#PB_Text_Center)
TextGadget(#Gadget_Window_0_UeberPBar_1, 20, 50, 300, 25,"P:\")
ProgressBarGadget(#Gadget_Window_0_PBar_1, 20, 75, 300,25,0,100,#PB_ProgressBar_Smooth)
TextGadget(#Gadget_Window_0_Fortschritt_1, 20, 100, 300, 25, "0%",#PB_Text_Center)
TextGadget(#Gadget_Window_0_UeberPBar_2, 20, 125, 300, 25,"Gesamt")
ProgressBarGadget(#Gadget_Window_0_PBar_2, 20, 150, 300,25,0,100,#PB_ProgressBar_Smooth)
TextGadget(#Gadget_Window_0_Fortschritt_2, 20, 175, 300, 25, "0%",#PB_Text_Center)
ButtonGadget(#Gadget_Window_0_ButtonOK, 150, 205, 50, 25, "ESC", #PB_Button_Default)
EndIf
EndIf
EndProcedure
;----------------------------------------------------------------------
Procedure Test()
i.b = 0
j.b = 1
x.b = 0
y.b = 0
For j = 1 To 3
SetGadgetText(#Gadget_Window_0_UeberPBar_1,"Datei : "+Str(j))
For i = 0 To 100
EventID = WindowEvent()
Select EventID
Case #PB_Event_Gadget
If EventGadgetID() = #Gadget_Window_0_ButtonOK
quit = 1
Break
EndIf
EndSelect
SetGadgetState(#Gadget_Window_0_PBar_1, i)
SetGadgetText(#Gadget_Window_0_Fortschritt_1, Str(i)+"%")
x=(i/3) + y
SetGadgetState(#Gadget_Window_0_PBar_2, x)
SetGadgetText(#Gadget_Window_0_Fortschritt_2, Str(x)+"%")
Delay(10)
Next i
If quit = 1
Break
EndIf
y = x
Next j
SetGadgetState(#Gadget_Window_0_PBar_2, 100)
SetGadgetText(#Gadget_Window_0_Fortschritt_2,"100%")
EndProcedure
;-------------------------------------------------------------------------
OpenWindow0()
Test()
SetGadgetText(#Gadget_Window_0_ButtonOK,"OK")
Repeat
EventID = WaitWindowEvent()
Select EventID
Case #PB_Event_Gadget
If EventGadgetID() = #Gadget_Window_0_ButtonOK
quit = 1
EndIf
Case #PB_Event_CloseWindow
quit = 1
EndSelect
Until quit = 1