Autor Beitrag
D. Annies
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Di 16.02.10 09:36 
Hi, Delpher,

mit dem folgenden Code versuche ich, einer Label.Caption das MinimizeName-Ergebnis zuzuweisen, aber ich bekomme nur einen Teilstring angezeigt und nicht die abgekürzte Ansicht. Liegt es am Array .. of Char?

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
procedure TPatMatForm.ReceiveStrVariable(var msg: TWMCopyData );
var sText  : array[0..256of Char;
begin
  StrLCopy(sText, Msg.CopyDataStruct.lpData, Msg.CopyDataStruct.cbData);
  qFname := sText;
  //Label11.Caption := qFname;       {uses FileCtrl/SysUtils}
  Label11.Caption := MinimizeName(qFname,        //Der abzukürzende Pfadname
                                  Label11.Canvas, //Die Referenz-Zeichenfläche
                                  Label11.Width); //Die maximale Ausgabe-Breite
  Label11.Hint := qFname; Button9.Hint := qFname;
  opendialog1.FileName := qFname;
end;


Vielen Dank für Hilfe,
Detlef

_________________
ut vires desint, tamen est laudanda voluntas
Bergmann89
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1742
Erhaltene Danke: 72

Win7 x64, Ubuntu 11.10
Delphi 7 Personal, Lazarus/FPC 2.2.4, C, C++, C# (Visual Studio 2010), PHP, Java (Netbeans, Eclipse)
BeitragVerfasst: Di 16.02.10 09:44 
Hey,

ist qFname auch ein array, oder ein String? Wie is der gesammte Dateiname? Welchen Teil bekommst du angezeigt?

MfG Bergmann.

_________________
Ich weiß nicht viel, lern aber dafür umso schneller^^
D. Annies Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Di 16.02.10 09:55 
Hi, Bergmann,

qFname ist vom Typ Filename;
Der gesamte Dateiname ist z.B. F:\Daten\Delphi\Aktuell\Buch\2010\Namensliste.txt
Angezeigt bekomme ich Namensliste.tx (das Label ist klein)

Also, gewünscht ist ja etwa: F:\..\Namens..
Im Hint lasse ich mir sowieso den gesamten Dateinamen anzeigen und das geht auch.

Detlef

_________________
ut vires desint, tamen est laudanda voluntas
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6393
Erhaltene Danke: 147

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Di 16.02.10 10:59 
Ist Dein Label vielleicht so klein, dass selbst der Dateiname alleine schon nicht hineinpasst?
Soweit ich die Funktion MinimizeName verstehe, werden nur die Verzeichnisse durch Punkte ersetzt und der Dateiname bleibt unverändert erhalten.
D. Annies Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Di 16.02.10 11:11 
Hi, Peter,
das werde ich mal gleich prüfen,
Detlef

P.S.
Ja, das war's. Danke

_________________
ut vires desint, tamen est laudanda voluntas
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Di 16.02.10 13:16 
Es gibt bei einem Label doch extra eine Eigenscaft, die man setzen kann um einen solchen Effekt zu erzielen.
Ich glaube Ellipsis oder so hieß die Eigenschaft.

_________________
In the beginning was the word.
And the word was content-type: text/plain.
D. Annies Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Di 16.02.10 14:18 
Da hast du recht - danke, aber dann muss ich eine neue Kompo installieren.

_________________
ut vires desint, tamen est laudanda voluntas
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Di 16.02.10 16:02 
wieso das denn? das ist doch das normale TLabel...

_________________
In the beginning was the word.
And the word was content-type: text/plain.
D. Annies Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Mi 17.02.10 15:29 
Hi, Matze,
das kann ich leider nicht erkennen!
Klar mich mal auf!
Gruß, Det

_________________
ut vires desint, tamen est laudanda voluntas
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Mi 17.02.10 15:42 
shot
So meine ich das. Aber ich sehe grade, dass du maximal mit D2006 unterwegs bist. Es kann schon sein, dass dieses Feature da noch gar nicht eingebaut war.
Einloggen, um Attachments anzusehen!
_________________
In the beginning was the word.
And the word was content-type: text/plain.
Bergmann89
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1742
Erhaltene Danke: 72

Win7 x64, Ubuntu 11.10
Delphi 7 Personal, Lazarus/FPC 2.2.4, C, C++, C# (Visual Studio 2010), PHP, Java (Netbeans, Eclipse)
BeitragVerfasst: Mi 17.02.10 15:43 
Hey,

die Ellipsis-Eigenschaft gibts bei mir auch nich. Liegt vlt daran das Matze ein neueres Delphi hat als wir?!

MfG Bergmann

_________________
Ich weiß nicht viel, lern aber dafür umso schneller^^
D. Annies Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Mi 17.02.10 17:14 
Ja, so isses! *vollneidischsei*
Det

_________________
ut vires desint, tamen est laudanda voluntas
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Mi 17.02.10 20:22 
Oh. Sorry. Ich dachte das wäre schon früher dazugekommen...

_________________
In the beginning was the word.
And the word was content-type: text/plain.
D. Annies Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Mi 17.02.10 22:15 
*Immernochvollneidischsei* :wink: :D

_________________
ut vires desint, tamen est laudanda voluntas