Autor Beitrag
delphineuling
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 113

XP
wat dat
BeitragVerfasst: Do 16.03.06 14:28 
kann man irgendwie den countdownfortschritt(timer) mit einer progressbar darstellen und ist es sehr kompliziert?
Kroko
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1284

W98 W2k WXP
Turbo D
BeitragVerfasst: Do 16.03.06 14:29 
(1) ja
(2) nein

_________________
Die F1-Taste steht nicht unter Naturschutz und darf somit regelmäßig und oft benutzt werden! oder Wer lesen kann, ist klar im Vorteil!
Fabian W.
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: Do 16.03.06 14:33 
Schau dir die Eigenschaften position und max an. In max kommt die gesamte zeit (zB in msec) und in position der countdownfortschritt auch in msec. Proggen sollteste das ja nu selbst können.
delphineuling Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 113

XP
wat dat
BeitragVerfasst: Do 16.03.06 15:20 
ok aber was ist wenn man die maximale zeit immer veränder im edit muss man dann einfach mit dem edit die angabe max steuern
Fabian W.
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: Do 16.03.06 15:53 
Rrrrrichtischhhh. Und ggf dann halt posistion zurücksetzten.
delphineuling Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 113

XP
wat dat
BeitragVerfasst: Do 16.03.06 16:21 
mit refresh oder wie meinst du?
Fabian W.
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: Do 16.03.06 17:17 
probiers doch einfach aus. du brauchst kein refrech, einfach nur die eigenschaften ändern mit .position := wasweisdennich


mfg
delphineuling Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 113

XP
wat dat
BeitragVerfasst: Do 16.03.06 22:40 
habe das jetzt so gemacht sagt aber inkoplitable typen string und integer
aber ich muss TdateTime verwenden weil ja in label8 eine time ausgegeben wird
was ist da falsch?
ich adde einfach mal die ganze prozedure im makierten ist das was ich eben gemacht habe
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:
procedure TForm1.StartClick(Sender: TObject);
 var max: TdateTime;
begin

if listbox1.Items.Count=0
   then showmessage('Geben Sie bitte Namen ein!')
   else if listbox4.items.Count=0
        then showmessage('Geben Sie Mengenangaben ein!')
        else if listbox2.items.Count=0
             then showmessage('Geben Sie Getränke ein!')
             else if listbox3.items.Count=0
                  then showmessage('Geben Sie Kurze ein!')

   else if (radiobutton1.Checked=false) and (radiobutton2.Checked=false) and (radiobutton3.Checked=false) then showmessage ('Bitte die Häufigkeit auswählen!')


else begin
 Timer1.Enabled:=True;
stop.Enabled:=true;
start.Enabled:=false;
edit1.Enabled:=false;
edit2.Enabled:=false;
edit3.Enabled:=false;
edit4.Enabled:=false;
edit5.Visible:=false;
button2.Enabled:=false;
button3.Enabled:=false;
button4.Enabled:=false;
button5.Enabled:=false;
button6.Enabled:=false;
button7.Enabled:=false;
button8.Enabled:=false;
button9.Enabled:=false;
button1.Enabled:=false;
radiobutton1.Enabled:=false;
radiobutton2.Enabled:=false;
radiobutton3.Enabled:=false;
checkbox1.Enabled:=false;
label4.Caption:='verbleibende Zeit';
label4.Color:=clred;

max:=strtotime(label8.Caption);
progressbar1.Max:=timetostr(max);


end;
end;
Ironwulf
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 733
Erhaltene Danke: 2



BeitragVerfasst: Do 16.03.06 22:46 
in zeile 43, progressbar.max ist integer und du versucht da nen string draus zumachen, du solltest das die zeit in seknuden umrechnen und dann den wert als max nehmen
delphineuling Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 113

XP
wat dat
BeitragVerfasst: Do 16.03.06 22:56 
wie rechne ich den denn so einfach in sekunden um ohne die ausgabe im label oder ähnliches zu ändern?
Ironwulf
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 733
Erhaltene Danke: 2



BeitragVerfasst: Do 16.03.06 23:25 
we z.b. sieht denn das aus also in dem format hh:mm:ss oder wie?
max:=strtotime(label8.Caption);
delphineuling Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 113

XP
wat dat
BeitragVerfasst: Fr 17.03.06 09:37 
ja im hh:mm:ss format mit dem was du unten geschrieben hast hab ich es auch schon versucht aber wenn ich das so mache geht das auch nicht dann zeigt er an inkomitable typen sring und integer
Ironwulf
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 733
Erhaltene Danke: 2



BeitragVerfasst: Fr 17.03.06 15:18 
das für mich einfachste ist wohl das:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
var sekunden: Integer;
begin
  sekunden:= 0;
  sekunden:= StrToInt(copy(Label1.Caption,1,2)) * 3600;           //Stunden ins Sekunden
  sekunden:= sekunden + StrToInt(copy(Label1.Caption,4,2)) * 60;  //Minuten in Sekunden
  sekunden:= sekunden + StrToInt(copy(Label1.Caption,7,2));
end;


ist aber sicherlich nicht sonderlich elegant aber es funktioniert
delphineuling Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 113

XP
wat dat
BeitragVerfasst: Sa 18.03.06 14:13 
Jetzt sieht es so aus abr funktioniert immer noch nicht zeigt immernoch an inkompitable typen string und integer

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:
procedure TForm1.StartClick(Sender: TObject);
var sekunden,max : Integer;

begin

if listbox1.Items.Count=0
   then showmessage('Geben Sie bitte Namen ein!')
   else if listbox4.items.Count=0
        then showmessage('Geben Sie Mengenangaben ein!')
        else if listbox2.items.Count=0
             then showmessage('Geben Sie Getränke ein!')
             else if listbox3.items.Count=0
                  then showmessage('Geben Sie Kurze ein!')

   else if (radiobutton1.Checked=false) and (radiobutton2.Checked=false) and (radiobutton3.Checked=false) then showmessage ('Bitte die Häufigkeit auswählen!')


else begin
 Timer1.Enabled:=True;
 stop.Enabled:=true;
 start.Enabled:=false;
 edit1.Enabled:=false;
 edit2.Enabled:=false;
 edit3.Enabled:=false;
 edit4.Enabled:=false;
 edit5.Visible:=false;
 button2.Enabled:=false;
 button3.Enabled:=false;
 button4.Enabled:=false;
 button5.Enabled:=false;
 button6.Enabled:=false;
 button7.Enabled:=false;
 button8.Enabled:=false;
 button9.Enabled:=false;
 button1.Enabled:=false;
 radiobutton1.Enabled:=false;
 radiobutton2.Enabled:=false;
 radiobutton3.Enabled:=false;
 checkbox1.Enabled:=false;
 label4.Caption:='verbleibende Zeit';
 label4.Color:=clred;

    sekunden:= 0;
    sekunden:= StrToInt(copy(Label8.Caption,1,2)) * 3600;           //Stunden ins Sekunden
    sekunden:= sekunden + StrToInt(copy(Label8.Caption,4,2)) * 60;  //Minuten in Sekunden
    sekunden:= sekunden + StrToInt(copy(Label8.Caption,7,2));

       max:=strtoint(label8.Caption);
       progressbar1.Max:=inttostr(max);
  end;
end;
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: Sa 18.03.06 14:18 
Du sollst auch max in Sekunden umwandeln und net irgendwas anderes.

Bitte lies dir dieses Tutorial durch:
www.christian-stelzm...rials-crashkurs.html

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

XP
wat dat
BeitragVerfasst: Sa 18.03.06 14:54 
hab des jetzt so!aber immernoch der gleiche fehler
das tutorial hab ich schon auf dem pc

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:
procedure TForm1.StartClick(Sender: TObject);
var max : Integer;

begin

if listbox1.Items.Count=0
   then showmessage('Geben Sie bitte Namen ein!')
   else if listbox4.items.Count=0
        then showmessage('Geben Sie Mengenangaben ein!')
        else if listbox2.items.Count=0
             then showmessage('Geben Sie Getränke ein!')
             else if listbox3.items.Count=0
                  then showmessage('Geben Sie Kurze ein!')

   else if (radiobutton1.Checked=false) and (radiobutton2.Checked=false) and (radiobutton3.Checked=false) then showmessage ('Bitte die Häufigkeit auswählen!')


else begin
 Timer1.Enabled:=True;
 stop.Enabled:=true;
 start.Enabled:=false;
 edit1.Enabled:=false;
 edit2.Enabled:=false;
 edit3.Enabled:=false;
 edit4.Enabled:=false;
 edit5.Visible:=false;
 button2.Enabled:=false;
 button3.Enabled:=false;
 button4.Enabled:=false;
 button5.Enabled:=false;
 button6.Enabled:=false;
 button7.Enabled:=false;
 button8.Enabled:=false;
 button9.Enabled:=false;
 button1.Enabled:=false;
 radiobutton1.Enabled:=false;
 radiobutton2.Enabled:=false;
 radiobutton3.Enabled:=false;
 checkbox1.Enabled:=false;
 label4.Caption:='verbleibende Zeit';
 label4.Color:=clred;
 checkbox2.enabled:=false;

    max:= 0;
    max:= StrToInt(copy(Label8.Caption,1,2)) * 3600;           
    max:= max + StrToInt(copy(Label8.Caption,4,2)) * 60;  
    max:= max + StrToInt(copy(Label8.Caption,7,2));

       max:=strtoint(label8.Caption);
       progressbar1.Max:=inttostr(max);
  end;
end;
Ironwulf
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 733
Erhaltene Danke: 2



BeitragVerfasst: Sa 18.03.06 15:04 
es bringt ziemlich wenig wenn du die sekunden ausrechnest und dann doch wieder deine form hh:mm:ss drüber knallst

du musst die zeile 49 weglassen
max:=strtoint(label8.Caption);
delphineuling Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 113

XP
wat dat
BeitragVerfasst: Sa 18.03.06 15:08 
hab ich weggelassen immernoch das gleiche problem

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
 max:= 0;
    max:= StrToInt(copy(Label8.Caption,1,2)) * 3600;           
    max:= max + StrToInt(copy(Label8.Caption,4,2)) * 60;  
    max:= max + StrToInt(copy(Label8.Caption,7,2));
    progressbar1.Max:=inttostr(max);
Ironwulf
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 733
Erhaltene Danke: 2



BeitragVerfasst: Sa 18.03.06 15:11 
mmh schau dir doch selbst erst einmal den code an, bevor du sagst das etwas nicht geht, ich finde das ist ziemlich eindeutig was da nicht stimmt zu mal dir delphi auch noch die zeile markiert ( progressbar1.Max:=inttostr(max); )
delphineuling Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 113

XP
wat dat
BeitragVerfasst: Sa 18.03.06 15:18 
hmm hab ich mir angeguck und versucht was zu änder aber komm wohl net drauf was falsch ist