From aae6921b382bbe1a6a0aff25d065494ab2a2abc7 Mon Sep 17 00:00:00 2001 From: graemeg Date: Fri, 2 Nov 2007 14:05:53 +0000 Subject: * New Background property for TfpgBevel --- src/gui/gui_bevel.pas | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/gui/gui_bevel.pas b/src/gui/gui_bevel.pas index 84406a46..faad992e 100644 --- a/src/gui/gui_bevel.pas +++ b/src/gui/gui_bevel.pas @@ -39,6 +39,8 @@ type private FBevelShape: TBevelShape; FBevelStyle: TBevelStyle; + FBackgroundColor: TfpgColor; + procedure SetBackgroundColor(const AValue: TfpgColor); procedure SetBevelShape(const AValue: TBevelShape); procedure SetBevelStyle(const AValue: TBevelStyle); protected @@ -48,6 +50,7 @@ type published property Shape: TBevelShape read FBevelShape write SetBevelShape default bsBox; property Style: TBevelStyle read FBevelStyle write SetBevelStyle default bsRaised; + property BackgroundColor: TfpgColor read FBackgroundColor write SetBackgroundColor default clWindowBackground; end; @@ -80,6 +83,12 @@ begin Repaint; end; +procedure TfpgBevel.SetBackgroundColor(const AValue: TfpgColor); +begin + if FBackgroundColor=AValue then exit; + FBackgroundColor:=AValue; +end; + procedure TfpgBevel.SetBevelStyle(const AValue: TBevelStyle); begin if FBevelStyle = AValue then @@ -92,7 +101,7 @@ procedure TfpgBevel.HandlePaint; begin Canvas.BeginDraw; inherited HandlePaint; - Canvas.Clear(clWindowBackground); + Canvas.Clear(BackgroundColor); // Canvas.SetLineStyle(2, lsSolid); // Canvas.SetColor(clWindowBackground); @@ -138,6 +147,7 @@ begin FWidth := 80; FHeight := 80; FFocusable := True; // otherwise children can't get focus + FBackgroundColor := clWindowBackground; end; end. -- cgit v1.2.3-70-g09d2