Forum: GUI-Design mit VCL / FireMonkey / Common Controls
Delphi
by DeddyH,
31. Okt 2008
Kleiner Verbesserungsvorschlag: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);
end;
Forum: GUI-Design mit VCL / FireMonkey / Common Controls
Delphi
by DeddyH,
31. Okt 2008
Basierend auf obigem Code habe ich mal diese Funktion gebastelt:function CompHasCaption(AClass : TObject; out sResult: string): Boolean;
const sProp = 'Caption';
var
MyPropInfo: PPropInfo;
begin
sResult := '';
MyPropInfo := GetPropInfo(AClass.ClassInfo, sProp);
Result := Assigned(MyPropInfo);
if Result then
sResult := GetPropValue(AClass, sProp);
Forum: GUI-Design mit VCL / FireMonkey / Common Controls
Delphi
by DeddyH,
31. Okt 2008
Abgesehen davon verstehe ich nicht, wieso 2 Schleifen nacheinander abgearbeitet werden.
Forum: GUI-Design mit VCL / FireMonkey / Common Controls
Delphi
by DeddyH,
31. Okt 2008
Und mit -1 kommt der Fehler auch?