From c6b4cfc9c3ff49f31db7fd3551b908687b734957 Mon Sep 17 00:00:00 2001 From: graemeg Date: Wed, 2 Apr 2008 10:44:50 +0000 Subject: * Applied patch (#1930945) from Jean-Marc which introduces a new component in gui_panel. * Added the gui_panel demo to the examples directory. * Applied a minor painting fix to the Panel groupbox style. * Extended the gui_panel demo to show the Raised and Lowered look. --- src/gui/fpgui_package.lpk | 5 ++++- src/gui/fpgui_package.pas | 2 +- src/gui/gui_bevel.pas | 7 ++++--- src/gui/gui_label.pas | 12 +++++++++++- 4 files changed, 20 insertions(+), 6 deletions(-) (limited to 'src/gui') diff --git a/src/gui/fpgui_package.lpk b/src/gui/fpgui_package.lpk index edb05757..62d2a480 100644 --- a/src/gui/fpgui_package.lpk +++ b/src/gui/fpgui_package.lpk @@ -28,7 +28,7 @@ - + @@ -157,6 +157,9 @@ + + + diff --git a/src/gui/fpgui_package.pas b/src/gui/fpgui_package.pas index df82daf5..8ce6da09 100644 --- a/src/gui/fpgui_package.pas +++ b/src/gui/fpgui_package.pas @@ -12,7 +12,7 @@ uses gui_radiobutton, gui_trackbar, gui_tab, gui_basegrid, gui_listview, gui_customgrid, gui_progressbar, gui_menu, gui_style, gui_grid, gui_tree, gui_iniutils, gui_mru, fpgui_db, gui_popupcalendar, gui_gauge, - gui_editcombo, gui_hyperlink; + gui_editcombo, gui_hyperlink, gui_panel; implementation diff --git a/src/gui/gui_bevel.pas b/src/gui/gui_bevel.pas index 68aa05f2..1fe860a4 100644 --- a/src/gui/gui_bevel.pas +++ b/src/gui/gui_bevel.pas @@ -54,14 +54,14 @@ type property OnDoubleClick; end; - +{ function CreateBevel(AOwner: TComponent; ALeft, ATop, AWidth, AHeight: TfpgCoord; AShape: TBevelShape; AStyle: TBevelStyle): TfpgBevel; - +} implementation - +{ function CreateBevel(AOwner: TComponent; ALeft, ATop, AWidth, AHeight: TfpgCoord; AShape: TBevelShape; AStyle: TBevelStyle): TfpgBevel; begin @@ -73,6 +73,7 @@ begin Result.Shape := AShape; Result.Style := AStyle; end; +} { TfpgBevel } diff --git a/src/gui/gui_label.pas b/src/gui/gui_label.pas index 665c485b..8fca8504 100644 --- a/src/gui/gui_label.pas +++ b/src/gui/gui_label.pas @@ -30,7 +30,7 @@ uses gfx_widget; type - TLayout = (tlTop, tlCenter, tlBottom); + TfpgCustomLabel = class(TfpgWidget) private @@ -49,6 +49,7 @@ type procedure SetFontDesc(const AValue: string); procedure SetText(const AValue: string); procedure ResizeLabel; + function GetTextHeight: integer; protected FText: string; FFont: TfpgFont; @@ -65,6 +66,7 @@ type constructor Create(AOwner: TComponent); override; destructor Destroy; override; property Font: TfpgFont read FFont; + property TextHeight: integer read GetTextHeight; end; @@ -272,6 +274,14 @@ begin RePaint; end; +function TfpgCustomLabel.GetTextHeight: integer; +begin + if FWrapText then + Result := (Font.Height * FWrappedText.Count) + (FLineSpace * Pred(FWrappedText.Count)) + else + Result := Font.Height; +end; + procedure TfpgCustomLabel.HandleResize(awidth, aheight: TfpgCoord); begin inherited HandleResize(awidth, aheight); -- cgit v1.2.3-70-g09d2