diff options
-rw-r--r-- | src/corelib/fpgfx.pas | 1 | ||||
-rw-r--r-- | src/corelib/gfx_widget.pas | 21 | ||||
-rw-r--r-- | src/gui/fpgui_package.lpk | 5 | ||||
-rw-r--r-- | src/gui/fpgui_package.pas | 2 | ||||
-rw-r--r-- | src/gui/gui_bevel.pas | 7 | ||||
-rw-r--r-- | src/gui/gui_label.pas | 12 |
6 files changed, 30 insertions, 18 deletions
diff --git a/src/corelib/fpgfx.pas b/src/corelib/fpgfx.pas index 65977f62..78a00317 100644 --- a/src/corelib/fpgfx.pas +++ b/src/corelib/fpgfx.pas @@ -24,6 +24,7 @@ type TOrientation = (orVertical, orHorizontal); TAlign = (alNone, alTop, alBottom, alLeft, alRight, alClient); + TLayout = (tlTop, tlCenter, tlBottom); TAnchor = (anLeft, anRight, anTop, anBottom); TAnchors = set of TAnchor; diff --git a/src/corelib/gfx_widget.pas b/src/corelib/gfx_widget.pas index 74a9ff6d..cd096005 100644 --- a/src/corelib/gfx_widget.pas +++ b/src/corelib/gfx_widget.pas @@ -110,7 +110,7 @@ type procedure SetFocus; procedure KillFocus; procedure MoveAndResizeBy(dx, dy, dw, dh: TfpgCoord); - procedure SetPosition(aleft, atop, awidth, aheight: TfpgCoord); + procedure SetPosition(aleft, atop, awidth, aheight: TfpgCoord); virtual; procedure Invalidate; // double check this works as developers expect???? property FormDesigner: TObject read FFormDesigner write FFormDesigner; property Parent: TfpgWidget read GetParent write SetParent; @@ -532,18 +532,15 @@ var begin FOnScreen := True; FVisible := True; -// writeln(Classname, ' TfpgWidget.HandleShow - FVisible = ', FVisible); - if FVisible then - begin - AllocateWindowHandle; - DoSetWindowVisible(True); - for n := 0 to ComponentCount - 1 do - begin - c := Components[n]; - if (c is TfpgWidget) and (TfpgWidget(c).Parent = self) then - TfpgWidget(c).HandleShow; - end; + AllocateWindowHandle; + DoSetWindowVisible(True); + + for n := 0 to ComponentCount - 1 do + begin + c := Components[n]; + if (c is TfpgWidget) and (TfpgWidget(c).Parent = self) then + TfpgWidget(c).HandleShow; end; end; 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); |