summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/apps/docedit/docedit.lpi6
-rw-r--r--examples/apps/docedit/docedit.lpr10
-rw-r--r--examples/apps/docedit/frm_options.pas2
-rw-r--r--examples/apps/uidesigner/aanewform.pas227
-rw-r--r--examples/apps/uidesigner/anchors.inc208
-rw-r--r--examples/apps/uidesigner/images/shape_align_bottom.bmpbin0 -> 822 bytes
-rw-r--r--examples/apps/uidesigner/images/shape_align_left.bmpbin0 -> 822 bytes
-rw-r--r--examples/apps/uidesigner/images/shape_align_right.bmpbin0 -> 822 bytes
-rw-r--r--examples/apps/uidesigner/images/shape_align_top.bmpbin0 -> 822 bytes
-rw-r--r--examples/apps/uidesigner/newformdesigner.pas262
-rw-r--r--examples/apps/uidesigner/uidesigner.lpr44
-rw-r--r--examples/apps/uidesigner/vfdforms.pas163
-rw-r--r--examples/apps/uidesigner/vfdmain.pas17
-rw-r--r--examples/corelib/canvastest/fpgcanvas.lpr1
-rw-r--r--examples/corelib/eventtest/eventtest.lpr1
-rw-r--r--examples/gui/alignment/aligntest.dpr1
-rw-r--r--examples/gui/bevel/beveltest.lpr1
-rw-r--r--examples/gui/filedialog/filedialog.lpr1
-rw-r--r--examples/gui/filegrid/filegrid.lpr1
-rw-r--r--examples/gui/fontselect/fontselect.lpr1
-rw-r--r--examples/gui/gridtest/gridtest.lpr1
-rw-r--r--examples/gui/imgtest/bitmaptest.dpr1
-rw-r--r--examples/gui/listviewtest/listviewtest.lpi4
-rw-r--r--examples/gui/listviewtest/listviewtest.lpr11
-rw-r--r--examples/gui/menutest/menutest.lpr1
-rw-r--r--examples/gui/modalforms/modalforms.lpi7
-rw-r--r--examples/gui/modalforms/modalforms.lpr1
-rw-r--r--examples/gui/stdimages/stdimglist.lpr1
-rw-r--r--examples/gui/tabtest/tabtest.lpr1
-rw-r--r--examples/gui/timertest/timertest.lpr1
-rw-r--r--examples/gui/treeviewtest/treeviewtest.lpr1
31 files changed, 599 insertions, 377 deletions
diff --git a/examples/apps/docedit/docedit.lpi b/examples/apps/docedit/docedit.lpi
index 7d1ca058..06e2c8b3 100644
--- a/examples/apps/docedit/docedit.lpi
+++ b/examples/apps/docedit/docedit.lpi
@@ -28,11 +28,11 @@
</RunParams>
<RequiredPackages Count="2">
<Item1>
- <PackageName Value="fpgui_package"/>
- <MinVersion Minor="5" Valid="True"/>
+ <PackageName Value="FCL"/>
</Item1>
<Item2>
- <PackageName Value="FCL"/>
+ <PackageName Value="fpgui_package"/>
+ <MinVersion Minor="5" Valid="True"/>
</Item2>
</RequiredPackages>
<Units Count="3">
diff --git a/examples/apps/docedit/docedit.lpr b/examples/apps/docedit/docedit.lpr
index 4eeff873..6cc96293 100644
--- a/examples/apps/docedit/docedit.lpr
+++ b/examples/apps/docedit/docedit.lpr
@@ -16,9 +16,13 @@ var
frm: TMainForm;
begin
fpgApplication.Initialize;
- frm := TMainForm.Create(nil);
- frm.Show;
- fpgApplication.Run;
+ try
+ frm := TMainForm.Create(nil);
+ frm.Show;
+ fpgApplication.Run;
+ finally
+ frm.Free;
+ end;
end;
begin
diff --git a/examples/apps/docedit/frm_options.pas b/examples/apps/docedit/frm_options.pas
index ea955271..0b552317 100644
--- a/examples/apps/docedit/frm_options.pas
+++ b/examples/apps/docedit/frm_options.pas
@@ -52,7 +52,7 @@ implementation
procedure TfrmOptions.AfterCreate;
begin
{@VFD_BODY_BEGIN: frmOptions}
- SetPosition(428, 237, 397, 357);
+ SetPosition(394, 264, 397, 357);
WindowTitle := 'Options';
WindowPosition := wpScreenCenter;
diff --git a/examples/apps/uidesigner/aanewform.pas b/examples/apps/uidesigner/aanewform.pas
deleted file mode 100644
index 34ecfb25..00000000
--- a/examples/apps/uidesigner/aanewform.pas
+++ /dev/null
@@ -1,227 +0,0 @@
-unit aanewform;
-
-{$ifdef FPC}
-{$mode objfpc}{$H+}
-{$endif}
-
-interface
-
-uses
- SysUtils, Classes, gfxbase, wgedit, unitkeys, schar16, gfxstyle,
- gfxwidget, gfxform, wglabel, wgbutton,
- wglistbox, wgmemo, wgchoicelist, wggrid, sqldb, sqluis,
- wgdbgrid, gfxdialogs, wgcheckbox;
-
-type
-
- TfrmValami = class(TfpgForm)
- public
- {@VFD_HEAD_BEGIN: frmValami}
- ed1 : TfpgEdit;
- btn1 : TfpgButton;
- chl1 : TfpgComboBox;
- wg1 : Tfpg;
- lst1 : TfpgListBox;
- memo1 : TfpgMemo;
- grid1 : TfpgStringGrid;
- panel1 : TfpgBevel;
- lb1 : TfpgLabel;
- ed2 : TfpgEdit;
- panel2 : TfpgBevel;
- lb2 : TfpgLabel;
- {@VFD_HEAD_END: frmValami}
-
- procedure AfterCreate; override;
- end;
-
- TfrmVFDSetup = class(TGfxForm)
- public
- {@VFD_HEAD_BEGIN: frmVFDSetup}
- panel1 : TfpgBevel;
- lb1 : TfpgLabel;
- chl1 : TfpgComboBox;
- btnOK : TfpgButton;
- btnCancel : TfpgButton;
- {@VFD_HEAD_END: frmVFDSetup}
-
- procedure AfterCreate; override;
- end;
-
-{@VFD_NEWFORM_DECL}
-
-implementation
-
-{@VFD_NEWFORM_IMPL}
-
-procedure TfrmVFDSetup.AfterCreate;
-begin
- {@VFD_BODY_BEGIN: frmVFDSetup}
- SetPosition(331,481,237,103);
- WindowTitle := 'General settings';
-
- panel1 := TfpgBevel.Create(self);
- with panel1 do
- begin
- SetPosition(8,12,220,52);
- shape := bsBox;
- style := bsRaised;
- end;
-
- lb1 := TfpgLabel.Create(panel1);
- with lb1 do
- begin
- SetPosition(8,16,92,16);
- Text := 'Grid resolution:';
- FontName := '#Label1';
- end;
-
- chl1 := TfpgComboBox.Create(panel1);
- with chl1 do
- begin
- SetPosition(116,14,56,22);
- Items.Add('1');
- Items.Add('4');
- Items.Add('5');
- FontName := '#List';
- FocusItem := 2;
- end;
-
- btnOK := TfpgButton.Create(self);
- with btnOK do
- begin
- SetPosition(8,72,96,24);
- Text := 'OK';
- FontName := '#Label1';
- ImageName := 'stdimg.ok';
- ModalResult := 1;
- end;
-
- btnCancel := TfpgButton.Create(self);
- with btnCancel do
- begin
- SetPosition(132,72,96,24);
- Text := 'Cancel';
- FontName := '#Label1';
- ImageName := 'stdimg.cancel';
- ModalResult := -1;
- end;
-
- {@VFD_BODY_END: frmVFDSetup}
-end;
-
-
-procedure TfrmValami.AfterCreate;
-begin
- {@VFD_BODY_BEGIN: frmValami}
- SetPosition(310,122,491,340);
- WindowTitle := 'frmValami';
-
- ed1 := TfpgEdit.Create(self);
- with ed1 do
- begin
- SetPosition(12,48,120,22);
- Text := '';
- FontName := '#Edit1';
- end;
-
- btn1 := TfpgButton.Create(self);
- with btn1 do
- begin
- SetPosition(12,76,96,24);
- Text := 'Button';
- FontName := '#Label1';
- ImageName := 'stdimg.ok';
- ModalResult := 0;
- end;
-
- chl1 := TfpgComboBox.Create(self);
- with chl1 do
- begin
- SetPosition(148,40,120,22);
- Items.Add('egy');
- Items.Add('ketto');
- Items.Add('harom');
- FontName := '#List';
- end;
-
- wg1 := Tfpg.Create(self);
- with wg1 do
- begin
- SetPosition(148,84,120,32);
- end;
-
- lst1 := TfpgListBox.Create(self);
- with lst1 do
- begin
- SetPosition(12,116,104,92);
- Items.Add('as'));
- Items.Add('asdf');
- Items.Add('asd');
- Items.Add('f as');
- FontName := '#List';
- end;
-
- memo1 := TfpgMemo.Create(self);
- with memo1 do
- begin
- SetPosition(136,124,120,72);
- Lines.Add('valami szoveg');
- Lines.Add('masodik sor');
- FontName := '#Edit1';
- end;
-
- grid1 := TfpgStringGrid.Create(self);
- with grid1 do
- begin
- SetPosition(16,216,180,104);
- AddColumn('ID','',50,alLeft);
- AddColumn('NAME','',70,alLeft);
- FontName := '#Grid';
- HeaderFontName := '#GridHeader';
- end;
-
- panel1 := TfpgBevel.Create(self);
- with panel1 do
- begin
- SetPosition(276,156,192,148);
- shape := bsBox;
- style := bsRaised;
- end;
-
- lb1 := TfpgLabel.Create(panel1);
- with lb1 do
- begin
- SetPosition(16,8,80,16);
- Text := 'Label';
- FontName := '#Label1';
- end;
-
- ed2 := TfpgEdit.Create(panel1);
- with ed2 do
- begin
- SetPosition(8,32,120,22);
- Text := '';
- FontName := '#Edit1';
- end;
-
- panel2 := TfpgBevel.Create(panel1);
- with panel2 do
- begin
- SetPosition(40,64,124,56);
- shape := bsFrame;
- style := bsLowered;
- end;
-
- lb2 := TfpgLabel.Create(panel2);
- with lb2 do
- begin
- SetPosition(32,24,80,16);
- Text := 'Label';
- FontName := '#Label1';
- end;
-
- {@VFD_BODY_END: frmValami}
-end;
-
-
-end.
diff --git a/examples/apps/uidesigner/anchors.inc b/examples/apps/uidesigner/anchors.inc
new file mode 100644
index 00000000..0c9b3738
--- /dev/null
+++ b/examples/apps/uidesigner/anchors.inc
@@ -0,0 +1,208 @@
+
+Const
+ vfd_anchorright : Array[0..821] of byte = (
+ 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0,
+ 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0,
+ 0, 3, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,
+ 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255,
+ 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,
+ 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,
+ 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255,
+ 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,
+ 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,
+ 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255,
+ 0,255,255, 0,255, 14, 14, 14,255, 0,255,255, 0,255,227,170,131,
+ 225,165,125,222,159,119,220,155,114,218,150,108,216,144,103,214,140,
+ 98,213,134, 93,212,133, 90,210,131, 88,210,131, 88,210,131, 88,255,
+ 0,255, 22, 22, 22,255, 0,255,255, 0,255,229,176,137,234,192,162,
+ 233,189,158,232,185,154,230,181,150,228,177,146,227,173,141,225,169,
+ 137,223,165,134,222,163,131,221,160,128,210,131, 88,255, 0,255, 31,
+ 31, 31,255, 0,255,255, 0,255,230,179,140,236,196,166,235,194,163,
+ 234,191,160,232,188,157,231,184,153,229,180,148,228,175,145,226,172,
+ 140,225,168,136,223,165,133,212,133, 90,255, 0,255, 43, 43, 43,255,
+ 0,255,255, 0,255,230,179,140,236,197,167,236,197,167,235,196,165,
+ 235,193,163,234,190,160,232,186,156,230,182,151,228,179,147,227,175,
+ 143,225,170,139,214,140, 98,255, 0,255, 54, 54, 54,255, 0,255,255,
+ 0,255,230,179,140,230,179,140,230,179,140,230,179,140,230,179,140,
+ 229,176,137,227,172,133,226,169,128,225,163,123,222,158,117,220,153,
+ 112,218,148,106,255, 0,255, 67, 67, 67,255, 0,255,255, 0,255,255,
+ 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,
+ 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,
+ 255,255, 0,255, 80, 80, 80,255, 0,255,255, 0,255,255, 0,255,255,
+ 0,255,255, 0,255,245,197,167,245,195,163,245,192,159,245,190,155,
+ 243,187,153,243,184,149,243,183,146,243,182,144,243,182,142,255, 0,
+ 255, 92, 92, 92,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255,
+ 0,255,245,200,171,247,211,188,247,210,186,247,207,182,247,205,180,
+ 246,203,177,246,202,174,246,200,172,243,182,144,255, 0,255,104,104,
+ 104,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,245,
+ 203,174,247,213,192,247,211,189,247,210,186,247,208,184,247,206,180,
+ 246,204,178,246,203,175,243,184,148,255, 0,255,116,116,116,255, 0,
+ 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,245,203,175,247,
+ 215,194,247,213,192,247,212,190,247,210,187,247,209,184,247,207,181,
+ 246,205,179,243,187,150,255, 0,255,127,127,127,255, 0,255,255, 0,
+ 255,255, 0,255,255, 0,255,255, 0,255,245,203,175,245,203,175,245,
+ 203,175,245,201,172,245,200,170,245,197,167,245,195,163,245,192,159,
+ 245,190,155,255, 0,255,137,137,137,255, 0,255,255, 0,255,255, 0,
+ 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255,
+ 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,
+ 255, 0,255,145,145,145,255, 0,255,255, 0,255,255, 0,255,255, 0,
+ 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255,
+ 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,
+ 255, 0,255,255, 0,255);
+
+Const
+ vfd_anchorbottom : Array[0..821] of byte = (
+ 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0,
+ 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0,
+ 0, 3, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,
+ 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255,
+ 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,
+ 255, 0,255,165,165,165,158,158,158,149,149,149,141,141,141,131,131,
+ 131,121,121,121,111,111,111,101,101,101, 91, 91, 91, 82, 82, 82, 73,
+ 73, 73, 65, 65, 65, 58, 58, 58,255, 0,255,255, 0,255,255, 0,255,
+ 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,
+ 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255,
+ 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,
+ 243,187,150,243,184,149,243,184,146,243,183,145,243,182,144,255, 0,
+ 255,213,134, 94,212,133, 90,210,131, 88,210,131, 88,210,131, 88,255,
+ 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,243,188,154,
+ 246,203,176,246,202,175,246,201,173,243,183,146,255, 0,255,214,140,
+ 98,223,165,133,222,162,131,222,161,129,210,131, 88,255, 0,255,255,
+ 0,255,255, 0,255,255, 0,255,255, 0,255,245,191,157,247,205,179,
+ 246,204,177,246,203,175,243,184,149,255, 0,255,217,145,103,225,168,
+ 136,223,165,133,223,163,131,212,133, 90,255, 0,255,255, 0,255,255,
+ 0,255,255, 0,255,255, 0,255,245,193,161,247,207,182,247,205,180,
+ 246,204,178,243,187,153,255, 0,255,218,150,110,226,172,141,225,169,
+ 138,224,167,134,213,136, 94,255, 0,255,255, 0,255,255, 0,255,255,
+ 0,255,255, 0,255,245,196,165,247,209,184,247,207,182,247,206,180,
+ 245,190,155,255, 0,255,221,157,115,228,177,145,227,173,142,225,170,
+ 139,216,141, 99,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255,
+ 0,255,245,197,167,247,210,187,247,209,186,247,208,184,245,192,159,
+ 255, 0,255,224,162,121,230,181,150,228,178,146,227,175,143,217,146,
+ 104,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,245,
+ 200,171,247,212,189,247,211,188,247,210,186,245,195,162,255, 0,255,
+ 225,167,127,232,185,154,230,182,151,229,179,148,220,150,111,255, 0,
+ 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,245,201,172,247,
+ 213,192,247,213,190,247,211,189,245,197,166,255, 0,255,227,172,132,
+ 233,189,158,232,186,156,230,184,152,221,157,116,255, 0,255,255, 0,
+ 255,255, 0,255,255, 0,255,255, 0,255,245,203,175,245,203,174,245,
+ 200,172,245,200,171,245,199,170,255, 0,255,229,176,136,235,192,162,
+ 234,190,160,232,187,157,225,162,123,255, 0,255,255, 0,255,255, 0,
+ 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255,
+ 0,255,255, 0,255,255, 0,255,230,179,140,235,196,165,235,194,163,
+ 234,191,161,226,169,128,255, 0,255,255, 0,255,255, 0,255,255, 0,
+ 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255,
+ 0,255,255, 0,255,230,179,140,236,197,167,235,196,165,235,194,163,
+ 227,172,133,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,
+ 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255,
+ 0,255,230,179,140,230,179,140,230,179,140,230,178,140,229,176,137,
+ 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,
+ 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255,
+ 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,
+ 255, 0,255,255, 0,255);
+
+Const
+ vfd_anchorleft : Array[0..821] of byte = (
+ 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0,
+ 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0,
+ 0, 3, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,
+ 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255,
+ 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,
+ 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,
+ 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255,
+ 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,
+ 14, 14, 14,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,
+ 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255,
+ 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 22, 22, 22,
+ 255, 0,255,227,170,131,225,165,125,222,159,119,220,155,114,218,150,
+ 108,216,144,103,214,140, 98,213,134, 93,212,133, 90,210,131, 88,210,
+ 131, 88,210,131, 88,255, 0,255,255, 0,255, 31, 31, 31,255, 0,255,
+ 229,176,137,234,192,162,233,189,158,232,185,154,230,181,150,228,177,
+ 146,227,173,141,225,169,137,223,165,134,222,163,131,221,160,128,210,
+ 131, 88,255, 0,255,255, 0,255, 43, 43, 43,255, 0,255,230,179,140,
+ 236,196,166,235,194,163,234,191,160,232,188,157,231,184,153,229,180,
+ 148,228,175,145,226,172,140,225,168,136,223,165,133,212,133, 90,255,
+ 0,255,255, 0,255, 54, 54, 54,255, 0,255,230,179,140,236,197,167,
+ 236,197,167,235,196,165,235,193,163,234,190,160,232,186,156,230,182,
+ 151,228,179,147,227,175,143,225,170,139,214,140, 98,255, 0,255,255,
+ 0,255, 67, 67, 67,255, 0,255,230,179,140,230,179,140,230,179,140,
+ 230,179,140,230,179,140,229,176,137,227,172,133,226,169,128,225,163,
+ 123,222,158,117,220,153,112,218,148,106,255, 0,255,255, 0,255, 80,
+ 80, 80,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,
+ 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,
+ 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 92, 92, 92,255,
+ 0,255,245,197,167,245,195,163,245,192,159,245,190,155,243,187,153,
+ 243,184,149,243,183,146,243,182,144,243,182,142,255, 0,255,255, 0,
+ 255,255, 0,255,255, 0,255,255, 0,255,104,104,104,255, 0,255,245,
+ 200,171,247,211,188,247,210,186,247,207,182,247,205,180,246,203,177,
+ 246,202,174,246,200,172,243,182,144,255, 0,255,255, 0,255,255, 0,
+ 255,255, 0,255,255, 0,255,116,116,116,255, 0,255,245,203,174,247,
+ 213,192,247,211,189,247,210,186,247,208,184,247,206,180,246,204,178,
+ 246,203,175,243,184,148,255, 0,255,255, 0,255,255, 0,255,255, 0,
+ 255,255, 0,255,127,127,127,255, 0,255,245,203,175,247,215,194,247,
+ 213,192,247,212,190,247,210,187,247,209,184,247,207,181,246,205,179,
+ 243,187,150,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,
+ 255,137,137,137,255, 0,255,245,203,175,245,203,175,245,203,175,245,
+ 201,172,245,200,170,245,197,167,245,195,163,245,192,159,245,190,155,
+ 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,145,145,
+ 145,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255,
+ 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,
+ 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,
+ 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255,
+ 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,
+ 255, 0,255,255, 0,255);
+
+Const
+ vfd_anchortop : Array[0..821] of byte = (
+ 66, 77, 54, 3, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0,
+ 0, 16, 0, 0, 0, 16, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0,
+ 0, 3, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,
+ 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255,
+ 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,
+ 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,
+ 255,255, 0,255,255, 0,255,213,134, 94,212,133, 90,210,131, 88,210,
+ 131, 88,210,131, 88,255, 0,255,255, 0,255,255, 0,255,255, 0,255,
+ 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,
+ 255,255, 0,255,214,140, 98,223,165,133,222,162,131,222,161,129,210,
+ 131, 88,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,
+ 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,
+ 255,217,145,103,225,168,136,223,165,133,223,163,131,212,133, 90,255,
+ 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,243,187,150,
+ 243,184,149,243,184,146,243,183,145,243,182,144,255, 0,255,218,150,
+ 110,226,172,141,225,169,138,224,167,134,213,136, 94,255, 0,255,255,
+ 0,255,255, 0,255,255, 0,255,255, 0,255,243,188,154,246,203,176,
+ 246,202,175,246,201,173,243,183,146,255, 0,255,221,157,115,228,177,
+ 145,227,173,142,225,170,139,216,141, 99,255, 0,255,255, 0,255,255,
+ 0,255,255, 0,255,255, 0,255,245,191,157,247,205,179,246,204,177,
+ 246,203,175,243,184,149,255, 0,255,224,162,121,230,181,150,228,178,
+ 146,227,175,143,217,146,104,255, 0,255,255, 0,255,255, 0,255,255,
+ 0,255,255, 0,255,245,193,161,247,207,182,247,205,180,246,204,178,
+ 243,187,153,255, 0,255,225,167,127,232,185,154,230,182,151,229,179,
+ 148,220,150,111,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255,
+ 0,255,245,196,165,247,209,184,247,207,182,247,206,180,245,190,155,
+ 255, 0,255,227,172,132,233,189,158,232,186,156,230,184,152,221,157,
+ 116,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,245,
+ 197,167,247,210,187,247,209,186,247,208,184,245,192,159,255, 0,255,
+ 229,176,136,235,192,162,234,190,160,232,187,157,225,162,123,255, 0,
+ 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,245,200,171,247,
+ 212,189,247,211,188,247,210,186,245,195,162,255, 0,255,230,179,140,
+ 235,196,165,235,194,163,234,191,161,226,169,128,255, 0,255,255, 0,
+ 255,255, 0,255,255, 0,255,255, 0,255,245,201,172,247,213,192,247,
+ 213,190,247,211,189,245,197,166,255, 0,255,230,179,140,236,197,167,
+ 235,196,165,235,194,163,227,172,133,255, 0,255,255, 0,255,255, 0,
+ 255,255, 0,255,255, 0,255,245,203,175,245,203,174,245,200,172,245,
+ 200,171,245,199,170,255, 0,255,230,179,140,230,179,140,230,179,140,
+ 230,178,140,229,176,137,255, 0,255,255, 0,255,255, 0,255,255, 0,
+ 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255,
+ 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,
+ 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,165,165,
+ 165,158,158,158,149,149,149,141,141,141,131,131,131,121,121,121,111,
+ 111,111,101,101,101, 91, 91, 91, 82, 82, 82, 73, 73, 73, 65, 65, 65,
+ 58, 58, 58,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,
+ 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255,
+ 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,
+ 255, 0,255,255, 0,255);
diff --git a/examples/apps/uidesigner/images/shape_align_bottom.bmp b/examples/apps/uidesigner/images/shape_align_bottom.bmp
new file mode 100644
index 00000000..d9495933
--- /dev/null
+++ b/examples/apps/uidesigner/images/shape_align_bottom.bmp
Binary files differ
diff --git a/examples/apps/uidesigner/images/shape_align_left.bmp b/examples/apps/uidesigner/images/shape_align_left.bmp
new file mode 100644
index 00000000..c9c3ab38
--- /dev/null
+++ b/examples/apps/uidesigner/images/shape_align_left.bmp
Binary files differ
diff --git a/examples/apps/uidesigner/images/shape_align_right.bmp b/examples/apps/uidesigner/images/shape_align_right.bmp
new file mode 100644
index 00000000..d26d4ad2
--- /dev/null
+++ b/examples/apps/uidesigner/images/shape_align_right.bmp
Binary files differ
diff --git a/examples/apps/uidesigner/images/shape_align_top.bmp b/examples/apps/uidesigner/images/shape_align_top.bmp
new file mode 100644
index 00000000..9d26f3d8
--- /dev/null
+++ b/examples/apps/uidesigner/images/shape_align_top.bmp
Binary files differ
diff --git a/examples/apps/uidesigner/newformdesigner.pas b/examples/apps/uidesigner/newformdesigner.pas
index 60f1603a..42a437a6 100644
--- a/examples/apps/uidesigner/newformdesigner.pas
+++ b/examples/apps/uidesigner/newformdesigner.pas
@@ -52,6 +52,11 @@ type
TfrmMain = class(TfpgForm)
+ private
+ FFileOpenRecent: TfpgMenuItem;
+ procedure OpenRecentFileClick(Sender: TObject);
+ procedure miHelpAboutClick(Sender: TObject);
+ procedure miHelpAboutGUI(Sender: TObject);
public
{@VFD_HEAD_BEGIN: frmMain}
MainMenu: TfpgMenuBar;
@@ -63,10 +68,16 @@ type
filemenu: TfpgPopupMenu;
formmenu: TfpgPopupMenu;
setmenu: TfpgPopupMenu;
+ miOpenRecentMenu: TfpgPopupMenu;
+ helpmenu: TfpgPopupMenu;
+ previewmenu: TfpgPopupMenu;
{@VFD_HEAD_END: frmMain}
-
+
+ constructor Create(AOwner: TComponent); override;
+ destructor Destroy; override;
function GetSelectedWidget: TVFDWidgetClass;
procedure SetSelectedWidget(wgc: TVFDWidgetClass);
+ procedure AddRecentFile(AFilename: string);
procedure AfterCreate; override;
procedure OnPaletteClick(Sender: TObject);
property SelectedWidget: TVFDWidgetClass read GetSelectedWidget write SetSelectedWidget;
@@ -125,7 +136,24 @@ type
btnTop, btnLeft, btnWidth, btnHeight: TfpgButton;
btnAnLeft, btnAnTop, btnAnRight, btnAnBottom: TfpgButton;
lstProps: TwgPropertyList;
+ constructor Create(AOwner: TComponent); override;
+ destructor Destroy; override;
+ procedure AfterCreate; override;
+ end;
+
+
+ TfrmAbout = class(TfpgForm)
+ public
+ {@VFD_HEAD_BEGIN: frmAbout}
+ lblName1: TfpgLabel;
+ lblVersion: TfpgLabel;
+ btnName1: TfpgButton;
+ lblName3: TfpgLabel;
+ lblName4: TfpgLabel;
+ lblCompiled: TfpgLabel;
+ {@VFD_HEAD_END: frmAbout}
procedure AfterCreate; override;
+ class procedure Execute;
end;
{@VFD_NEWFORM_DECL}
@@ -140,51 +168,94 @@ implementation
uses
fpgfx,
- vfdmain;
-
-const
- vfd_anchorbottom: array[0..121] of byte = (
- 66, 77, 122, 0, 0, 0, 0, 0, 0, 0, 62, 0, 0, 0, 40, 0, 0,
- 0, 15, 0, 0, 0, 15, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,
- 60, 0, 0, 0, 235, 10, 0, 0, 235, 10, 0, 0, 2, 0, 0, 0, 2,
- 0, 0, 0, 255, 255, 255, 0, 0, 0, 0, 0, 255, 254, 0, 0, 128, 2,
- 0, 0, 254, 254, 0, 0, 252, 126, 0, 0, 248, 62, 0, 0, 240, 30, 0,
- 0, 255, 254, 0, 0, 255, 254, 0, 0, 255, 254, 0, 0, 255, 254, 0, 0,
- 255, 254, 0, 0, 255, 254, 0, 0, 255, 254, 0, 0, 255, 254, 0, 0, 255,
- 254, 0, 0);
-
- vfd_anchorleft: array[0..121] of byte = (
- 66, 77, 122, 0, 0, 0, 0, 0, 0, 0, 62, 0, 0, 0, 40, 0, 0,
- 0, 15, 0, 0, 0, 15, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,
- 60, 0, 0, 0, 235, 10, 0, 0, 235, 10, 0, 0, 2, 0, 0, 0, 2,
- 0, 0, 0, 255, 255, 255, 0, 0, 0, 0, 0, 255, 254, 0, 0, 191, 254,
- 0, 0, 191, 254, 0, 0, 191, 254, 0, 0, 187, 254, 0, 0, 179, 254, 0,
- 0, 163, 254, 0, 0, 131, 254, 0, 0, 163, 254, 0, 0, 179, 254, 0, 0,
- 187, 254, 0, 0, 191, 254, 0, 0, 191, 254, 0, 0, 191, 254, 0, 0, 255,
- 254, 0, 0);
-
- vfd_anchorright: array[0..121] of byte = (
- 66, 77, 122, 0, 0, 0, 0, 0, 0, 0, 62, 0, 0, 0, 40, 0, 0,
- 0, 15, 0, 0, 0, 15, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,
- 60, 0, 0, 0, 235, 10, 0, 0, 235, 10, 0, 0, 2, 0, 0, 0, 2,
- 0, 0, 0, 255, 255, 255, 0, 0, 0, 0, 0, 255, 254, 0, 0, 255, 250,
- 0, 0, 255, 250, 0, 0, 255, 250, 0, 0, 255, 186, 0, 0, 255, 154, 0,
- 0, 255, 138, 0, 0, 255, 130, 0, 0, 255, 138, 0, 0, 255, 154, 0, 0,
- 255, 186, 0, 0, 255, 250, 0, 0, 255, 250, 0, 0, 255, 250, 0, 0, 255,
- 254, 0, 0);
-
- vfd_anchortop: array[0..121] of byte = (
- 66, 77, 122, 0, 0, 0, 0, 0, 0, 0, 62, 0, 0, 0, 40, 0, 0,
- 0, 15, 0, 0, 0, 15, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,
- 60, 0, 0, 0, 235, 10, 0, 0, 235, 10, 0, 0, 2, 0, 0, 0, 2,
- 0, 0, 0, 255, 255, 255, 0, 0, 0, 0, 0, 255, 254, 0, 0, 255, 254,
- 0, 0, 255, 254, 0, 0, 255, 254, 0, 0, 255, 254, 0, 0, 255, 254, 0,
- 0, 255, 254, 0, 0, 255, 254, 0, 0, 255, 254, 0, 0, 240, 30, 0, 0,
- 248, 62, 0, 0, 252, 126, 0, 0, 254, 254, 0, 0, 128, 2, 0, 0, 255,
- 254, 0, 0);
+ vfdmain,
+ gui_iniutils,
+ gui_dialogs;
+
+
+// Anchor images
+{$I anchors.inc}
+
{@VFD_NEWFORM_IMPL}
+procedure TfrmAbout.AfterCreate;
+begin
+ {@VFD_BODY_BEGIN: frmAbout}
+ SetPosition(378, 267, 276, 180);
+ WindowTitle := 'Product Information...';
+ Sizeable := False;
+ WindowPosition := wpScreenCenter;
+
+ lblName1 := TfpgLabel.Create(self);
+ with lblName1 do
+ begin
+ SetPosition(12, 16, 255, 31);
+ Text := 'fpGUI Designer';
+ FontDesc := 'Arial-20';
+ end;
+
+ lblVersion := TfpgLabel.Create(self);
+ with lblVersion do
+ begin
+ SetPosition(150, 56, 175, 16);
+ Text := 'Version: %s';
+ FontDesc := '#Label2';
+ end;
+
+ btnName1 := TfpgButton.Create(self);
+ with btnName1 do
+ begin
+ SetPosition(194, 148, 75, 24);
+ Anchors := [anRight,anBottom];
+ Text := 'Close';
+ FontDesc := '#Label1';
+ ImageName := 'stdimg.close';
+ ModalResult := 1;
+ end;
+
+ lblName3 := TfpgLabel.Create(self);
+ with lblName3 do
+ begin
+ SetPosition(12, 100, 241, 14);
+ Text := 'Written by Graeme Geldenhuys';
+ FontDesc := 'Arial-9';
+ end;
+
+ lblName4 := TfpgLabel.Create(self);
+ with lblName4 do
+ begin
+ SetPosition(12, 116, 246, 14);
+ Text := 'http://opensoft.homeip.net/fpgui/';
+ FontDesc := 'Arial-9:underline';
+ end;
+
+ lblCompiled := TfpgLabel.Create(self);
+ with lblCompiled do
+ begin
+ SetPosition(12, 132, 191, 13);
+ Text := 'Compiled on: %s';
+ FontDesc := 'Arial-8';
+ end;
+
+ {@VFD_BODY_END: frmAbout}
+end;
+
+class procedure TfrmAbout.Execute;
+var
+ frm: TfrmAbout;
+begin
+ frm := TfrmAbout.Create(nil);
+ try
+ frm.lblVersion.Text := Format(frm.lblVersion.Text, [program_version]);
+ frm.lblCompiled.Text := Format(frm.lblCompiled.Text, [ {$I %date%} + ' ' + {$I %time%}]);
+ frm.ShowModal;
+ finally
+ frm.Free;
+ end;
+end;
+
+
procedure TfrmMain.AfterCreate;
var
n: integer;
@@ -193,7 +264,7 @@ var
btn: TwgPaletteButton;
begin
{@VFD_BODY_BEGIN: frmMain}
- SetPosition(43, 40, 635, 87);
+ SetPosition(84, 123, 635, 87);
WindowTitle := 'frmMain';
WindowPosition := wpUser;
@@ -266,6 +337,8 @@ begin
SetPosition(464, 64, 120, 20);
AddMenuItem('New', '', @(maindsgn.OnNewFile));
AddMenuItem('Open', '', @(maindsgn.OnLoadFile));
+ // FFileOpenRecent := AddMenuItem('Open Recent...', '', nil);
+ // FFileOpenRecent.Enabled := False;
AddMenuItem('Save', '', @(maindsgn.OnSaveFile));
AddMenuItem('-', '', nil);
AddMenuItem('New Form...', '', @(maindsgn.OnNewForm));
@@ -289,6 +362,31 @@ begin
AddMenuItem('General options ...', '', @(maindsgn.OnOptionsClick));
end;
+ miOpenRecentMenu := TfpgPopupMenu.Create(self);
+ with miOpenRecentMenu do
+ begin
+ SetPosition(336, 68, 128, 20);
+ end;
+
+ helpmenu := TfpgPopupMenu.Create(self);
+ with helpmenu do
+ begin
+ SetPosition(328, 52, 120, 20);
+ AddMenuItem('Product Information', '', @miHelpAboutClick);
+ AddMenuItem('About fpGUI', '', @miHelpAboutGUI);
+ end;
+
+ previewmenu := TfpgPopupMenu.Create(self);
+ with previewmenu do
+ begin
+ SetPosition(324, 36, 120, 20);
+ AddMenuItem('with Windows 9x', '', nil).Enabled := False;
+ AddMenuItem('with Windows XP', '', nil).Enabled := False;
+ AddMenuItem('with OpenSoft', '', nil).Enabled := False;
+ AddMenuItem('with Motif', '', nil).Enabled := False;
+ AddMenuItem('with OpenLook', '', nil).Enabled := False;
+ end;
+
{@VFD_BODY_END: frmMain}
@@ -314,6 +412,10 @@ begin
MainMenu.AddMenuItem('&File', nil).SubMenu := filemenu;
MainMenu.AddMenuItem('&Settings', nil).SubMenu := setmenu;
MainMenu.AddMenuItem('Fo&rm', nil).SubMenu := formmenu;
+ MainMenu.AddMenuItem('&Preview', nil).SubMenu := previewmenu;
+ MainMenu.AddMenuItem('&Help', nil).SubMenu := helpmenu;
+
+// FFileOpenRecent.SubMenu := miOpenRecentMenu;
end;
procedure TfrmMain.OnPaletteClick(Sender: TObject);
@@ -340,25 +442,21 @@ var
begin
inherited;
- fpgImages.AddBMP(
+ fpgImages.AddMaskedBMP(
'vfd.anchorleft', @vfd_anchorleft,
- sizeof(vfd_anchorleft)
- );
+ sizeof(vfd_anchorleft), 0, 0);
- fpgImages.AddBMP(
+ fpgImages.AddMaskedBMP(
'vfd.anchorright', @vfd_anchorright,
- sizeof(vfd_anchorright)
- );
+ sizeof(vfd_anchorright), 0, 0);
- fpgImages.AddBMP(
+ fpgImages.AddMaskedBMP(
'vfd.anchortop', @vfd_anchortop,
- sizeof(vfd_anchortop)
- );
+ sizeof(vfd_anchortop), 0, 0);
- fpgImages.AddBMP(
+ fpgImages.AddMaskedBMP(
'vfd.anchorbottom', @vfd_anchorbottom,
- sizeof(vfd_anchorbottom)
- );
+ sizeof(vfd_anchorbottom), 0, 0);
WindowPosition := wpUser;
@@ -517,6 +615,19 @@ begin
inherited;
end;
+constructor TfrmProperties.Create(AOwner: TComponent);
+begin
+ inherited Create(AOwner);
+ Name := 'frmProperties';
+ gINI.ReadFormState(self);
+end;
+
+destructor TfrmProperties.Destroy;
+begin
+ gINI.WriteFormState(self);
+ inherited Destroy;
+end;
+
{ TPropertyList }
procedure TPropertyList.AddItem(aProp: TVFDWidgetProperty);
@@ -697,6 +808,35 @@ begin
editor.SetPosition(x, editor.Top, Width - ScrollBarWidth - x, editor.Height);
end;
+procedure TfrmMain.OpenRecentFileClick(Sender: TObject);
+begin
+ if Sender is TfpgMenuItem then
+ writeln(TfpgMenuItem(Sender).Text + ' clicked...');
+end;
+
+procedure TfrmMain.miHelpAboutClick(Sender: TObject);
+begin
+ TfrmAbout.Execute;
+end;
+
+procedure TfrmMain.miHelpAboutGUI(Sender: TObject);
+begin
+ ShowMessage('This product was created using fpGUI v0.5', 'About fpGUI');
+end;
+
+constructor TfrmMain.Create(AOwner: TComponent);
+begin
+ inherited Create(AOwner);
+ Name := 'frmMain';
+ gINI.ReadFormState(self);
+end;
+
+destructor TfrmMain.Destroy;
+begin
+ gINI.WriteFormState(self);
+ inherited Destroy;
+end;
+
function TfrmMain.GetSelectedWidget: TVFDWidgetClass;
begin
if chlPalette.FocusItem > 1 then
@@ -718,6 +858,15 @@ begin
end;
end;
+procedure TfrmMain.AddRecentFile(AFilename: string);
+var
+ mi: TfpgMenuItem;
+begin
+ gINI.WriteString('RecentFiles', ExtractFileName(AFileName), AFileName);
+ FFileOpenRecent.Enabled := True;
+ mi := miOpenRecentMenu.AddMenuItem(AFileName, '', @OpenRecentFileClick);
+end;
+
procedure TwgPropertyList.ReleaseEditor;
begin
self.ActiveWidget := nil;
@@ -761,5 +910,6 @@ begin
Canvas.EndDraw;
end;
+
end.
diff --git a/examples/apps/uidesigner/uidesigner.lpr b/examples/apps/uidesigner/uidesigner.lpr
index 9405a668..fe3c980d 100644
--- a/examples/apps/uidesigner/uidesigner.lpr
+++ b/examples/apps/uidesigner/uidesigner.lpr
@@ -31,34 +31,22 @@ uses
procedure MainProc;
begin
fpgApplication.Initialize;
-
- RegisterWidgets;
- PropList := TPropertyList.Create;
- maindsgn := TMainDesigner.Create;
- maindsgn.CreateWindows;
- maindsgn.EditedFileName := ParamStr(1);
- if FileExists(maindsgn.EditedFileName) then
- maindsgn.OnLoadFile(maindsgn);
-
- // Note: This needs improving!!
- fpgApplication.ProcessMessages;
- repeat
- fpgWaitWindowMessage;
- until (not frmMain.Visible);
-
-{
- repeat
- try
- fpgDoMessageLoop;
- break;
- except
- on e: Exception do
- ShowMessage(e.message, 'Exception');
- end;
- until False;
-}
-
-// fpgApplication.Run;
+ try
+ RegisterWidgets;
+ PropList := TPropertyList.Create;
+ maindsgn := TMainDesigner.Create;
+ maindsgn.CreateWindows;
+ maindsgn.EditedFileName := ParamStr(1);
+ if FileExists(maindsgn.EditedFileName) then
+ maindsgn.OnLoadFile(maindsgn);
+
+ // Note: This needs improving!!
+ fpgApplication.MainForm := frmMain;
+ fpgApplication.Run;
+
+ finally
+ maindsgn.Free;
+ end;
end;
begin
diff --git a/examples/apps/uidesigner/vfdforms.pas b/examples/apps/uidesigner/vfdforms.pas
index 6cc5a263..6454dff2 100644
--- a/examples/apps/uidesigner/vfdforms.pas
+++ b/examples/apps/uidesigner/vfdforms.pas
@@ -78,14 +78,18 @@ type
TWidgetOrderForm = class(TVFDDialog)
public
+ {@VFD_HEAD_BEGIN: WidgetOrderForm}
l1: TfpgLabel;
list: TfpgListBox;
- btnUP,
- btnDOWN,
- btnOK,
+ btnOK: TfpgButton;
btnCancel: TfpgButton;
- procedure AfterCreate; override;
- procedure OnButtonClick(Sender: TObject);
+ btnUp: TfpgButton;
+ btnDown: TfpgButton;
+ {@VFD_HEAD_END: WidgetOrderForm}
+ constructor Create(AOwner: TComponent); override;
+ destructor Destroy; override;
+ procedure AfterCreate; override;
+ procedure OnButtonClick(Sender: TObject);
end;
@@ -105,7 +109,9 @@ type
btnOK: TfpgButton;
btnCancel: TfpgButton;
{@VFD_HEAD_END: frmVFDSetup}
- procedure AfterCreate; override;
+ constructor Create(AOwner: TComponent); override;
+ destructor Destroy; override;
+ procedure AfterCreate; override;
end;
@@ -118,7 +124,8 @@ implementation
uses
vfdmain,
- fpgfx;
+ fpgfx,
+ gui_iniutils;
function GridResolution: integer;
begin
@@ -217,11 +224,12 @@ begin
Width := 186;
Height := 66;
WindowTitle := 'Position';
+ Sizeable := False;
lbPos := CreateLabel(self, 8, 8, 'Pos: ');
edPos := CreateEdit(self, 8, 28, 80, 0);
- btnOK := CreateButton(self, 96, 8, 80, 'OK', @OnButtonClick);
- btnCancel := CreateButton(self, 96, 36, 80, 'Cancel', @OnButtonClick);
+ btnOK := CreateButton(self, 100, 8, 75, 'OK', @OnButtonClick);
+ btnCancel := CreateButton(self, 100, 36, 75, 'Cancel', @OnButtonClick);
btnOK.ImageName := 'stdimg.ok';
btnOK.ShowImage := True;
btnCancel.ImageName := 'stdimg.cancel';
@@ -238,27 +246,92 @@ end;
{ TWidgetOrderForm }
+constructor TWidgetOrderForm.Create(AOwner: TComponent);
+begin
+ inherited Create(AOwner);
+ Name := 'WidgetOrderForm';
+ gINI.ReadFormState(self);
+end;
+
+destructor TWidgetOrderForm.Destroy;
+begin
+ gINI.WriteFormState(self);
+ inherited Destroy;
+end;
+
procedure TWidgetOrderForm.AfterCreate;
begin
inherited AfterCreate;
- WindowPosition := wpScreenCenter;
- SetPosition(0, 0, 322, 258);
+ {@VFD_BODY_BEGIN: WidgetOrderForm}
+ SetPosition(100, 100, 312, 258);
WindowTitle := 'Widget order';
+ WindowPosition := wpScreenCenter;
- l1 := CreateLabel(self, 4, 4, 'Form widget order:');
+ l1 := TfpgLabel.Create(self);
+ with l1 do
+ begin
+ SetPosition(4, 4, 108, 16);
+ Text := 'Form widget order:';
+ FontDesc := '#Label1';
+ end;
list := TfpgListBox.Create(self);
- list.SetPosition(4, 24, 220, 228);
+ with list do
+ begin
+ SetPosition(4, 24, 220, 228);
+ Anchors := [anLeft,anRight,anTop,anBottom];
+ FontDesc := '#List';
+ end;
- btnOK := CreateButton(self, 232, 24, 80, 'OK', @OnButtonClick);
- btnOK.ImageName := 'stdimg.ok';
- btnOK.ShowImage := True;
- btnCancel := CreateButton(self, 232, 52, 80, 'Cancel', @OnButtonClick);
- btnCancel.ImageName := 'stdimg.cancel';
- btnCancel.ShowImage := True;
+ btnOK := TfpgButton.Create(self);
+ with btnOK do
+ begin
+ SetPosition(232, 24, 75, 24);
+ Anchors := [anRight,anTop];
+ Text := 'OK';
+ FontDesc := '#Label1';
+ ImageName := 'stdimg.ok';
+ ModalResult := 0;
+ OnClick := @OnButtonClick;
+ end;
+
+ btnCancel := TfpgButton.Create(self);
+ with btnCancel do
+ begin
+ SetPosition(232, 52, 75, 24);
+ Anchors := [anRight,anTop];
+ Text := 'Cancel';
+ FontDesc := '#Label1';
+ ImageName := 'stdimg.cancel';
+ ModalResult := 0;
+ OnClick := @OnButtonClick;
+ end;
+
+ btnUp := TfpgButton.Create(self);
+ with btnUp do
+ begin
+ SetPosition(232, 108, 75, 24);
+ Anchors := [anRight,anTop];
+ Text := 'Up';
+ FontDesc := '#Label1';
+ ImageName := '';
+ ModalResult := 0;
+ OnClick := @OnButtonClick;
+ end;
+
+ btnDown := TfpgButton.Create(self);
+ with btnDown do
+ begin
+ SetPosition(232, 136, 75, 24);
+ Anchors := [anRight,anTop];
+ Text := 'Down';
+ FontDesc := '#Label1';
+ ImageName := '';
+ ModalResult := 0;
+ OnClick := @OnButtonClick;
+ end;
- btnUP := CreateButton(self, 232, 108, 80, 'UP', @OnButtonClick);
- btnDOWN := CreateButton(self, 232, 136, 80, 'DOWN', @OnButtonClick);
+ {@VFD_BODY_END: WidgetOrderForm}
end;
procedure TWidgetOrderForm.OnButtonClick(Sender: TObject);
@@ -352,47 +425,67 @@ begin
inherited HandleKeyPress(keycode, shiftstate, consumed);
end;
+constructor TfrmVFDSetup.Create(AOwner: TComponent);
+begin
+ inherited Create(AOwner);
+ Name := 'frmVFDSetup';
+ gINI.ReadFormState(self);
+end;
+
+destructor TfrmVFDSetup.Destroy;
+begin
+ gINI.WriteFormState(self);
+ inherited Destroy;
+end;
+
procedure TfrmVFDSetup.AfterCreate;
begin
{@VFD_BODY_BEGIN: frmVFDSetup}
- SetPosition(322, 337, 237, 70);
+ SetPosition(394, 399, 237, 70);
WindowTitle := 'General settings';
+ WindowPosition := wpScreenCenter;
lb1 := TfpgLabel.Create(self);
with lb1 do
begin
- SetPosition(8, 8, 92, 16);
+ SetPosition(8, 8, 116, 16);
Text := 'Grid resolution:';
+ FontDesc := '#Label1';
end;
chlGrid := TfpgComboBox.Create(self);
with chlGrid do
begin
- SetPosition(104, 4, 56, 22);
- items.Add('1');
- items.Add('4');
- items.Add('8');
+ SetPosition(128, 4, 56, 22);
+ Items.Add('1');
+ Items.Add('4');
+ Items.Add('8');
+ FontDesc := '#List';
FocusItem := 2;
end;
btnOK := TfpgButton.Create(self);
with btnOK do
begin
- SetPosition(8, 40, 96, 24);
- Text := 'OK';
- ImageName := 'stdimg.ok';
- ShowImage := True;
+ SetPosition(77, 40, 75, 24);
+ Anchors := [anRight,anBottom];
+ Text := 'OK';
+ FontDesc := '#Label1';
+ ImageName := 'stdimg.ok';
ModalResult := 1;
+ ShowImage := True;
end;
btnCancel := TfpgButton.Create(self);
with btnCancel do
begin
- SetPosition(132, 40, 96, 24);
- Text := 'Cancel';
- ImageName := 'stdimg.cancel';
- ShowImage := True;
+ SetPosition(156, 40, 75, 24);
+ Anchors := [anRight,anBottom];
+ Text := 'Cancel';
+ FontDesc := '#Label1';
+ ImageName := 'stdimg.cancel';
ModalResult := -1;
+ ShowImage := True;
end;
{@VFD_BODY_END: frmVFDSetup}
diff --git a/examples/apps/uidesigner/vfdmain.pas b/examples/apps/uidesigner/vfdmain.pas
index 4d2648f3..f65656a0 100644
--- a/examples/apps/uidesigner/vfdmain.pas
+++ b/examples/apps/uidesigner/vfdmain.pas
@@ -32,7 +32,7 @@ uses
newformdesigner;
const
- program_version = '0.10';
+ program_version = '0.2';
type
@@ -153,14 +153,9 @@ begin
begin
bl2 := FFile.Block(m);
if (bl2.BlockID = 'VFD_BODY_BEGIN') and (bl2.FormName = bl.FormName) then
- CreateParseForm(bl.FormName, bl.Data, bl2.Data)// pair has found
- //Writeln('Parsing form: ',bl.FormName);
- //Writeln(bl.data);
- //Writeln(bl2.data);
- ;
+ CreateParseForm(bl.FormName, bl.Data, bl2.Data); // pair was found
end;
end;
-
end;
procedure TMainDesigner.OnSaveFile(Sender: TObject);
@@ -222,7 +217,7 @@ begin
finally
CloseFile(ff);
end;
- writeln('Form saved.');
+// frmMain.AddRecentFile(fname);
frmMain.WindowTitle := 'fpGUI Designer v' + program_version + ' - ' + fname;
except
Writeln('Form save I/O failure.');
@@ -322,6 +317,9 @@ begin
TFormDesigner(FDesigners[n]).Free;
FDesigners.Free;
FFile.Free;
+
+ frmProperties.Free;
+ frmMain.Free;
inherited;
end;
@@ -395,7 +393,8 @@ end;
procedure TMainDesigner.OnExit(Sender: TObject);
begin
- halt(0);
+ frmProperties.Close;
+ frmMain.Close;
end;
procedure TMainDesigner.OnOptionsClick(Sender: TObject);
diff --git a/examples/corelib/canvastest/fpgcanvas.lpr b/examples/corelib/canvastest/fpgcanvas.lpr
index 75baf8a5..790fa4e6 100644
--- a/examples/corelib/canvastest/fpgcanvas.lpr
+++ b/examples/corelib/canvastest/fpgcanvas.lpr
@@ -214,6 +214,7 @@ begin
frm := TMainForm.Create(nil);
frm.Show;
fpgApplication.Run;
+ frm.Free;
end;
diff --git a/examples/corelib/eventtest/eventtest.lpr b/examples/corelib/eventtest/eventtest.lpr
index 326dd277..492f05dc 100644
--- a/examples/corelib/eventtest/eventtest.lpr
+++ b/examples/corelib/eventtest/eventtest.lpr
@@ -240,6 +240,7 @@ begin
frm := TMainForm.Create(nil);
frm.Show;
fpgApplication.Run;
+ frm.Free;
end;
begin
diff --git a/examples/gui/alignment/aligntest.dpr b/examples/gui/alignment/aligntest.dpr
index 7099b761..60d98ba5 100644
--- a/examples/gui/alignment/aligntest.dpr
+++ b/examples/gui/alignment/aligntest.dpr
@@ -99,6 +99,7 @@ begin
frm.Show;
fpgApplication.Run;
+ frm.Free;
end;
begin
diff --git a/examples/gui/bevel/beveltest.lpr b/examples/gui/bevel/beveltest.lpr
index e339825e..287788ea 100644
--- a/examples/gui/bevel/beveltest.lpr
+++ b/examples/gui/bevel/beveltest.lpr
@@ -102,6 +102,7 @@ begin
frm := TMainForm.Create(nil);
frm.Show;
fpgApplication.Run;
+ frm.Free;
end;
begin
diff --git a/examples/gui/filedialog/filedialog.lpr b/examples/gui/filedialog/filedialog.lpr
index 01793a6f..f1f06a04 100644
--- a/examples/gui/filedialog/filedialog.lpr
+++ b/examples/gui/filedialog/filedialog.lpr
@@ -92,6 +92,7 @@ begin
frm := TMainForm.Create(nil);
frm.Show;
fpgApplication.Run;
+ frm.Free;
end;
begin
diff --git a/examples/gui/filegrid/filegrid.lpr b/examples/gui/filegrid/filegrid.lpr
index cd8f68ea..83185602 100644
--- a/examples/gui/filegrid/filegrid.lpr
+++ b/examples/gui/filegrid/filegrid.lpr
@@ -70,6 +70,7 @@ begin
frm := TMainForm.Create(nil);
frm.Show;
fpgApplication.Run;
+ frm.Free;
end;
begin
diff --git a/examples/gui/fontselect/fontselect.lpr b/examples/gui/fontselect/fontselect.lpr
index cc9f1ca6..15514674 100644
--- a/examples/gui/fontselect/fontselect.lpr
+++ b/examples/gui/fontselect/fontselect.lpr
@@ -97,6 +97,7 @@ begin
frm := TMainForm.Create(nil);
frm.Show;
fpgApplication.Run;
+ frm.Free;
end;
begin
diff --git a/examples/gui/gridtest/gridtest.lpr b/examples/gui/gridtest/gridtest.lpr
index ca8bd071..88bc77f1 100644
--- a/examples/gui/gridtest/gridtest.lpr
+++ b/examples/gui/gridtest/gridtest.lpr
@@ -153,6 +153,7 @@ begin
frm := TMainForm.Create(nil);
frm.Show;
fpgApplication.Run;
+ frm.Free;
end;
begin
diff --git a/examples/gui/imgtest/bitmaptest.dpr b/examples/gui/imgtest/bitmaptest.dpr
index 380aa076..39906e87 100644
--- a/examples/gui/imgtest/bitmaptest.dpr
+++ b/examples/gui/imgtest/bitmaptest.dpr
@@ -69,6 +69,7 @@ begin
frm := TMainForm.Create(nil);
frm.Show;
fpgApplication.Run;
+ frm.Free;
end;
diff --git a/examples/gui/listviewtest/listviewtest.lpi b/examples/gui/listviewtest/listviewtest.lpi
index 8e8f6e62..d6e7b16f 100644
--- a/examples/gui/listviewtest/listviewtest.lpi
+++ b/examples/gui/listviewtest/listviewtest.lpi
@@ -25,10 +25,10 @@
</RunParams>
<RequiredPackages Count="2">
<Item1>
- <PackageName Value="fpgui_package"/>
+ <PackageName Value="fpgfx_package"/>
</Item1>
<Item2>
- <PackageName Value="fpgfx_package"/>
+ <PackageName Value="fpgui_package"/>
</Item2>
</RequiredPackages>
<Units Count="1">
diff --git a/examples/gui/listviewtest/listviewtest.lpr b/examples/gui/listviewtest/listviewtest.lpr
index 8e61d78f..d4eb30fc 100644
--- a/examples/gui/listviewtest/listviewtest.lpr
+++ b/examples/gui/listviewtest/listviewtest.lpr
@@ -26,11 +26,8 @@ type
ItemIndex: Integer; Area:TfpgRect; var PaintPart: TfpgLVItemPaintPart);
procedure ItemSelectionChanged(ListView: TfpgListView; Item: TfpgLVItem;
ItemIndex: Integer; Selected: Boolean);
-
-
public
constructor Create(AOwner: TComponent); override;
- destructor Destroy; override;
end;
{ TMainForm }
@@ -188,14 +185,10 @@ begin
end;
-destructor TMainForm.Destroy;
-begin
- inherited Destroy;
-end;
-
begin
fpgApplication.Initialize;
- with TMainForm.Create(nil) do begin
+ with TMainForm.Create(nil) do
+ begin
Show;
fpgApplication.Run;
Free;
diff --git a/examples/gui/menutest/menutest.lpr b/examples/gui/menutest/menutest.lpr
index cac4e8e7..1ed77135 100644
--- a/examples/gui/menutest/menutest.lpr
+++ b/examples/gui/menutest/menutest.lpr
@@ -92,6 +92,7 @@ begin
frm := TMainForm.Create(nil);
frm.Show;
fpgApplication.Run;
+ frm.Free;
end;
begin
diff --git a/examples/gui/modalforms/modalforms.lpi b/examples/gui/modalforms/modalforms.lpi
index 38db8012..bd6fc386 100644
--- a/examples/gui/modalforms/modalforms.lpi
+++ b/examples/gui/modalforms/modalforms.lpi
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<CONFIG>
<ProjectOptions>
- <PathDelim Value="\"/>
+ <PathDelim Value="/"/>
<Version Value="5"/>
<General>
<Flags>
@@ -9,7 +9,7 @@
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
- <IconPath Value=".\"/>
+ <IconPath Value="./"/>
<TargetFileExt Value=""/>
</General>
<VersionInfo>
@@ -23,7 +23,7 @@
<RunParams>
<local>
<FormatVersion Value="1"/>
- <LaunchingApplication PathPlusParams="\usr\X11R6\bin\xterm -T 'Lazarus Run Output' -e $(LazarusDir)\tools\runwait.sh $(TargetCmdLine)"/>
+ <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
</local>
</RunParams>
<RequiredPackages Count="1">
@@ -42,7 +42,6 @@
</ProjectOptions>
<CompilerOptions>
<Version Value="5"/>
- <PathDelim Value="\"/>
<CodeGeneration>
<Generate Value="Faster"/>
</CodeGeneration>
diff --git a/examples/gui/modalforms/modalforms.lpr b/examples/gui/modalforms/modalforms.lpr
index c3faeaf3..91b1b840 100644
--- a/examples/gui/modalforms/modalforms.lpr
+++ b/examples/gui/modalforms/modalforms.lpr
@@ -157,6 +157,7 @@ begin
frm := TMainForm.Create(nil);
frm.Show;
fpgApplication.Run;
+ frm.Free;
end;
begin
diff --git a/examples/gui/stdimages/stdimglist.lpr b/examples/gui/stdimages/stdimglist.lpr
index 25ed254c..1bcdcb91 100644
--- a/examples/gui/stdimages/stdimglist.lpr
+++ b/examples/gui/stdimages/stdimglist.lpr
@@ -86,6 +86,7 @@ begin
frm := TMainForm.Create(nil);
frm.Show;
fpgApplication.Run;
+ frm.Free;
end;
begin
diff --git a/examples/gui/tabtest/tabtest.lpr b/examples/gui/tabtest/tabtest.lpr
index 47749e14..813c5b45 100644
--- a/examples/gui/tabtest/tabtest.lpr
+++ b/examples/gui/tabtest/tabtest.lpr
@@ -118,6 +118,7 @@ begin
frm := TMainForm.Create(nil);
frm.Show;
fpgApplication.Run;
+ frm.Free;
end;
begin
diff --git a/examples/gui/timertest/timertest.lpr b/examples/gui/timertest/timertest.lpr
index dab53ad2..e4189a73 100644
--- a/examples/gui/timertest/timertest.lpr
+++ b/examples/gui/timertest/timertest.lpr
@@ -125,6 +125,7 @@ begin
frm := TMainForm.Create(nil);
frm.Show;
fpgApplication.Run;
+ frm.Free;
end;
diff --git a/examples/gui/treeviewtest/treeviewtest.lpr b/examples/gui/treeviewtest/treeviewtest.lpr
index 27b1a3e4..101668f2 100644
--- a/examples/gui/treeviewtest/treeviewtest.lpr
+++ b/examples/gui/treeviewtest/treeviewtest.lpr
@@ -67,6 +67,7 @@ begin
frm := TMainForm.Create(nil);
frm.Show;
fpgApplication.Run;
+ frm.Free;
end;
begin