English
Source / code snippets

Einfache stopwatch

 

KHR
Hello together,

.
recently at customers: first fell me The verflixte stopwatch from the hand into Mischer and then had to I yet soooo long Waiting To its equipment ready was. means Have I from the hardship a Tugend made and me on The speedy ne stopwatch on the Notebook in XProfan gebastelt.

she's weder beautiful program yet beautiful configures - but she has functions. this is everything what counted has.

i think. there becomes sure someone Improvements place can
stopwatch in XProfan 10
Karl-Heinz Rattay 04/2008
Click on:
Start:         watch begins new To walk
interim:  switch between display runs or standing
Stopp:         Endzeit becomes displayed, as well as Start-, Endzeit and duration in scheduler registered
watch begins new To walk
RESET:         scheduler becomes deleted.
declare Startzeit&
declare Laufzeit&
declare rohzeit&
declare rohzent&
declare rohsek&
declare rohmin&
declare rohstd&
declare ProgEnde%
declare run_Clock%
declare GridEintrag$
declare StoppZeit$
Declare 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$(@stature$(00,RohStd&)+:+@stature$(00,RohMin&)+:+@stature$(00,RohSek&)+:+@st$(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 , interim  , 130, 320, 110, 30 )
Button4&  = @CREATE( BUTTON   , %HWnd , RESET         , 250, 380, 110, 30 )
Button5&  = @CREATE( BUTTON   , %HWnd , end          ,  10, 380, 110, 30 )
declare hGrid%,cover$,GridBox&
GridBox&     = Create(dialog, %Hwnd, stopwatch Logfile, 420, 90, 260, 280)
1. Split define
Titel$ = Start;0;60;end;0;60;Time;0;100
2. GridBOX create
hGrid%   = Create(GridBOX, GridBox&, cover$, 0, 0, 0, 230, 290)
settimer 100
run_clock% = 0
clearlist (hGrid%)
Startzeit& = &GetTickCount
show_clock

whilenot ProgEnde%

    case run_clock% = 1 :  show_clock
    UhrZeit
    WaitInput

    if %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$
        entry Zeitstring in that Grid
        AddStrings(hGrid%, GridEintrag$)
        Zeitstring new aufsetzten
        GridEintrag$ = ZeitString$()+|
        windowtitle stopwatch
        Startzeit& = &GetTickCount

    elseif @Clicked(Button3&) interim

        if run_clock% = 0

            run_clock% = 1

        else

            run_clock% = 0

        endif

    elseif @Clicked(Button4&)   Reset

        clearlist (hGrid%)
        Startzeit& = &GetTickCount
        show_clock

    elseif @Clicked(Button5&)

        ProgEnde% = 1

    endif

endwhile

killtimer

.
 
Gruß
Karl-Heinz
WIN XP home/Pro / XPROFAN 11 / P2CPP
ATMEL + BASCOM Fan
04/20/08  
 




Rolf
Koch

she's weder beautiful program yet beautiful configures - but she has functions. this is everything what counted has.


there wiederspreche I you! I find it very beautiful strukturiert and clear. and the counts too
 
04/20/08  
 




Jac
de
Lad
tappt im dunkeln erfüllt ihren object. what nützt me grafisch aufwändige stopwatch?
 
Profan² 2.6 bis XProfan 11.1+XPSE+XPIA+XPRR (und irgendwann XIDE)
Core2Duo E8500/T2250, 8192/1024 MB, Radeon HD4850/Radeon XPress 1250, Vista64/XP
04/20/08  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

4.942 Views

Untitledvor 0 min.
Tommy vor 13 Tagen
Frank04/16/21
Peter Max Müller11/14/17
Walter Köhler05/21/14
More...

Themeninformationen

this Topic has 3 subscriber:

Jac de Lad (1x)
Rolf Koch (1x)
KHR (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie