Autor Beitrag
Robby
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 31

Winxp
Delphi 4
BeitragVerfasst: Mo 24.10.05 12:06 
Weis vielleicht jemand wie man das Datum in MenuItem (Menüleiste)anzeigen kann.

Mfg
Robby


Moderiert von user profile iconraziel: Topic aus Dateizugriff verschoben am Mo 24.10.2005 um 12:51

_________________
Es gibt keine dummen Fragen,
nur dumme Antworten.
Martin1966
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1068

Win 2000, Win XP
Delphi 7, Delphi 2005
BeitragVerfasst: Mo 24.10.05 12:16 
Hallo :wink2:

Erstelle ein TMenuItem und mit Hilfe eines Timers setzt du jede Sekunde oder jede Minute die Caption neu.

Warum hast du das Topic in die Sparte "Dateizugriffe" geschrieben?

Lg Martin

_________________
Ein Nutzer der Ecke ;-)
Robby Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 31

Winxp
Delphi 4
BeitragVerfasst: Mo 24.10.05 12:29 
Weis ich auch nicht???????
Vielleicht aus Unwissenheit,
kannst du das vielleicht ein genauer Erklären vielleicht so.
ausblenden Delphi-Quelltext
1:
MenuItem1.Caption := DateToStr(Now);					

Robby

_________________
Es gibt keine dummen Fragen,
nur dumme Antworten.
Martin1966
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1068

Win 2000, Win XP
Delphi 7, Delphi 2005
BeitragVerfasst: Mo 24.10.05 13:35 
user profile iconRobby hat folgendes geschrieben:
kannst du das vielleicht ein genauer Erklären vielleicht so. [...]

Ja, genau so.

_________________
Ein Nutzer der Ecke ;-)
JustusJonas
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 222



BeitragVerfasst: Mo 24.10.05 13:40 
Ich hab mir mal eine eigene Funktion geschrieben, damit das Datum auch richtig formatiert ist:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
function TfrmZeiterfassung.GetDatum: string;
var
  y, m, d     : word;
  ys, ms, ds  : string;
begin
  DecodeDate (date, y, m, d);
  ys := IntToStr (y);
  ms := IntToStr (m);
  ds := IntToStr (d);
  if m < 10 then ms := '0' + ms;
  if d < 10 then ds := '0' + ds;
  GetDatum := ds + '.' + ms + '.' + ys;
end;


Das ganze wird dann so in etwa in eine Statusleiste geschrieben:
ausblenden Delphi-Quelltext
1:
StatusBar1.Panels[1].Text := GetDatum;					


Greetz
Robby Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 31

Winxp
Delphi 4
BeitragVerfasst: Mo 24.10.05 13:45 
Muss ich vorher ein items Untermenü anlegen Z.B. „datum“?
Aber wie bekomme ich den das Datum rechts in Ecke

ausblenden Delphi-Quelltext
1:
datum.caption:='Datum '+DateToStr(Now);					

mfg.
Robby

_________________
Es gibt keine dummen Fragen,
nur dumme Antworten.
JustusJonas
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 222



BeitragVerfasst: Mo 24.10.05 13:49 
Vielleicht wäre es hilfreich, wenn du uns mal genau erklären würdest, was du machen möchtest!?
Ist es sinnvoll ein Datum in einem MenüItem anzeigen zu lassen?

Greetz
Robby Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 31

Winxp
Delphi 4
BeitragVerfasst: Mo 24.10.05 13:59 
user profile iconJustusJonas hat folgendes geschrieben:
Ich hab mir mal eine eigene Funktion geschrieben, damit das Datum auch richtig formatiert ist:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
function TfrmZeiterfassung.GetDatum: string;
var
  y, m, d     : word;
  ys, ms, ds  : string;
begin
  DecodeDate (date, y, m, d);
  ys := IntToStr (y);
  ms := IntToStr (m);
  ds := IntToStr (d);
  if m < 10 then ms := '0' + ms;
  if d < 10 then ds := '0' + ds;
  GetDatum := ds + '.' + ms + '.' + ys;
end;


Das ganze wird dann so in etwa in eine Statusleiste geschrieben:
ausblenden Delphi-Quelltext
1:
StatusBar1.Panels[1].Text := GetDatum;					


Greetz




Hei,
Greetz deine function Funzelt prima Danke .
Gruß Robby

_________________
Es gibt keine dummen Fragen,
nur dumme Antworten.
Robby Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 31

Winxp
Delphi 4
BeitragVerfasst: Mo 24.10.05 14:02 
user profile iconJustusJonas hat folgendes geschrieben:
Vielleicht wäre es hilfreich, wenn du uns mal genau erklären würdest, was du machen möchtest!?
Ist es sinnvoll ein Datum in einem MenüItem anzeigen zu lassen?

Greetz

Nur zur Info, Datum und Uhrzeit links in der Ecke
Gruß Robby

_________________
Es gibt keine dummen Fragen,
nur dumme Antworten.
Alpha_Wolf
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 297

Ubuntu, Win XP, Win Vista
C#, Delphi 6 Prof, Delphi 2007 Prof, Java
BeitragVerfasst: Mo 24.10.05 14:03 
user profile iconJustusJonas hat folgendes geschrieben:
Ich hab mir mal eine eigene Funktion geschrieben, damit das Datum auch richtig formatiert ist:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
function TfrmZeiterfassung.GetDatum: string;
var
  y, m, d     : word;
  ys, ms, ds  : string;
begin
  DecodeDate (date, y, m, d);
  ys := IntToStr (y);
  ms := IntToStr (m);
  ds := IntToStr (d);
  if m < 10 then ms := '0' + ms;
  if d < 10 then ds := '0' + ds;
  GetDatum := ds + '.' + ms + '.' + ys;
end;


Das ganze wird dann so in etwa in eine Statusleiste geschrieben:
ausblenden Delphi-Quelltext
1:
StatusBar1.Panels[1].Text := GetDatum;					


Greetz


Die Funktion kannst du dir vollkommen sparen..

Um ein Datum oder eine Uhrzeit zu formatieren ist FormatDateTime ein wenig einfacher ;) Falls du nicht weisst wies geht in die Delphi Hilfe gucken oder die Forumssuche.

Ich denke das dein Vorhaben nur mit viel basteln erfolgreich sein wird. Ich würde dazu tendieren die Uhrzeit komplett wegzulassen da sie ja sowieso in der Startleiste sichtbar ist. Falls du aber dennoch eine möchtest würde ich dir die Statusleiste empfehlen..

Außerdem ist das ein Menü und keine Anzeige für Uhrzeit und Datum.. Manchmal ist Zweckenfremdung nicht wirklich sinnvoll.. ^_^

Überlegs dir nochmal.

_________________
Diskutiere nie mit einem Irren - er zieht dich auf sein Niveau und schlägt dich mit seiner Erfahrung.
chrisw
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 439
Erhaltene Danke: 3

W2K
D7
BeitragVerfasst: Mo 24.10.05 14:10 
Ich würde das so machen !
Timer interval auf 1000
ausblenden Delphi-Quelltext
1:
2:
3:
4:
procedure TForm1.Timer1Timer(Sender: TObject);
begin
  Form1.Caption := TimeToStr(now);
end;


Oder entsprechend DateToStr(now);

_________________
Man sollte keine Dummheit zweimal begehen, die Auswahl ist schließlich groß genug.
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: Mo 24.10.05 15:10 
Hallo,
user profile iconAlpha_Wolf hat folgendes geschrieben:
...
Außerdem ist das ein Menü und keine Anzeige für Uhrzeit und Datum.. Manchmal ist Zweckenfremdung nicht wirklich sinnvoll.. ^_^

es sei denn man möchte eine Funktion zum einfügen von Datum und Uhrzeit anbieten. :wink:

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )
Martin1966
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1068

Win 2000, Win XP
Delphi 7, Delphi 2005
BeitragVerfasst: Mo 24.10.05 17:51 
user profile iconRobby hat folgendes geschrieben:
Aber wie bekomme ich den das Datum rechts in Ecke


user profile iconRobby hat folgendes geschrieben:
Nur zur Info, Datum und Uhrzeit links in der Ecke


Was denn jetzt? Links oder rechts? Datum oder/oder Uhrzeit? :?

_________________
Ein Nutzer der Ecke ;-)
GSE
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 740

Win 2k, Win XP Pro
D5 Prof, D6 Ent, D2k5 PE
BeitragVerfasst: Mo 24.10.05 19:40 
Lannes hat folgendes geschrieben:
es sei denn man möchte eine Funktion zum einfügen von Datum und Uhrzeit anbieten.
IMHO ist es auch da nicht ratsam, das Datum im Menü _anzeigen_ zu lassen (caption -> Aktuelles Datum einfügen o.ä.). Alles andere verwirrt nur (Füge 12:30:12 ein; Ach nein: Füge 12:30:13 ein; Auch nicht: Füge 12:30:14 ein uswusf., nein Danke) :wink:
mal davon abgesehen, dass es dann immer unnötig neugezeichnet werden muss.

mfg
GSE

_________________
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs
and the universe trying to produce bigger and better idiots. So far, the universe is winning. (Richard Cook)


Zuletzt bearbeitet von GSE am Mo 24.10.05 19:48, insgesamt 1-mal bearbeitet
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: Mo 24.10.05 20:22 
Hallo,

meine Gedanken gingen in diese Richtung:
Menübeispiel:
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
Einfügen
         Datum oder Uhrzeit > Montag, 24. Oktober 2005
                              24.10.2005
                              2005-10-24
                              24. Okt 2005
                              20:13:40
                              24.10.2005 20:13
dann z.B im Ereignis DatumUndUhrzeitClick vor Aufbau des Submenüs die SubItem-Captionen entsprechend einrichten.
(nicht mit Timer)

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )