summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorgraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2007-09-06 21:41:49 +0000
committergraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2007-09-06 21:41:49 +0000
commit4296554992d2c56360ef23f5ada4c966b9fa157c (patch)
tree3cdfe0433cc85ee1a4cd7aefadcafa36c46b50de /examples
parent7d76bc5a71cccf70ab7e6c49fd3ea8d9c93f1e8c (diff)
downloadfpGUI-4296554992d2c56360ef23f5ada4c966b9fa157c.tar.xz
* Added a new generic property to TfpgWidget to dispatch messages so
the GUI Form Designer can intercept them. * File Save dialog can now save even if the file does not exist. Still needs a little bit of improvement. * GUI Designer now detects OS messages in designer window. * Painting has been improved a bit, though the z-order is still screwed. * The formating of a new template unit has been improved.
Diffstat (limited to 'examples')
-rw-r--r--examples/apps/uidesigner/uidesigner.lpi8
-rw-r--r--examples/apps/uidesigner/vfddesigner.pas7
-rw-r--r--examples/apps/uidesigner/vfdfile.pas55
-rw-r--r--examples/apps/uidesigner/vfdmain.pas2
4 files changed, 39 insertions, 33 deletions
diff --git a/examples/apps/uidesigner/uidesigner.lpi b/examples/apps/uidesigner/uidesigner.lpi
index 7ddc1083..99714a81 100644
--- a/examples/apps/uidesigner/uidesigner.lpi
+++ b/examples/apps/uidesigner/uidesigner.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=""/>
<Title Value="uiDesigner"/>
</General>
@@ -18,14 +18,13 @@
</VersionInfo>
<PublishOptions>
<Version Value="2"/>
- <IgnoreBinaries Value="False"/>
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
</PublishOptions>
<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">
@@ -104,6 +103,7 @@
</ProjectOptions>
<CompilerOptions>
<Version Value="5"/>
+ <PathDelim Value="\"/>
<Parsing>
<SyntaxOptions>
<AllowLabel Value="False"/>
diff --git a/examples/apps/uidesigner/vfddesigner.pas b/examples/apps/uidesigner/vfddesigner.pas
index c094c8c0..e2517e07 100644
--- a/examples/apps/uidesigner/vfddesigner.pas
+++ b/examples/apps/uidesigner/vfddesigner.pas
@@ -63,7 +63,6 @@ type
TDesignedForm = class(TfpgForm)
public
procedure AfterCreate; override;
- FormDesigner: TFormDesigner;
end;
@@ -275,6 +274,7 @@ var
wgd: TWidgetDesigner;
shift: boolean;
begin
+ writeln('TFormDesigner.MsgMouseDown');
FDragging := True;
FWasDrag := False;
FDragPosX := msg.Params.mouse.x;
@@ -311,6 +311,7 @@ var
shift: boolean;
x, y: integer;
begin
+writeln('TFormDesigner.MsgMouseUp');
FDragging := False;
shift := (ssShift in msg.Params.mouse.shiftstate);
@@ -480,8 +481,8 @@ var
l1: TfpgLabel;
ed1: TfpgEdit;
begin
- Exit;
-
+// Exit;
+ writeln('InitTest');
l1 := CreateLabel(FForm, 10, 10, 'Test Label');
ed1 := CreateEdit(FForm, 10, 50, 150, 0);
diff --git a/examples/apps/uidesigner/vfdfile.pas b/examples/apps/uidesigner/vfdfile.pas
index f31f82da..f7966327 100644
--- a/examples/apps/uidesigner/vfdfile.pas
+++ b/examples/apps/uidesigner/vfdfile.pas
@@ -34,39 +34,29 @@ type
Position: integer;
Data: string;
end;
+
TVFDFile = class
protected
FFileData: string;
FParsedData: string;
-
FBlocks: TList;
-
public
NewFormsDecl: string;
NewFormsImpl: string;
-
constructor Create;
destructor Destroy; override;
-
function LoadFile(fname: string): boolean;
-
procedure AddBlock(aposition: integer; ablockid, aformname, ablockdata: string);
function BlockCount: integer;
function Block(index: integer): TVFDFileBlock;
-
procedure FreeBlocks;
-
function GetBlocks: integer; // parse file
function MergeBlocks: string; // store file
-
procedure AddNewFormDecl(formname, formheadblock: string);
procedure AddNewFormImpl(formname, formbody: string);
-
function FindFormBlock(blockid, formname: string): TVFDFileBlock;
-
procedure SetFormData(formname, headblock, bodyblock: string);
-
procedure NewFileSkeleton(unitname: string);
end;
@@ -91,9 +81,13 @@ var
s: string;
begin
s :=
- ' T' + formname + ' = class(TGfxForm)'#10 + ' public'#10 + ' {@VFD_HEAD_BEGIN: ' + formname + '}'#10 +
- formheadblock + ' {@VFD_HEAD_END: ' + formname + '}'#10 + #10 + ' procedure AfterCreate; override;'#10
- + ' end;'#10 + ''#10;
+ ' T' + formname + ' = class(TfpgForm)' + LineEnding +
+ ' public' + LineEnding +
+ ' {@VFD_HEAD_BEGIN: ' + formname + '}' + LineEnding +
+ formheadblock +
+ ' {@VFD_HEAD_END: ' + formname + '}' + LineEnding + LineEnding +
+ ' procedure AfterCreate; override;' + LineEnding
+ + ' end;' + LineEnding + LineEnding;
NewFormsDecl := NewFormsDecl + s;
end;
@@ -101,8 +95,13 @@ procedure TVFDFile.AddNewFormImpl(formname, formbody: string);
var
s: string;
begin
- s := #10#10 + 'procedure T' + formname + '.AfterCreate;'#10 + 'begin'#10 + ' {@VFD_BODY_BEGIN: ' + formname + '}'#10 +
- formbody + ' {@VFD_BODY_END: ' + formname + '}'#10 + 'end;'#10;
+ s := LineEnding + LineEnding +
+ 'procedure T' + formname + '.AfterCreate;' + LineEnding +
+ 'begin' + LineEnding +
+ ' {@VFD_BODY_BEGIN: ' + formname + '}' + LineEnding +
+ formbody +
+ ' {@VFD_BODY_END: ' + formname + '}' + LineEnding +
+ 'end;' + LineEnding;
NewFormsImpl := NewFormsImpl + s;
end;
@@ -214,7 +213,7 @@ begin
deletelen := length(startmarker);
dropmarker := False;
- Writeln('marker: ', startmarker);
+// Writeln('marker: ', startmarker);
// block marker ?
@@ -322,7 +321,7 @@ begin
iblock := startmarker;
if endmarker <> '' then
- iblock := iblock + #10 + fb.Data + endmarker;
+ iblock := iblock + LineEnding + fb.Data + endmarker;
if fb.BlockID = 'VFD_NEWFORM_DECL' then
iblock := NewFormsDecl + iblock
@@ -348,13 +347,19 @@ end;
procedure TVFDFile.NewFileSkeleton(unitname: string);
begin
FFileData :=
- 'unit ' + unitname + ';'#10 + #10 + '{$ifdef FPC}'#10 + '{$mode objfpc}{$H+}'#10 +
- '{$endif}'#10 + ''#10 + 'interface'#10 + ''#10 + 'uses'#10 +
- ' SysUtils, Classes, gfxbase, wgedit, unitkeys, schar16, gfxstyle,'#10 +
- ' gfxwidget, gfxform, wglabel, wgbutton,'#10 + ' wglistbox, wgmemo, wgchoicelist, wggrid, sqldb, sqluis,'#10
- + ' wgdbgrid, gfxdialogs, wgcheckbox;'#10 + ''#10 + 'type'#10 + ''#10 +
- '{@VFD_NEWFORM_DECL}'#10 + ''#10 + 'implementation'#10 + ''#10 + '{@VFD_NEWFORM_IMPL}'#10
- + ''#10 + 'end.'#10;
+ 'unit ' + unitname + ';'+ LineEnding + LineEnding +
+ '{$mode objfpc}{$H+}' + LineEnding + LineEnding +
+ 'interface' + LineEnding + LineEnding +
+ 'uses' + LineEnding +
+ ' SysUtils, Classes, gfxbase, fpgfx, gui_edit, ' + LineEnding +
+ ' gfx_widget, gui_form, gui_label, gui_button,' + LineEnding +
+ ' gui_listbox, gui_memo, gui_combobox, gui_grid, ' + LineEnding +
+ ' gui_dialogs, gui_checkbox;' + LineEnding + LineEnding +
+ 'type' + LineEnding + LineEnding +
+ '{@VFD_NEWFORM_DECL}' + LineEnding + LineEnding +
+ 'implementation' + LineEnding + LineEnding +
+ '{@VFD_NEWFORM_IMPL}' + LineEnding + LineEnding +
+ 'end.' + LineEnding;
GetBlocks;
end;
diff --git a/examples/apps/uidesigner/vfdmain.pas b/examples/apps/uidesigner/vfdmain.pas
index 90a3564e..7945a03c 100644
--- a/examples/apps/uidesigner/vfdmain.pas
+++ b/examples/apps/uidesigner/vfdmain.pas
@@ -431,7 +431,7 @@ begin
s := ExtractFileName(FEditedFileName);
if s = '' then
s := '[new]';
- frmMain.WindowTitle := s + ' - fpGUI uiDesigner ' + program_version;
+ frmMain.WindowTitle := 'fpGUI uiDesigner v' + program_version + ' - ' + s;
end;
end.