summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graeme@mastermaths.co.za>2011-05-06 00:15:18 +0200
committerGraeme Geldenhuys <graeme@mastermaths.co.za>2011-05-06 00:15:18 +0200
commit33cf8233c4eac5da5b48bec83e46116d7f5b5455 (patch)
tree4a60fabb15dcc473ecf1501850af3f95e0b3445b
parent0a0169338b275e020ba40c50f57d7e7d4ca77cb1 (diff)
downloadfpGUI-33cf8233c4eac5da5b48bec83e46116d7f5b5455.tar.xz
hook up the Style Manager.
The fpgStyle global variable is now simply a reference to the current style in the fpgStyleManager. The Style Manager does the free'ing of the style too, so we simply need to tell the style manager when we want that done.
-rw-r--r--src/corelib/fpg_main.pas10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/corelib/fpg_main.pas b/src/corelib/fpg_main.pas
index db86eded..3dd71fdf 100644
--- a/src/corelib/fpg_main.pas
+++ b/src/corelib/fpg_main.pas
@@ -1282,7 +1282,8 @@ begin
fpgNamedFonts.Free;
fpgImages.Free;
- fpgStyle.Free;
+ fpgStyleManager.FreeStyleInstance;
+ fpgStyle := nil;
fpgCaret.Free;
for i := fpgTimers.Count-1 downto 0 do
@@ -1580,7 +1581,12 @@ begin
FDefaultFont := GetFont(FPG_DEFAULT_FONT_DESC);
fpgInitTimers;
fpgNamedFonts := TList.Create;
- fpgStyle := TfpgStyle.Create;
+
+ { If the end-user passed in a style, try and create an instance of it }
+ if gCommandLineParams.IsParam('style') then
+ fpgStyleManager.SetStyle(gCommandLineParams.GetParam('style'));
+ fpgStyle := fpgStyleManager.Style;
+
fpgCaret := TfpgCaret.Create;
fpgImages := TfpgImages.Create;