diff options
Diffstat (limited to 'examples/gui')
-rw-r--r-- | examples/gui/dbtest/test.dbf | bin | 704 -> 704 bytes | |||
-rw-r--r-- | examples/gui/edits/edittest.lpi | 52 | ||||
-rw-r--r-- | examples/gui/edits/edittest.lpr | 133 | ||||
-rw-r--r-- | examples/gui/edits/extrafpc.cfg | 5 |
4 files changed, 190 insertions, 0 deletions
diff --git a/examples/gui/dbtest/test.dbf b/examples/gui/dbtest/test.dbf Binary files differindex 0b12908b..0c50b2da 100644 --- a/examples/gui/dbtest/test.dbf +++ b/examples/gui/dbtest/test.dbf diff --git a/examples/gui/edits/edittest.lpi b/examples/gui/edits/edittest.lpi new file mode 100644 index 00000000..302cd2c1 --- /dev/null +++ b/examples/gui/edits/edittest.lpi @@ -0,0 +1,52 @@ +<?xml version="1.0"?> +<CONFIG> + <ProjectOptions> + <PathDelim Value="/"/> + <Version Value="6"/> + <General> + <Flags> + <SaveOnlyProjectUnits Value="True"/> + </Flags> + <SessionStorage Value="InProjectDir"/> + <MainUnit Value="0"/> + <TargetFileExt Value=""/> + </General> + <VersionInfo> + <ProjectVersion Value=""/> + </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)"/> + </local> + </RunParams> + <RequiredPackages Count="1"> + <Item1> + <PackageName Value="fpgui_package"/> + </Item1> + </RequiredPackages> + <Units Count="1"> + <Unit0> + <Filename Value="edittest.lpr"/> + <IsPartOfProject Value="True"/> + <UnitName Value="edittest"/> + </Unit0> + </Units> + </ProjectOptions> + <CompilerOptions> + <Version Value="5"/> + <CodeGeneration> + <Generate Value="Faster"/> + </CodeGeneration> + <Other> + <CustomOptions Value="-FUunits"/> + <CompilerPath Value="$(CompPath)"/> + </Other> + </CompilerOptions> +</CONFIG> diff --git a/examples/gui/edits/edittest.lpr b/examples/gui/edits/edittest.lpr new file mode 100644 index 00000000..82eb9a48 --- /dev/null +++ b/examples/gui/edits/edittest.lpr @@ -0,0 +1,133 @@ +program edittest; + +{$mode objfpc}{$H+} + +uses + {$IFDEF UNIX}{$IFDEF UseCThreads} + cthreads, + {$ENDIF}{$ENDIF} + Classes, fpgfx, gui_form, gui_label, gui_edit, gui_button, fpgui_package; + +type + + TMainForm = class(TfpgForm) + private + procedure btnQuitClicked(Sender: TObject); + public + {@VFD_HEAD_BEGIN: MainForm} + lblName1: TfpgLabel; + edtText: TfpgEdit; + lblName2: TfpgLabel; + lblName3: TfpgLabel; + edtInteger: TfpgEditInteger; + edtFloat: TfpgEditFloat; + btnQuit: TfpgButton; + {@VFD_HEAD_END: MainForm} + procedure AfterCreate; override; + end; + +{@VFD_NEWFORM_DECL} + + + +{@VFD_NEWFORM_IMPL} + +procedure TMainForm.btnQuitClicked(Sender: TObject); +begin + Close; +end; + +procedure TMainForm.AfterCreate; +begin + {@VFD_BODY_BEGIN: MainForm} + Name := 'MainForm'; + SetPosition(363, 198, 271, 234); + WindowTitle := 'Edit components'; + WindowPosition := wpScreenCenter; + + lblName1 := TfpgLabel.Create(self); + with lblName1 do + begin + Name := 'lblName1'; + SetPosition(8, 8, 196, 16); + FontDesc := '#Label1'; + Text := 'Text Edit'; + end; + + edtText := TfpgEdit.Create(self); + with edtText do + begin + Name := 'edtText'; + SetPosition(24, 28, 120, 22); + TabOrder := 1; + Text := ''; + FontDesc := '#Edit1'; + end; + + lblName2 := TfpgLabel.Create(self); + with lblName2 do + begin + Name := 'lblName2'; + SetPosition(8, 68, 80, 16); + FontDesc := '#Label1'; + Text := 'Integer Edit'; + end; + + lblName3 := TfpgLabel.Create(self); + with lblName3 do + begin + Name := 'lblName3'; + SetPosition(8, 124, 80, 16); + FontDesc := '#Label1'; + Text := 'Float Edit'; + end; + + edtInteger := TfpgEditInteger.Create(self); + with edtInteger do + begin + Name := 'edtInteger'; + SetPosition(24, 88, 120, 22); + end; + + edtFloat := TfpgEditFloat.Create(self); + with edtFloat do + begin + Name := 'edtFloat'; + SetPosition(24, 144, 120, 22); + end; + + btnQuit := TfpgButton.Create(self); + with btnQuit do + begin + Name := 'btnQuit'; + SetPosition(188, 200, 75, 24); + Text := 'Quit'; + FontDesc := '#Label1'; + ImageName := ''; + TabOrder := 6; + OnClick := @btnQuitClicked; + end; + + {@VFD_BODY_END: MainForm} +end; + + +procedure MainProc; +var + frm: TMainForm; +begin + fpgApplication.Initialize; + frm := TMainForm.Create(nil); + try + frm.Show; + fpgApplication.Run; + finally + frm.Free; + end; +end; + +begin + MainProc; +end. + + diff --git a/examples/gui/edits/extrafpc.cfg b/examples/gui/edits/extrafpc.cfg new file mode 100644 index 00000000..073dc4b6 --- /dev/null +++ b/examples/gui/edits/extrafpc.cfg @@ -0,0 +1,5 @@ +-FUunits +-Fu../../../lib +-Xs +-XX +-CX |