 KHR | allô miteinander,
. dernièrement beim Kunden: d'abord fiel mir qui verflixte Stoppuhr aus qui main dans den Mischer et ensuite mußte je encore soooo longtemps attendre jusqu'à sa Anlage bereit était. alors hab je aus qui Not une Tugend gemacht et mir sur qui schnelle ne Stoppuhr sur dem Notebook dans XProfan gebastelt.
vous ist weder joli programmiert encore joli gestaltet - mais elle a funktioniert. voilà tout quoi gezählt hat.
je denke. là wird sûrement quelqu'un Verbesserungen anbringen peut
Stoppuhr dans Xprofan 10
Karl-Heinz Rattay 04/2008
Klick sur:
Start: montre beginnt récente trop courir
Zwischenzeit: commuter entre Anzeige fonctionne ou bien steht
Stopp: Endzeit wird angezeigt, sowie Start-, Endzeit et la durée dans Tabelle eingetragen
montre beginnt récente trop courir
RESET: Tabelle wird gelöscht.
declare Startzeit&
declare Laufzeit&
declare rohzeit&
declare rohzent&
declare rohsek&
declare rohmin&
declare rohstd&
declare ProgEnde%
declare run_Clock%
declare GridEintrag$
declare StoppZeit$
Déclarer Button1&, Button2&, Button3&, Button4&, Button5&, Button6&
Def @AGetSysColor(1) ! USER32,GetSysColor
proc UhrZeit
usefont Arial,26,0,0,0,0
drawtext 30,90, ZeitString$()
drawtext 160,90, date$(1)
endproc
proc ZeitString$
return @Left $(@Time $(0)+:+@Time $(1),8)
endproc
proc show_clock
rohzeit& = ((&GetTickCount - Startzeit&)/100)
rohzent& = Rohzeit&-@int(Rohzeit& /10)*10
rohsek& = @int((Rohzeit& /10))
rohstd& = @int((Rohzeit& /36000))
rohmin& = @MOD ( Rohzeit&,36000)
rohsek& = @int(Rohzeit&/10)
rohStd& = @int(RohSek&/3600)
rohsek& = rohSek& - (RohStd&*3600)
rohMin& = @int(RohSek&/60)
rohsek& = rohSek& - (RohMin&*60)
usefont Arial,80,0,0,0,0
@Set(NumWidth,1)
StoppZeit$= @left$(@Format $(00,RohStd&)+:+@Format $(00,RohMin&)+:+@Format $(00,RohSek&)+:+@str$(Rohzent&),10)
drawtext 30,5, StoppZeit$
windowtitle StoppZeit$
endproc
window 10,10-400,520
CLS @AGetSysColor(10)
Button1& = @CREATE( BUTTON , %HWnd , Start , 10, 320, 110, 30 )
Button2& = @CREATE( BUTTON , %HWnd , Stopp , 250, 320, 110 ,30 )
Button3& = @CREATE( BUTTON , %HWnd , Zwischenzeit , 130, 320, 110, 30 )
Button4& = @CREATE( BUTTON , %HWnd , RESET , 250, 380, 110, 30 )
Button5& = @CREATE( BUTTON , %HWnd , Ende , 10, 380, 110, 30 )
declare hGrid%,Titel$,GridBox&
GridBox& = Créer(Dialog, %Hwnd, Stoppuhr Logfile, 420, 90, 260, 280)
1. Spalten définir
Titel$ = Start;0;60;Ende;0;60;Zeit;0;100
2. Gridbox erstellen
hGrid% = Créer(GridBox, GridBox&, Titel$, 0, 0, 0, 230, 290)
settimer 100
run_clock% = 0
clearlist (hGrid%)
Startzeit& = &GetTickCount
show_clock
whilenot ProgEnde%
cas run_clock% = 1 : show_clock
UhrZeit
WaitInput
si %KEY = 2
ProgEnde% = 1
elseif @Clicked(Button1&) Start
Startzeit& = &GetTickCount
run_clock% = 1
GridEintrag$ = ZeitString$()+|
elseif @Clicked(Button2&) Stopp
run_clock% = 0
show_clock
GridEintrag$ = GridEintrag$+ZeitString$()+|+StoppZeit$
Eintrag Zeitstring ins Grid
AddStrings(hGrid%, GridEintrag$)
Zeitstring récente aufsetzten
GridEintrag$ = ZeitString$()+|
windowtitle Stoppuhr
Startzeit& = &GetTickCount
elseif @Clicked(Button3&) Zwischenzeit
si run_clock% = 0
run_clock% = 1
d'autre
run_clock% = 0
endif
elseif @Clicked(Button4&) Reset
clearlist (hGrid%)
Startzeit& = &GetTickCount
show_clock
elseif @Clicked(Button5&)
ProgEnde% = 1
endif
endwhile
killtimer
. |
|