summaryrefslogtreecommitdiff
path: root/src/gui/fpg_panel.pas
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graeme@mastermaths.co.za>2012-01-18 17:01:08 +0200
committerGraeme Geldenhuys <graeme@mastermaths.co.za>2012-01-18 17:01:08 +0200
commit4a2746140f9accb271640f56f90a9c2e712bc9cf (patch)
treeb6e3841e1d04b2152109d268418f4e1bf3b139c5 /src/gui/fpg_panel.pas
parent9e6a4ff0300b5378997050d3306c538051ca54a9 (diff)
downloadfpGUI-4a2746140f9accb271640f56f90a9c2e712bc9cf.tar.xz
A reworked patch from Jean-Marc
* moved the modifications from TfpgAbstractPanel to TfpgFrame. The new additional behaviour only relates to Frame usage, not Panel or Bevel. * Added a new OnCreate() event for convenience. * Now calling AfterCreate at the correct time - just like what is done in TfpgForm.
Diffstat (limited to 'src/gui/fpg_panel.pas')
-rw-r--r--src/gui/fpg_panel.pas33
1 files changed, 32 insertions, 1 deletions
diff --git a/src/gui/fpg_panel.pas b/src/gui/fpg_panel.pas
index 2d09a6a9..ea86de3a 100644
--- a/src/gui/fpg_panel.pas
+++ b/src/gui/fpg_panel.pas
@@ -232,11 +232,18 @@ type
"forms" inside other forms. You should also be able to design such
frames with the UI designer too. }
TfpgFrame = class(TfpgAbstractPanel)
+ private
+ FOnClose: TNotifyEvent;
+ FOnShow: TNotifyEvent;
+ FOnCreate: TNotifyEvent;
protected
WindowTitle: TfpgString;
+ procedure HandleShow; override;
public
procedure AfterConstruction; override;
procedure AfterCreate; virtual;
+ procedure Close;
+ procedure Show;
published
property AcceptDrops;
property Align;
@@ -262,10 +269,13 @@ type
property OnDragEnter;
property OnDragLeave;
property OnDragStartDetected;
+ property OnClose: TNotifyEvent read FOnClose write FOnClose;
+ property OnCreate: TNotifyEvent read FOnCreate write FOnCreate;
property OnMouseDown;
property OnMouseMove;
property OnMouseUp;
property OnPaint;
+ property OnShow: TNotifyEvent read FOnShow write FOnShow;
property OnShowHint;
end;
@@ -330,10 +340,20 @@ end;
{ TfpgFrame }
+procedure TfpgFrame.HandleShow;
+begin
+ inherited HandleShow;
+ HandleAlignments(0, 0);
+ if Assigned(FOnShow) then
+ FOnShow(self);
+end;
+
procedure TfpgFrame.AfterConstruction;
begin
- inherited AfterConstruction;
AfterCreate;
+ inherited AfterConstruction;
+ if Assigned(FOnCreate) then
+ FOnCreate(self);
end;
procedure TfpgFrame.AfterCreate;
@@ -341,6 +361,17 @@ begin
// do nothing here
end;
+procedure TfpgFrame.Close;
+begin
+ HandleHide;
+ if Assigned(FOnClose) then
+ FOnClose(self);
+end;
+
+procedure TfpgFrame.Show;
+begin
+ HandleShow;
+end;
{TfpgAbstractPanel}