diff options
author | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2007-09-08 11:17:20 +0000 |
---|---|---|
committer | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2007-09-08 11:17:20 +0000 |
commit | 8c2cd0a27d852f4b02ca07850a2fbaf9cec05368 (patch) | |
tree | b46694481fff1a719d8f6323aa02c78605d1c363 /examples | |
parent | 1e7af73a67cff669d2b5801f5097e71b30673adc (diff) | |
download | fpGUI-8c2cd0a27d852f4b02ca07850a2fbaf9cec05368.tar.xz |
* GUI Designer: Some code formating changes in generated code.
* GUI: minor amendments in basegrid and listbox to work correctly in the GUI Designer.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/apps/uidesigner/readme.txt | 50 | ||||
-rw-r--r-- | examples/apps/uidesigner/vfddesigner.pas | 17 | ||||
-rw-r--r-- | examples/apps/uidesigner/vfdformparser.pas | 11 | ||||
-rw-r--r-- | examples/gui/gridtest/gridtest.lpr | 28 |
4 files changed, 75 insertions, 31 deletions
diff --git a/examples/apps/uidesigner/readme.txt b/examples/apps/uidesigner/readme.txt new file mode 100644 index 00000000..b0ffd0eb --- /dev/null +++ b/examples/apps/uidesigner/readme.txt @@ -0,0 +1,50 @@ + + fpGUI's Visual User Interface Designer + ====================================== + + +Introduction +============ + +fpGUI Designer is a port of a product called VFD written by Nagy Viktor in 2003. +I ported VFD to fpGUI because I thought it would add a lot to the framework as +a whole. I could see it has lots of potential and could easily be extended to +become a great tool. What I immediately liked about VFD is that it used the +same source unit and writes actual code describing the UI like I would have +done manually. This departs from the GUI designers used in Lazarus or Delphi +where they save the UI code to external files (*.lfm or *.dfm respectively). + + +Features +======== + +* It uses the same source unit where your normal code lives. No external GUI + files. + +* It can handle "unknown" or "custom" components and properties. Whenever the + designer finds a component it doesn't natively know it paints a green + rectangle in it's place. Whenever it finds properties it doesn't know it + adds them "as is" to the Unknown section memo in the Properties window. Any + code in the Unknown memo will be written back to the source unit "as is". + +* The designer can handle more that one form in a unit. + +* When creating a new form, that form can be merged into an existing unit or + the designer will create a new unit for it. + +* The designer uses comment markers in the code to define what parts it will + maintain. Existing code (Forms) can be easily amended (manually by the + programmer) so that the designer can start managing it. No need to redesign + Forms from scratch. + + + +Graeme Geldenhuys - September 2007 + + ============================================ + + + + + + diff --git a/examples/apps/uidesigner/vfddesigner.pas b/examples/apps/uidesigner/vfddesigner.pas index a29a4446..4640ac06 100644 --- a/examples/apps/uidesigner/vfddesigner.pas +++ b/examples/apps/uidesigner/vfddesigner.pas @@ -1256,7 +1256,7 @@ begin wgclass := TOtherWidget(wd.Widget).wgClassName else wgclass := wd.Widget.ClassName; - Result := Result + ' ' + wd.Widget.Name + ' : ' + wgclass + ';' + LineEnding; + Result := Result + ' ' + wd.Widget.Name + ': ' + wgclass + ';' + LineEnding; end; end; @@ -1274,8 +1274,11 @@ begin if maindsgn.SaveComponentNames then s := s + ' Name := ' + QuotedStr(FForm.Name) + ';' + LineEnding; - s := s + ' SetPosition(' + IntToStr(FForm.Left) + ',' + IntToStr(FForm.Top) + ',' + IntToStr( - FForm.Width) + ',' + IntToStr(FForm.Height) + ');' + LineEnding; + s := s + ' SetPosition(' + + IntToStr(FForm.Left) + ', ' + + IntToStr(FForm.Top) + ', ' + + IntToStr(FForm.Width) + ', ' + + IntToStr(FForm.Height) + ');' + LineEnding; s := s + ' WindowTitle := ' + QuotedStr(FForm.WindowTitle) + ';' + LineEnding; //adding other form properties, idented @@ -1354,8 +1357,10 @@ begin if maindsgn.SaveComponentNames then s := s + ident + 'Name := ' + QuotedStr(wg.Name) + ';' + LineEnding; - s := s + ident + 'SetPosition(' + IntToStr(wg.Left) + ', ' - + IntToStr(wg.Top) + ',' + IntToStr(wg.Width) + ', ' + s := s + ident + 'SetPosition(' + + IntToStr(wg.Left) + ', ' + + IntToStr(wg.Top) + ', ' + + IntToStr(wg.Width) + ', ' + IntToStr(wg.Height) + ');' + LineEnding; if wg.Anchors <> [anLeft, anTop] then @@ -1570,7 +1575,7 @@ begin Canvas.SetColor(clWidgetFrame); Canvas.DrawRectangle(0, 0, Width, Height); Canvas.SetTextColor(clText1); - s := Name + ' : ' + wgClassName; + s := Name + ': ' + wgClassName; Canvas.DrawString(2, 2, s); Canvas.EndDraw; diff --git a/examples/apps/uidesigner/vfdformparser.pas b/examples/apps/uidesigner/vfdformparser.pas index 334b4199..d57be188 100644 --- a/examples/apps/uidesigner/vfdformparser.pas +++ b/examples/apps/uidesigner/vfdformparser.pas @@ -295,17 +295,6 @@ begin end; end; - { - if wgclassuc = 'TWGLABEL' then wg := TwgLabel.Create(pwg) - else if wgclassuc = 'TWGEDIT' then wg := TwgEdit.Create(pwg) - else if wgclassuc = 'TWGCHECKBOX' then wg := TwgCheckBox.Create(pwg) - else if wgclassuc = 'TWGBUTTON' then wg := TwgButton.Create(pwg) - else if wgclassuc = 'TWGMEMO' then wg := TwgMemo.Create(pwg) - else if wgclassuc = 'TWGCHOICELIST' then wg := TwgChoiceList.Create(pwg) - else if wgclassuc = 'TWGDBGRID' then wg := TwgDBGrid.Create(pwg) - else if wgclassuc = 'TWGTEXTLISTBOX' then wg := TwgTextListBox.Create(pwg) - else -} if wg = nil then begin wgc := VFDOtherWidget; diff --git a/examples/gui/gridtest/gridtest.lpr b/examples/gui/gridtest/gridtest.lpr index a5f1d731..ca8bd071 100644 --- a/examples/gui/gridtest/gridtest.lpr +++ b/examples/gui/gridtest/gridtest.lpr @@ -24,7 +24,7 @@ type pagecontrol: TfpgPageControl; tsTab1: TfpgTabSheet; tsTab2: TfpgTabSheet; - grdMain: TfpgGrid; + grdMain: TfpgStringGrid; stringgrid: TfpgStringGrid; chkShowHeader: TfpgCheckBox; chkShowGrid: TfpgCheckBox; @@ -45,26 +45,26 @@ type procedure TMainForm.chkDisabledChange(Sender: TObject); begin - grdMain.Enabled := not chkDisabled.Checked; - stringgrid.Enabled := grdMain.Enabled; +// grdMain.Enabled := not chkDisabled.Checked; + stringgrid.Enabled := not chkDisabled.Checked; end; procedure TMainForm.chkRowSelectChange(Sender: TObject); begin - grdMain.RowSelect := chkRowSelect.Checked; - stringgrid.RowSelect := grdMain.RowSelect; +// grdMain.RowSelect := chkRowSelect.Checked; + stringgrid.RowSelect := chkRowSelect.Checked; end; procedure TMainForm.chkShowHeaderChange(Sender: TObject); begin - grdMain.ShowHeader := chkShowHeader.Checked; - stringgrid.ShowHeader := grdMain.ShowHeader; +// grdMain.ShowHeader := chkShowHeader.Checked; + stringgrid.ShowHeader := chkShowHeader.Checked; end; procedure TMainForm.chkShowGridChange(Sender: TObject); begin - grdMain.ShowGrid := chkShowGrid.Checked; - stringgrid.ShowGrid := grdMain.ShowGrid; +// grdMain.ShowGrid := chkShowGrid.Checked; + stringgrid.ShowGrid := chkShowGrid.Checked; end; procedure TMainForm.btnQuitClick(Sender: TObject); @@ -97,12 +97,12 @@ begin tsTab1 := TfpgTabSheet.Create(pagecontrol); tsTab1.Text := 'Base Grid'; - grdMain := TfpgGrid.Create(tsTab1); - grdMain.SetPosition(10, 10, Width-50, 250); +// grdMain := TfpgStringGrid.Create(tsTab1); +// grdMain.SetPosition(10, 10, Width-50, 250); // grdMain.Anchors := [anLeft, anTop, anRight, anBottom]; - grdMain.RowCount := 25; - for c := 1 to grdMain.ColumnCount do - grdMain.Columns[c-1].Title := 'Title ' + IntToStr(c); +// grdMain.RowCount := 25; +// for c := 1 to grdMain.ColumnCount do +// grdMain.Columns[c-1].Title := 'Title ' + IntToStr(c); tsTab2 := pagecontrol.AppendTabSheet('String Grid'); stringgrid := TfpgStringGrid.Create(tsTab2); |