Autor |
Beitrag |
bayou
Beiträge: 88
D6 PE
|
Verfasst: Di 16.12.08 09:55
Nur mal so nebenbei.
Ich gehe einen Ordner (languages) im Pfad des Programmes durch und lese alle Sprachedateien (.lang) in ein Menü.
Dies soll der Anwender auswählen können und bei Programmende wird diese .lang Datei in die Programm Ini gespeichert, damit beim nächsten öffnen diese wieder geladen wird.
@jaenicke
im Moment stehe ich noch etwas auf dem Schlauch wie ich deinen Vorschlag umsetzen muss.
Könntest dur mir noch einen weiteren Tip geben?
Vielen Dank
|
|
jaenicke
Beiträge: 19285
Erhaltene Danke: 1743
W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
|
Verfasst: Di 16.12.08 09:59
|
|
bayou
Beiträge: 88
D6 PE
|
Verfasst: Di 16.12.08 10:09
Danke für deine Antwort.
Und in der .lang Datei würde dann
Form1:Testform
als Caption für "Form1" abgerufen werden oder?
Bei mir funktioniert es nämlich nicht.
|
|
jaenicke
Beiträge: 19285
Erhaltene Danke: 1743
W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
|
Verfasst: Di 16.12.08 10:11
Ich habs nicht ausprobiert, du kannst ja nen Haltepunkt da setzen und schauen was passiert. Ich hätte vermutet, dass es so richtig ist.
|
|
bayou
Beiträge: 88
D6 PE
|
Verfasst: Di 16.12.08 10:15
ich habe mal einen Haltepunkt auf
Delphi-Quelltext 1:
| AForm.Caption := ACaption |
gesetzt und da läuft er munter drüber.
|
|
jaenicke
Beiträge: 19285
Erhaltene Danke: 1743
W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
|
Verfasst: Di 16.12.08 10:17
Ich meinte eher auf die if-Abfrage, denn wenn du in der Sprachdatei die Zeile als erstes schreibst kommt das Programm ja als erstes dort an.
|
|
bayou
Beiträge: 88
D6 PE
|
Verfasst: Di 16.12.08 10:17
Habe ich auch.
Dort wurde gestoppt.
Es geht auch erst weiter wenn der Haltepunkt entfernt wurde.
|
|
bayou
Beiträge: 88
D6 PE
|
Verfasst: Di 16.12.08 13:13
ich denke es hat etwas mit folgender funktion zu tun.
Delphi-Quelltext 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14:
| function ParseFileEntry(FileEntry: String; var Components: TFileEntryComponent): Boolean; begin try Components.ComponentName := Copy(FileEntry, 1, Pos(':', FileEntry) - 1); Delete(FileEntry, 1, Pos(':', FileEntry)); Components.Caption := FileEntry; Result := true; except Result := false; end; end; |
da hier auch nur die Komponenten angesprochen werden (wenn ich das richtig verstehe)
|
|
jaenicke
Beiträge: 19285
Erhaltene Danke: 1743
W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
|
Verfasst: Di 16.12.08 13:27
Das dient nur zum Parsen soweit ich das sehe.
Ok ok, ich werde es mal wirklich ansehen und testen statt den Quelltext nur zu überfliegen. (Ich hatte gedacht das würde genügen.)
|
|
alzaimar
Beiträge: 2889
Erhaltene Danke: 13
W2000, XP
D6E, BDS2006A, DevExpress
|
Verfasst: Di 16.12.08 14:03
Nette Idee, aber Spaltenübersichriften bei Grids sowie Support für TreeViews, Listviews usw. und Drittkomponenten fehlt, oder hab ich was übersehen?
_________________ Na denn, dann. Bis dann, denn.
|
|
jaenicke
Beiträge: 19285
Erhaltene Danke: 1743
W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
|
Verfasst: Di 16.12.08 14:07
Das kann man ja anpassen, AXMD hat die Unit ja für sein Projekt entwickelt und nicht als allumfassende Lösung...
|
|
bayou
Beiträge: 88
D6 PE
|
Verfasst: Di 16.12.08 14:10
|
|
jaenicke
Beiträge: 19285
Erhaltene Danke: 1743
W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
|
Verfasst: Di 16.12.08 14:51
|
|
bayou
Beiträge: 88
D6 PE
|
Verfasst: Di 16.12.08 16:41
Spitze, es geht.
Vielen vielen Dank
Da wäre ich nie drauf gekommen.
|
|
bayou
Beiträge: 88
D6 PE
|
Verfasst: Mi 17.12.08 10:38
Ich habe es noch etwas ergänzt damit man auch den Titel der RadioGroup bekommt.
Sollte kein Titel genutzt werden bleibt der erste Eintrag frei
Delphi-Quelltext 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16:
| else if AForm.FindComponent(ComponentName) is TRadioGroup then begin RadioGroup := TRadioGroup(AForm.FindComponent(ComponentName)); RadioGroup.Caption := Copy(ACaption, 1, Pos(';', ACaption) - 1); Delete(ACaption, 1, Pos(';', ACaption)); for i := 0 to RadioGroup.Items.Count - 1 do begin if Pos(';', ACaption) = 0 then RadioGroup.Items[i] := ACaption else RadioGroup.Items[i] := Copy(ACaption, 1, Pos(';', ACaption) - 1); Delete(ACaption, 1, Pos(';', ACaption)); end; Result := True; Exit; end; |
für StringGrid konnte ich diese Lösung anpassen.
Delphi-Quelltext 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14:
| else if AForm.FindComponent(ComponentName) is TStringGrid then begin StringGrid := TStringGrid(AForm.FindComponent(ComponentName)); for i := 0 to StringGrid.ColCount - 1 do begin if Pos(';', ACaption) = 0 then StringGrid.Cells[i, 0] := ACaption else StringGrid.Cells[i, 0] := Copy(ACaption, 1, Pos(';', ACaption) - 1); Delete(ACaption, 1, Pos(';', ACaption)); end; Result := True; Exit; end |
auch hier wird der erste Eintrag einfach frei gelassen wenn in der 1. Spalte nichts stehen soll.
StringGrid1:;Spalte2;Spalte3
Bitte sagte mir wenn ich Fehler darin haben sollte.
Nochmals vielen Dankfür die Hilfe
|
|
MDX
Beiträge: 595
Erhaltene Danke: 4
Windows 8.1, Linux Debian 8, Android Lollipop
Delphi, PHP, Java (Android)
|
Verfasst: Sa 28.03.09 21:25
Wie kann man das für ne Combobox nutzen???
|
|
jaenicke
Beiträge: 19285
Erhaltene Danke: 1743
W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
|
Verfasst: Sa 28.03.09 21:50
Ich sag mal so: Ob es sinnvoll ist, ist die Frage, aber generell kannst du natürlich auch die Werte einer ComboBox reinschreiben. Du musst das ja nur entsprechend anpassen.
Je umfangreicher das wird, desto besser wäre eine professionellere Lösung, da gibts ja einige Möglichkeiten. Von den delphiinternen bis zu String Ressource Managern und externen Multilanguage-Tools.
|
|
|