summaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
Diffstat (limited to 'gui')
-rw-r--r--gui/form.inc4
-rw-r--r--gui/style.inc19
-rw-r--r--gui/stylemanager.pas4
-rw-r--r--gui/widget.inc14
4 files changed, 25 insertions, 16 deletions
diff --git a/gui/form.inc b/gui/form.inc
index 2cfb343d..f87b4f99 100644
--- a/gui/form.inc
+++ b/gui/form.inc
@@ -56,7 +56,9 @@
procedure WndShow(Sender: TObject);
protected
FBorderWidth: Integer;
- FIsActive, FResizedByUser, FPositionSpecified: Boolean;
+ FIsActive: Boolean;
+ FResizedByUser: Boolean;
+ FPositionSpecified: Boolean;
procedure Loaded; override;
procedure Paint(Canvas: TFCanvas); override;
procedure Resized; override;
diff --git a/gui/style.inc b/gui/style.inc
index e66469f3..6954b78b 100644
--- a/gui/style.inc
+++ b/gui/style.inc
@@ -29,11 +29,11 @@
TArrowDirection = (arrowUp, arrowDown, arrowLeft, arrowRight);
{ Style declarations }
- TStyle = class
+ TStyle = class(TObject)
protected
UIColorCache: array[0..$18] of TGfxColor;
public
- constructor Create(ADisplay: TFCustomApplication); virtual;
+ constructor Create; virtual;
// Colors
procedure UpdateUIColorCache;
function GetGUIColor(Color: TColor): TGfxColor; virtual; abstract;
@@ -91,10 +91,11 @@
TDefaultStyle = class(TStyle)
protected
- ImageCanvas, MaskCanvas: TFCanvas;
+ ImageCanvas: TFCustomCanvas;
+ MaskCanvas: TFCustomCanvas;
// ArrowBitmaps: array[TArrowDirection] of TGfxImage;
public
- constructor Create(ADisplay: TFCustomApplication); override;
+ constructor Create; override;
destructor Destroy; override;
// Colors
function GetGUIColor(Color: TColor): TGfxColor; override;
@@ -167,7 +168,7 @@
{ TStyle }
-constructor TStyle.Create(ADisplay: TFCustomApplication);
+constructor TStyle.Create;
begin
inherited Create;
UpdateUIColorCache;
@@ -230,7 +231,7 @@ const
{$ENDIF}
-constructor TDefaultStyle.Create(ADisplay: TFCustomApplication);
+constructor TDefaultStyle.Create;
const
// 60x12 pixel 4bpp bitmap
RadioBitmapData: array[0..359] of Byte = (
@@ -287,7 +288,7 @@ var
Palette: TGfxPalette;
Image: TFBitmap;
begin
- inherited Create(ADisplay);
+ inherited Create;
PalData[0] := colMagenta;
PalData[1] := GetGUIColor(cl3DDkShadow);
@@ -307,6 +308,10 @@ begin
// MaskCanvas := ADisplay.DefaultScreen.CreateMonoBitmap(12, 12);
// Palette := ADisplay.DefaultScreen.CreatePalette(8, @PalData);
+ ImageCanvas := GFScreen.CreateBitmapCanvas(65, 33);
+ MaskCanvas := GFScreen.CreateMonoBitmapCanvas(12, 12);
+ Palette := TGfxPalette.Create(8, @PalData);
+
Image := TFBitmap.Create(60, 12, PixelFormatPal4);
Image.Palette := Palette;
diff --git a/gui/stylemanager.pas b/gui/stylemanager.pas
index c128d7d3..dce91366 100644
--- a/gui/stylemanager.pas
+++ b/gui/stylemanager.pas
@@ -69,14 +69,14 @@ begin
else
begin
if not Assigned(FDefaultStyle) then
- FDefaultStyle := TDefaultStyle.Create(GFApplication);
+ FDefaultStyle := TDefaultStyle.Create;
Result := FDefaultStyle;
end;
end;
constructor TStyleManager.Create;
begin
- FUserStyle := nil;
+ FUserStyle := nil;
FDefaultStyle := nil;
end;
diff --git a/gui/widget.inc b/gui/widget.inc
index fb4fe59f..d5c10449 100644
--- a/gui/widget.inc
+++ b/gui/widget.inc
@@ -189,7 +189,7 @@
function EvMouseLeaveCheck(Event: TMouseLeaveCheckEventObj): Boolean;
protected
FCursor: TFCursor;
- FText: String;
+ FText: string;
FStyle: TStyle;
FCanExpandHeight: Boolean;
FCanExpandWidth: Boolean;
@@ -198,7 +198,9 @@
FOrigin: TPoint;
FBoundsSize: TSize;
FClientRect: TRect;
- FMinSize, FMaxSize, FDefSize: TSize;
+ FMinSize: TSize;
+ FMaxSize: TSize;
+ FDefSize: TSize;
WidgetStyle: TWidgetStyle;
WidgetState: TWidgetState;
procedure Loaded; override;
@@ -451,10 +453,10 @@ constructor TWidget.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
WidgetState := [wsEnabled];
- FCanExpandWidth := False;
- FCanExpandHeight := False;
- FEnabled := True;
- FVisible := True;
+ FCanExpandWidth := False;
+ FCanExpandHeight := False;
+ FEnabled := True;
+ FVisible := True;
end;
destructor TWidget.Destroy;