From 8c4b085a78dccc8f5e5fe429a360ad456175b173 Mon Sep 17 00:00:00 2001 From: graemeg Date: Fri, 7 Sep 2007 07:52:15 +0000 Subject: * GUI: Rename the Checkbox property FontName to FontDesc to be consistent with the rest of the fpGUI controls. * GUI: Introduced FontDesc and HeaderFontDesc properties in TfpgBaseGrid and published them in descendant components. * GUI Designer: All newly placed components now default to the Delphi coding standards component prefixes. --- src/gui/gui_basegrid.pas | 30 ++++++++++++++++++++++++++++++ src/gui/gui_checkbox.pas | 10 +++++----- src/gui/gui_grid.pas | 19 ++++++++++++++----- 3 files changed, 49 insertions(+), 10 deletions(-) (limited to 'src/gui') diff --git a/src/gui/gui_basegrid.pas b/src/gui/gui_basegrid.pas index 79dec0ed..5ffaa9ef 100644 --- a/src/gui/gui_basegrid.pas +++ b/src/gui/gui_basegrid.pas @@ -54,7 +54,11 @@ type FTemp: integer; FVScrollBar: TfpgScrollBar; FHScrollBar: TfpgScrollBar; + function GetFontDesc: string; + function GetHeaderFontDesc: string; procedure HScrollBarMove(Sender: TObject; position: integer); + procedure SetFontDesc(const AValue: string); + procedure SetHeaderFontDesc(const AValue: string); procedure SetRowSelect(const AValue: boolean); procedure VScrollBarMove(Sender: TObject; position: integer); procedure SetBackgroundColor(const AValue: TfpgColor); @@ -89,7 +93,9 @@ type property DefaultColWidth: integer read FDefaultColWidth write SetDefaultColWidth default 64; property DefaultRowHeight: integer read FDefaultRowHeight write SetDefaultRowHeight; property Font: TfpgFont read FFont; + property FontDesc: string read GetFontDesc write SetFontDesc; property HeaderFont: TfpgFont read FHeaderFont; + property HeaderFontDesc: string read GetHeaderFontDesc write SetHeaderFontDesc; property BackgroundColor: TfpgColor read FBackgroundColor write SetBackgroundColor; property FocusCol: integer read FFocusCol write SetFocusCol; property FocusRow: integer read FFocusRow write SetFocusRow; @@ -124,6 +130,30 @@ begin end; end; +function TfpgBaseGrid.GetFontDesc: string; +begin + Result := FFont.FontDesc; +end; + +function TfpgBaseGrid.GetHeaderFontDesc: string; +begin + Result := FHeaderFont.FontDesc; +end; + +procedure TfpgBaseGrid.SetFontDesc(const AValue: string); +begin + FFont.Free; + FFont := fpgGetFont(AValue); + RePaint; +end; + +procedure TfpgBaseGrid.SetHeaderFontDesc(const AValue: string); +begin + FHeaderFont.Free; + FHeaderFont := fpgGetFont(AValue); + RePaint; +end; + procedure TfpgBaseGrid.SetRowSelect(const AValue: boolean); begin if FRowSelect = AValue then diff --git a/src/gui/gui_checkbox.pas b/src/gui/gui_checkbox.pas index 7f36dfbb..f9cb6cbe 100644 --- a/src/gui/gui_checkbox.pas +++ b/src/gui/gui_checkbox.pas @@ -22,10 +22,10 @@ type FFont: TfpgFont; FBoxSize: integer; FIsPressed: boolean; - function GetFontName: string; + function GetFontDesc: string; procedure SetBackgroundColor(const AValue: TfpgColor); procedure SetChecked(const AValue: boolean); - procedure SetFontName(const AValue: string); + procedure SetFontDesc(const AValue: string); procedure SetText(const AValue: string); protected procedure HandlePaint; override; @@ -39,7 +39,7 @@ type published property Checked: boolean read FChecked write SetChecked; property Text: string read FText write SetText; - property FontName: string read GetFontName write SetFontName; + property FontDesc: string read GetFontDesc write SetFontDesc; property BackgroundColor: TfpgColor read FBackgroundColor write SetBackgroundColor; property OnChange: TNotifyEvent read FOnChange write FOnChange; end; @@ -68,7 +68,7 @@ begin RePaint; end; -function TfpgCheckBox.GetFontName: string; +function TfpgCheckBox.GetFontDesc: string; begin Result := FFont.FontDesc; end; @@ -81,7 +81,7 @@ begin RePaint; end; -procedure TfpgCheckBox.SetFontName(const AValue: string); +procedure TfpgCheckBox.SetFontDesc(const AValue: string); begin FFont.Free; FFont := fpgGetFont(AValue); diff --git a/src/gui/gui_grid.pas b/src/gui/gui_grid.pas index 9a891681..c57b3c38 100644 --- a/src/gui/gui_grid.pas +++ b/src/gui/gui_grid.pas @@ -20,13 +20,17 @@ uses gui_customgrid; type +{ TfpgGrid = class(TfpgCustomGrid) + public + property Font; + property HeaderFont; published property Columns; property DefaultColWidth; property DefaultRowHeight; - property Font; - property HeaderFont; + property FontDesc; + property HeaderFontDesc; property BackgroundColor; property FocusCol; property FocusRow; @@ -42,7 +46,7 @@ type property OnRowChange; property OnDoubleClick; end; - +} //***************** Move these to CoreLib ******************** TFileEntryType = (etFile, etDir); @@ -109,7 +113,11 @@ type property FixedFont: TfpgFont read FFixedFont; property FileList: TFileList read FFileList; property DefaultRowHeight; + property Font; + property HeaderFont; published + property FontDesc; + property HeaderFontDesc; property RowCount; property ColumnCount; property Columns; @@ -154,13 +162,14 @@ type // property Rows[index: Integer]: TStrings read GetRows write SetRows; end; + TfpgStringGrid = class(TfpgCustomStringGrid) published property Columns; property DefaultColWidth; property DefaultRowHeight; - property Font; - property HeaderFont; + property FontDesc; + property HeaderFontDesc; property BackgroundColor; property FocusCol; property FocusRow; -- cgit v1.2.3-70-g09d2