Hi Guys and girls,
I'm trying to save the font settings of my component and load them back in via xml.
I have xml working with saving and loading of every property except Font.
When I save font its as an integer.
But when I load the value back in the same way it does access violation.
I'm using the same way of changing the font at run time but when it comes to loading the same details it fails.
Any help is much appreciated.
Thanks in Advance
Changing my Font at run time this works
if ValueListEditor1.Keys[I] = 'Font' then
begin
selectedControl := DesignCanvas.getSelectedControl;
TempFont := TFont(GetOrdProp(selectedControl, 'Font'));
if assigned(TempFont) then
begin
TempFont.Color := TFont(GetOrdProp(selectedControl, 'Font')).Color;
end;
FontDialog1.Font := tempFont;
FontDialog1.Execute;
SetOrdProp(SelectedControl,'Font', Integer(FontDialog1.Font));
end
Loading Font from XML thats not working but using the same methods as above.
tempInt := 0;
tempFont := nil;
tempInt := Integer(String(Node.Attributes['Font']));
tempFont := TFont(tempInt);
SetOrdProp(component,'Font', Integer(tempFont));