summaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graemeg@users.sourceforge.net>2006-11-28 12:54:17 +0000
committerGraeme Geldenhuys <graemeg@users.sourceforge.net>2006-11-28 12:54:17 +0000
commit0f38c8497fd2a9348fe0eac9a823683e75989873 (patch)
tree3c63e22be0b205705fb550c943ea7a44a29ac5bb /gui
parent9ee3d0b39b9aea0119bf5b16d1eee87111cc1b33 (diff)
downloadfpGUI-0f38c8497fd2a9348fe0eac9a823683e75989873.tar.xz
* Starting fixing up the utfdemo for use with the new GFX.
* Minor code formatting of IMG code
Diffstat (limited to 'gui')
-rw-r--r--gui/style.inc7
-rw-r--r--gui/stylemanager.pas17
2 files changed, 20 insertions, 4 deletions
diff --git a/gui/style.inc b/gui/style.inc
index c8700536..e66469f3 100644
--- a/gui/style.inc
+++ b/gui/style.inc
@@ -308,8 +308,7 @@ begin
// Palette := ADisplay.DefaultScreen.CreatePalette(8, @PalData);
- {$Note All data image formats was PixelFormatPal4, is 8bit going to work? }
- Image := TFBitmap.Create(60, 12, PixelFormatPal8);
+ Image := TFBitmap.Create(60, 12, PixelFormatPal4);
Image.Palette := Palette;
Image.SetPixelsFromData(@RadioBitmapData, 30);
ImageCanvas.DrawImage(Image, Point(0, 0));
@@ -320,13 +319,13 @@ begin
MaskCanvas.DrawImage(Image, Point(0, 0));
Image.Free;
- Image := TFBitmap.Create(66, 13, PixelFormatPal8); {!!!: width is 65, but fpGFX emulayer has a problem with odd widths}
+ Image := TFBitmap.Create(66, 13, PixelFormatPal4); {!!!: width is 65, but fpGFX emulayer has a problem with odd widths}
Image.Palette := Palette;
Image.SetPixelsFromData(@CheckBoxBitmapData, 33);
ImageCanvas.DrawImage(Image, Point(0, 12));
Image.Free;
- Image := TFBitmap.Create(64, 8, PixelFormatPal8);
+ Image := TFBitmap.Create(64, 8, PixelFormatPal4);
Image.Palette := Palette;
Image.SetPixelsFromData(@ArrowBitmapData, 32);
ImageCanvas.DrawImage(Image, Point(0, 25));
diff --git a/gui/stylemanager.pas b/gui/stylemanager.pas
index fab17479..c128d7d3 100644
--- a/gui/stylemanager.pas
+++ b/gui/stylemanager.pas
@@ -32,6 +32,8 @@ type
FUserStyle: TStyle;
function GetDefaultStyle: TStyle;
public
+ constructor Create;
+ destructor Destroy;override;
property DefaultStyle: TStyle read GetDefaultStyle;
procedure SetStyle(pNewStyle: TStyle);
end;
@@ -72,6 +74,21 @@ begin
end;
end;
+constructor TStyleManager.Create;
+begin
+ FUserStyle := nil;
+ FDefaultStyle := nil;
+end;
+
+destructor TStyleManager.Destroy;
+begin
+ if FUserStyle <> nil then
+ FUserStyle.Free;
+ if FDefaultStyle <> nil then
+ FDefaultStyle.Free;
+ inherited Destroy;
+end;
+
procedure TStyleManager.SetStyle(pNewStyle: TStyle);
begin
if Assigned(FUserStyle) then