summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorgraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2008-04-02 10:44:50 +0000
committergraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2008-04-02 10:44:50 +0000
commitc6b4cfc9c3ff49f31db7fd3551b908687b734957 (patch)
tree0406aae50d911990c3939bb460137bf2fe6d63da /src/gui
parent41ba687909bdea436ad677c145c5504215510552 (diff)
downloadfpGUI-c6b4cfc9c3ff49f31db7fd3551b908687b734957.tar.xz
* 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.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/fpgui_package.lpk5
-rw-r--r--src/gui/fpgui_package.pas2
-rw-r--r--src/gui/gui_bevel.pas7
-rw-r--r--src/gui/gui_label.pas12
4 files changed, 20 insertions, 6 deletions
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 @@
<License Value="Modified LGPL
"/>
<Version Minor="6" Release="1"/>
- <Files Count="32">
+ <Files Count="33">
<Item1>
<Filename Value="gui_button.pas"/>
<UnitName Value="gui_button"/>
@@ -157,6 +157,9 @@
<Filename Value="gui_hyperlink.pas"/>
<UnitName Value="gui_hyperlink"/>
</Item32>
+ <Item33>
+ <Filename Value="gui_panel.pas"/>
+ </Item33>
</Files>
<LazDoc Paths="../../docs/xml/gui/"/>
<RequiredPkgs Count="2">
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);