summaryrefslogtreecommitdiff
path: root/prototypes/multihandle/test.lpr
diff options
context:
space:
mode:
Diffstat (limited to 'prototypes/multihandle/test.lpr')
-rw-r--r--prototypes/multihandle/test.lpr34
1 files changed, 34 insertions, 0 deletions
diff --git a/prototypes/multihandle/test.lpr b/prototypes/multihandle/test.lpr
index 9239179f..4da7f9e7 100644
--- a/prototypes/multihandle/test.lpr
+++ b/prototypes/multihandle/test.lpr
@@ -25,14 +25,30 @@ type
TMainWindow = class(TForm)
procedure btnCancelClick(Sender: TObject);
procedure btnCloseClick(Sender: TObject);
+ procedure btnPopupClick(Sender: TObject);
private
btnClose: TButton;
btnCancel: TButton;
+ btnPopup: TButton;
lblWelcome: TLabel;
public
constructor Create; override;
destructor Destroy; override;
end;
+
+
+ TMyPopup = class(TPopupWindow)
+ public
+ constructor Create; override;
+ end;
+
+{ TMyPopup }
+
+constructor TMyPopup.Create;
+begin
+ inherited Create;
+ SetClientSize(Size(150, 320));
+end;
{ TMainWindow }
@@ -47,6 +63,18 @@ begin
GFApplication.Quit;
end;
+procedure TMainWindow.btnPopupClick(Sender: TObject);
+var
+ frm: TMyPopup;
+begin
+ frm := TMyPopup.Create;
+ frm.FParent := self;
+
+ GFApplication.AddWindow(frm);
+ frm.Show;
+ frm.SetPosition(Point(0, btnPopup.Height));
+end;
+
constructor TMainWindow.Create;
begin
inherited Create;
@@ -61,6 +89,10 @@ begin
btnCancel.Caption := 'Cancel';
btnCancel.OnClick := @btnCancelClick;
+ btnPopup := TButton.Create(self, Point(80, 80));
+ btnPopup.Caption := 'Popup';
+ btnPopup.OnClick := @btnPopupClick;
+
lblWelcome := TLabel.Create(self, Point(10, 10));
lblWelcome.Caption := 'So what do you think?';
end;
@@ -69,6 +101,8 @@ destructor TMainWindow.Destroy;
begin
btnClose.Free;
btnCancel.Free;
+ btnPopup.Free;
+ lblWelcome.Free;
inherited Destroy;
end;