diff options
author | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2008-06-30 13:25:51 +0000 |
---|---|---|
committer | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2008-06-30 13:25:51 +0000 |
commit | ea4a9faddc8c3a5322d43d2484df9d6cc1a04041 (patch) | |
tree | 8f2716b3b35982111da2daf284c7c3b4ae4ca8b7 /prototypes/fpgui2/tests | |
parent | e1c7d515faed0c5ee53db5492fb7bc714fdff02a (diff) | |
download | fpGUI-ea4a9faddc8c3a5322d43d2484df9d6cc1a04041.tar.xz |
* A quick implementation of the Vista Black button.
* Minor code cleanup in GDI window title procedure.
Diffstat (limited to 'prototypes/fpgui2/tests')
-rw-r--r-- | prototypes/fpgui2/tests/themetest.lpr | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/prototypes/fpgui2/tests/themetest.lpr b/prototypes/fpgui2/tests/themetest.lpr index fe17a37b..c194e571 100644 --- a/prototypes/fpgui2/tests/themetest.lpr +++ b/prototypes/fpgui2/tests/themetest.lpr @@ -18,7 +18,7 @@ uses gfx_extinterpolation, gui_trackbar, gui_style, - gui_dialogs, fpgui_toolkit; + gui_dialogs; type { Note: @@ -49,7 +49,7 @@ type destructor Destroy; override; { this property is only for demo purposes! } property ThemeImage: TfpgImage read image write SetThemeImage; - property Masked: Boolean read FMasked write FMasked; + property Masked: Boolean read FMasked write FMasked default False; property ThemeBorder: Integer read FThemeBorder write FThemeBorder default 3; end; @@ -429,6 +429,7 @@ var iy, y: integer; w: integer; pofs: integer; + ow, oh: integer; begin Canvas.BeginDraw; // inherited HandlePaint; @@ -448,16 +449,9 @@ begin State := 0; end; - //if Assigned(image) then - //begin - //try - //image.CreateMaskFromSample(0, 0); - //image.UpdateImage; - //except - //raise Exception.Create('Failed to create ImageMask in TThemeButton'); - //end; - //end; - PaintPartScaledImage(image, Canvas, 0, 0, 32, 21, Width, Height, FThemeBorder, state, FMasked); + ow := image.Width div 5; // 5 states + oh := image.Height; + PaintPartScaledImage(image, Canvas, 0, 0, ow, oh, Width, Height, FThemeBorder, state, FMasked); (* x := 0; { left } @@ -646,14 +640,12 @@ begin vista := TThemeButton.Create(self); vista.Left := 20; vista.Top := 145; - vista.Width := 100; - vista.Height := 26; + vista.Width := 101; //75; + vista.Height := 41; //24; vista.TextColor := clWhite; vista.FontDesc := 'Arial-10:bold'; vista.Text := 'Vista'; bmp := LoadImage_BMP(SetDirSeparators('../../../images/themes/vista/button.bmp')); - bmp.CreateMaskFromSample(0, 0); - bmp.UpdateImage; vista.ThemeImage := bmp; styledbutton := TStyledButton.Create(self); |