English
Source / code snippets

Analog watch

 

CompileMarkSeparation
Source wurde am 15.07.2007 aus der MMJ-Quellcodesammlung (Dietmar Horn) in die Babyklappe auf XProfan.Com abgelegt:
Analog-Uhr
Declare xi%,yi%
Declare ende%

Proc Rechnen

    Parameters Winkel!
    Declare x!,y!
    Winkel! = Winkel! - (@PI()/2)   Winkel um 90 Grad zurück
    x! = @COS(Winkel!)
    y! = @SIN(Winkel!)
    x! = x! * (@Width(%hwnd) / 2)   Radius korrigieren
    y! = y! * (@Height(%hwnd) / 2)
    x! = x! + (@Width(%hwnd) / 2)   auf Fenstermittelpunkt setzen
    y! = y! + (@Height(%hwnd) / 2)
    xi%= @INT(x!)                   Nur Ganzzahlen
    yi%= @INT(y!)

EndProc

Proc Zeiger

    Declare Winkel%
    Declare Hour%,Min%,sec%,x%,y%
    Hour% = @VAL(left$(@Time$(0),2))
    Min% = @VAL(Mid$(@Time$(0),4,2))
    sec% = @VAL(left$(@Time$(1),2))
    Ellipse 0,0-@Width(%hwnd),@Height(%hwnd)        Kreis zeichnen
    Rechnen (2* @PI()/60)*sec%                      Sekundenzeiger ausrechnen
    MoveTo (@Width(%hwnd) / 2), (@height(%hwnd) / 2)auf Fenstermittelpunkt setzen
    LineTo xi%,yi%                                  Sekundenzeiger zeichnen
    Rechnen (2* @PI()/60)*min%                      Minutenzeiger
    MoveTo (@Width(%hwnd) / 2), (@height(%hwnd) / 2)
    LineTo xi%,yi%

    If hour% > 12

        Hour% = hour% - 12

    EndIf

    Rechnen (2* @PI()/12)*hour%                     Stundenzeiger
    MoveTo (@Width(%hwnd) / 2), (@height(%hwnd) / 2)
    LineTo xi%,yi%
    Settext %hwnd,Time$(0) + : + left$(@Time$(1),2)

EndProc

Proc GoUhr

    Declare Ende%
    SetTimer 1000
    Let Ende% = 0

    WHILENOT Ende%

        WaitInput

        If %wmTimer

            Zeiger

        EndIf

    ENDWHILE

    KillTimer

EndProc

window 0,0-300,340
settruecolor 1

whilenot ende%

    GoUhr

end
 
07/16/07  
 



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

3.620 Views

Untitledvor 0 min.
Normann Strübli09/05/20
ecki08/27/17
Peter Max Müller05/02/15
RudiB.01/24/15
More...

Themeninformationen

this Topic has 1 subscriber:

unbekannt (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