Forum: GUI-Design mit VCL / FireMonkey / Common Controls
Delphi
by KodeZwerg,
13. Mai 2021
Das übernehme ich gerne so wie Du es geschrieben hast.
Vielen Dank Uwe! :thumb:
//edit
Noch eine Frage, wäre
if (Prop.Name = sPropFont) and Prop.PropertyType.IsInstance and Prop.PropertyType.AsInstance.MetaclassType.InheritsFrom(TFont) then
TFont(prop.GetValue(AObject).AsObject).Color := FColorText;
nicht sinnvoller um gleich am Anfang unnützes auszuschließen?
Forum: GUI-Design mit VCL / FireMonkey / Common Controls
Delphi
by KodeZwerg,
13. Mai 2021
Guten Morgen!
Ich bin gerade am aufräumen meines Codes und wollte nun Deinen Vorschlag richtig umsetzen, zur Sicherheit Frage ich nochmal nach ob ich es so anwende wie Du es meintest.
procedure TfrmMain.SetObjectColors(AObject: TObject);
const
sPropColor = 'Color';
sPropFont = 'Font';
var
Context: TRttiContext;
Forum: GUI-Design mit VCL / FireMonkey / Common Controls
Delphi
by KodeZwerg,
10. Mai 2021
procedure TfrmMain.ApplyThemedColors;
var
i: Integer;
begin
if IsDarkTheme then
begin
FBackgroundColor := FColorSet.Colors;
FTextColor := FColorSet.Colors;
end
else
Forum: GUI-Design mit VCL / FireMonkey / Common Controls
Delphi
by KodeZwerg,
10. Mai 2021
Da habe ich das Problem das dann die Font-Farbe bei manchen Objekten schwarz bleibt, siehe Anhang.
Forum: GUI-Design mit VCL / FireMonkey / Common Controls
Delphi
by KodeZwerg,
10. Mai 2021
Im Anhang ein paar Bilder vom jetzt-Zustanded des Projekts.
Das erste Bild verwendet von Windows das Dark/Light Theme.
Das zweite Bild verwendet die in Windows eingestellte Farbe.
Das dritte Bild verwendet einen durchschnittswert vom Wallpaper.
Das vierte Bild nutzt clBtnFace und clWindowText als Delphi-Vorgabe.
Forum: GUI-Design mit VCL / FireMonkey / Common Controls
Delphi
by KodeZwerg,
10. Mai 2021
@generic
procedure TfrmMain.SetObjectColors(AObject: TObject);
const
sPropColor = 'Color';
sPropFont = 'Font.Color';
var
Context: TRttiContext;
RType: TRttiType;
Prop: TRttiProperty;
begin
Forum: GUI-Design mit VCL / FireMonkey / Common Controls
Delphi
by KodeZwerg,
9. Mai 2021
Hey stahli, vielen Dank für den Link, "coding BOTT" kannte ich noch nicht, wird sich nun ändern, super tutorials, echt empfehlenswert, mehr Werbung machen dafür :thumb:
Forum: GUI-Design mit VCL / FireMonkey / Common Controls
Delphi
by KodeZwerg,
9. Mai 2021
Danke DeddyH, ich denke das Dein letzter Post genau mein Ding ist um voran zu kommen!
function CompSetCaption(AClass : TObject; const Caption: string): Boolean;
const sProp = 'Caption';
var
MyPropInfo: PPropInfo;
begin
MyPropInfo := GetPropInfo(AClass.ClassInfo, sProp);
Result := Assigned(MyPropInfo);
if Result then
SetPropValue(AClass, sProp, Caption);
Forum: GUI-Design mit VCL / FireMonkey / Common Controls
Delphi
by KodeZwerg,
9. Mai 2021
Hallo liebe Community,
kann man eine Property eines TObjects setzen ohne das die methode das TObject kennt?
Was ich vorhabe ist hoffentlich Verständlich und kurz genug erklärt, ohne das Ihr einschlaft beim Lesen ;)
Ich würde mir gerne eine Methode schreiben die eine TForm entgegen nimmt.
procedure SetProperties(const AForm: TForm);