summaryrefslogtreecommitdiff
path: root/examples/gui/filedialog/filedialog.lpr
diff options
context:
space:
mode:
authorgraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2007-10-17 22:06:46 +0000
committergraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2007-10-17 22:06:46 +0000
commit22184fac6d8e34baf30f08b0119fc251c025e42a (patch)
treeeb1edcf1145f109ffca47cbc98e2931f8cacafb2 /examples/gui/filedialog/filedialog.lpr
parentf0bb55b50a3f9caa154706fe7caea348e32f6865 (diff)
downloadfpGUI-22184fac6d8e34baf30f08b0119fc251c025e42a.tar.xz
* Fixed a ComboBox clipping issue where long text would paint over the internal button.
* Base Dialog now has a better min width and height set. * FileDialog example's form is now maintained by the UI Designer.
Diffstat (limited to 'examples/gui/filedialog/filedialog.lpr')
-rw-r--r--examples/gui/filedialog/filedialog.lpr94
1 files changed, 79 insertions, 15 deletions
diff --git a/examples/gui/filedialog/filedialog.lpr b/examples/gui/filedialog/filedialog.lpr
index f1f06a04..d61c7743 100644
--- a/examples/gui/filedialog/filedialog.lpr
+++ b/examples/gui/filedialog/filedialog.lpr
@@ -18,17 +18,21 @@ uses
type
TMainForm = class(TfpgForm)
private
- btnQuit: TfpgButton;
+ {@VFD_HEAD_BEGIN: MainForm}
btnOpenFile: TfpgButton;
btnSaveFile: TfpgButton;
edFilename: TfpgEdit;
+ btnQuit: TfpgButton;
+ {@VFD_HEAD_END: MainForm}
procedure btnQuitClick(Sender: TObject);
procedure btnOpenFileClick(Sender: TObject);
procedure btnSaveFileClick(Sender: TObject);
public
- constructor Create(AOwner: TComponent); override;
+ procedure AfterCreate; override;
end;
+{@VFD_NEWFORM_DECL}
+
{ TMainForm }
procedure TMainForm.btnQuitClick(Sender: TObject);
@@ -64,26 +68,86 @@ begin
end;
end;
-constructor TMainForm.Create(AOwner: TComponent);
+procedure TMainForm.AfterCreate;
begin
- inherited Create(AOwner);
+ inherited AfterCreate;
+ {@VFD_BODY_BEGIN: MainForm}
+ Name := 'MainForm';
+ SetPosition(100, 100, 419, 138);
WindowTitle := 'File dialog test';
- SetPosition(100, 100, 500, 400);
-
- btnOpenFile := CreateButton(self, 10, 10, 110, 'Open File...', @btnOpenFileClick);
- btnSaveFile := CreateButton(self, 10, btnOpenFile.Bottom + 8, 110, 'Save File...', @btnSaveFileClick);
+ MinWidth := 300;
+ MinHeight := 135;
+
+ btnOpenFile := TfpgButton.Create(self);
+ with btnOpenFile do
+ begin
+ Name := 'btnOpenFile';
+ SetPosition(8, 8, 80, 23);
+ Text := 'Open File...';
+ AllowAllUp := False;
+ Embedded := False;
+ FontDesc := '#Label1';
+ GroupIndex := 0;
+ ImageMargin := 3;
+ ImageName := '';
+ ImageSpacing := -1;
+ ModalResult := 0;
+ ShowImage := True;
+ OnClick := @btnOpenFileClick;
+ end;
- edFilename := CreateEdit(self, 10, btnSaveFile.Bottom + 15, Width - 20, 24);
- edFilename.Text := '';
+ btnSaveFile := TfpgButton.Create(self);
+ with btnSaveFile do
+ begin
+ Name := 'btnSaveFile';
+ SetPosition(8, 34, 80, 23);
+ Text := 'Save File...';
+ AllowAllUp := False;
+ Embedded := False;
+ FontDesc := '#Label1';
+ GroupIndex := 0;
+ ImageMargin := 3;
+ ImageName := '';
+ ImageSpacing := -1;
+ ModalResult := 0;
+ ShowImage := True;
+ OnClick := @btnSaveFileClick;
+ end;
- btnQuit := CreateButton(self, 415, 370, 80, 'Quit', @btnQuitClick);
- btnQuit.ImageName := 'stdimg.Quit';
- btnQuit.ShowImage := True;
- btnQuit.Anchors := [anRight, anBottom];
+ edFilename := TfpgEdit.Create(self);
+ with edFilename do
+ begin
+ Name := 'edFilename';
+ SetPosition(8, 70, 400, 24);
+ Anchors := [anLeft,anRight,anTop];
+ Text := '';
+ FontDesc := '#Edit1';
+ end;
- btnOpenFile.TabOrder := 0;
+ btnQuit := TfpgButton.Create(self);
+ with btnQuit do
+ begin
+ Name := 'btnQuit';
+ SetPosition(329, 107, 80, 23);
+ Anchors := [anRight,anBottom];
+ Text := 'Quit';
+ AllowAllUp := False;
+ Embedded := False;
+ FontDesc := '#Label1';
+ GroupIndex := 0;
+ ImageMargin := 3;
+ ImageName := 'stdimg.Quit';
+ ImageSpacing := -1;
+ ModalResult := 0;
+ ShowImage := True;
+ OnClick := @btnQuitClick;
+ end;
+
+ {@VFD_BODY_END: MainForm}
end;
+{@VFD_NEWFORM_IMPL}
+
procedure MainProc;
var
frm: TMainForm;