Autor Beitrag
rulingorc
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 40



BeitragVerfasst: Fr 01.06.07 11:51 
hi.
hab ein problem mit meiner uhr.
Problem: Meine Zeiger laufen nur zeitgleich mit der zeit der uhr, wenn ich auf einen button klicke. wenn ich aufs button klick formatieren sich die zeiger der zeit entsprechend, nur muss ich immer wieder auf das button klicken damit die zeiger sich wieder an die uhrzeit angepasst sind. was soll ich im button noch eingeben damit das problem gelöst ist=??????? ty
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Fr 01.06.07 11:56 
Nimm nen Timer, aber was hat das mit Freeware zu tun?

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
Nilan
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 29

Win VistaSP1

BeitragVerfasst: Fr 01.06.07 12:13 
Hau doch mal den Code rein, mich würde nämlich interessierne, wie du das realisiert hast ;)



user profile iconGTA-Place hat folgendes geschrieben:
Nimm nen Timer, aber was hat das mit Freeware zu tun?


Warum Freeware?

Nilan
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Fr 01.06.07 12:33 
Weil der Thread vorher in der Freeware-Sparte war, aber irgend ein Mod zu faul ist, seinen Mod-Tag in den Thread zu setzen :mrgreen:.

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
Nilan
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 29

Win VistaSP1

BeitragVerfasst: Fr 01.06.07 12:51 
Achso... immer diese Mods :P

Nilan
rulingorc Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 40



BeitragVerfasst: Fr 01.06.07 13:24 
hab doch schon nen timer. etwa noch nen 2ten? und was soll ich dann dareinschreiben?

ich load gerad noch delphi 7 hab sonst nur delphi 5 inner schule. danach kann ich vllt mal einen screenshot machen.


Zuletzt bearbeitet von rulingorc am Fr 01.06.07 13:31, insgesamt 1-mal bearbeitet
Miri
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 657


Delphi 3 Prof., Delphi 2005 PE
BeitragVerfasst: Fr 01.06.07 13:25 
Lass uns mal deinen Code sehen, das macht es etwas einfacher, dein Problem zu erraten ;-)

_________________
Anonymes Eckenkind
rulingorc Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 40



BeitragVerfasst: Fr 01.06.07 13:32 
wenn du mir sagst wie man das mit dem code macht: mach das hier zum ersten mal wie man merkt ;)
Leuchtturm
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1087

Win Vista, Knoppix, Ubuntu
Delphi 7 Pe, Turbo Delphi, C#(VS 2005 Express), (X)HTML + CSS, bald Assembler
BeitragVerfasst: Fr 01.06.07 13:37 
ausblenden Quelltext
1:
<span class="inlineSyntax"><span class="codecomment">{PROTECTTAG299993868621bbd3c46ee3d52d4a3d05}</span></span>					

_________________
Ich bin dafür verantwortlich was ich sage - nicht dafür was du verstehst.
rulingorc Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 40



BeitragVerfasst: Fr 01.06.07 13:37 
dankesehr ich probiers mal ^^
jakobwenzel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: Fr 01.06.07 13:37 
Du sollst ihn uns einfach zeigen, damit wir nicht so viel raten müssen.

_________________
I thought what I'd do was, I'd pretend I was one of those deaf-mutes.
rulingorc Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 40



BeitragVerfasst: Fr 01.06.07 13:41 
chillness bin noch nen bisschen langsam : )
ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
unit 
unit

interface

uses
  SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  Forms, Dialogs, StdCtrls, Buttons, ExtCtrls;

type
  TFormUhr = class(TForm)
    LabelAusgabe: TLabel;
    TimerUhr: TTimer;
    Label1: TLabel;
    BitBtn1: TBitBtn;
    BitBtn2: TBitBtn;
    Edit1: TEdit;
    procedure TimerUhrTimer(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure BitBtn1Click(Sender: TObject);
    procedure BitBtn2Click(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  FormUhr: TFormUhr;
  Breite, Hoehe, XPos, YPos, SecWinkel, MinWinkel, StdWinkel, SecWinkelAlt, MinWinkelAlt, StdWinkelAlt, Sec, Min, Std, Typ : Integer;
  Zeit, Anzahl: String;
implementation

{$R *.DFM}

procedure TFormUhr.TimerUhrTimer(Sender: TObject);
begin
   LabelAusgabe.Caption := TimeToStr (Time);
end;

procedure TFormUhr.FormCreate(Sender: TObject);
begin
   LabelAusgabe.Caption := TimeToStr (Time);
   randomize;
end;

procedure TFormUhr.BitBtn1Click(Sender: TObject);
begin
close;
end;

procedure TFormUhr.BitBtn2Click(Sender: TObject);
begin

Zeit := TimeToStr(Time); 
Edit1.Text := Zeit; 
Std := StrToInt(Copy(Zeit,1,2)); 
Min := StrToInt(Copy(Zeit,4,2)); 
Sec := StrToInt(Copy(Zeit,7,2)); 

SecWinkel := (( 6 * Sec)+90); 
MinWinkel := (( 6 * Min)+90); 
StdWinkel := ((30 * Std)+90); 

XPos := Trunc (cos(SecWinkelAlt * Pi /180) *(-100)); 
YPos := Trunc (sin(SecWinkelAlt * Pi /180) *(-100)); 

Canvas.MoveTo(150,150); 
Canvas.Pen.Color := clBtnFace; 
Canvas.Pen.Width := 1; 
Canvas.LineTo((XPos + 150),(YPos + 150)); 

XPos := Trunc (cos(MinWinkelAlt * Pi /180) *(-100)); 
YPos := Trunc (sin(MinWinkelAlt * Pi /180) *(-100)); 

Canvas.MoveTo(150,150); 
Canvas.Pen.Color := clBtnFace; 
Canvas.Pen.Width := 3; 
Canvas.LineTo((XPos + 150),(YPos + 150)); 

XPos := Trunc (cos(StdWinkelAlt * Pi /180) *(-80)); 
YPos := Trunc (sin(StdWinkelAlt * Pi /180) *(-80)); 

Canvas.MoveTo(150,150); 
Canvas.Pen.Color := clBtnFace; 
Canvas.Pen.Width := 3; 
Canvas.LineTo((XPos + 150),(YPos + 150)); 

XPos := Trunc (cos(SecWinkel * Pi /180) *(-100)); 
YPos := Trunc (sin(SecWinkel * Pi /180) *(-100)); 

Canvas.MoveTo(150,150); 
Canvas.Pen.Color := 0; 
Canvas.Pen.Width := 1; 
Canvas.LineTo((XPos + 150),(YPos + 150)); 

XPos := Trunc (cos(MinWinkel * Pi /180) *(-100)); 
YPos := Trunc (sin(MinWinkel * Pi /180) *(-100)); 

Canvas.MoveTo(150,150); 
Canvas.Pen.Color := 0; 
Canvas.Pen.Width := 3; 
Canvas.LineTo((XPos + 150),(YPos + 150)); 

XPos := Trunc (cos(StdWinkel * Pi /180) *(-80)); 
YPos := Trunc (sin(StdWinkel * Pi /180) *(-80)); 

Canvas.MoveTo(150,150); 
Canvas.Pen.Color := 0; 
Canvas.Pen.Width := 3; 
Canvas.LineTo((XPos + 150),(YPos + 150)); 

SecWinkelAlt := SecWinkel; 
MinWinkelAlt := MinWinkel;
StdWinkelAlt := StdWinkel;
end;

end.
Miri
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 657


Delphi 3 Prof., Delphi 2005 PE
BeitragVerfasst: Fr 01.06.07 13:44 
das ganze, was in deiner prozedur procedure TFormUhr.BitBtn2Click(Sender: TObject); passiert, gehört in das OnTimer-Ereignis. Dann setzt du das Timerintervall auf 1000 (millisekunden) und in die BitBtn2Click-Prozedur (oder ins FormCreate oder so) schreibst du TimerUhr.Enabled := True;

_________________
Anonymes Eckenkind
rulingorc Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 40



BeitragVerfasst: Fr 01.06.07 13:48 
ok werds mal gleich probieren wenn er mit dem mega dl bald mal fertig ist... dauert ja jahre delphi 7 zu loaden. danke schonmal .)
Leuchtturm
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1087

Win Vista, Knoppix, Ubuntu
Delphi 7 Pe, Turbo Delphi, C#(VS 2005 Express), (X)HTML + CSS, bald Assembler
BeitragVerfasst: Fr 01.06.07 13:49 
Zitat:
ausblenden Delphi-Quelltext
1:
TimerUhr.Enabled := True;					

Timer sind eigentlich standardmäßig enabled = true

_________________
Ich bin dafür verantwortlich was ich sage - nicht dafür was du verstehst.
Miri
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 657


Delphi 3 Prof., Delphi 2005 PE
BeitragVerfasst: Fr 01.06.07 13:55 
user profile iconLeuchtturm hat folgendes geschrieben:
Timer sind eigentlich standardmäßig enabled = true


Es schadet aber nicht, zu wissen, dass man die Dinger ein-/ausschalten kann/muss, oder?! ;-)

_________________
Anonymes Eckenkind