summaryrefslogtreecommitdiff
path: root/examples/apps/docedit
diff options
context:
space:
mode:
authorgraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2007-08-14 15:04:05 +0000
committergraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2007-08-14 15:04:05 +0000
commitacc50fa5d7ef195ae5f1746130a7edee646feab7 (patch)
tree35f0d6b51b76727ad0743685aaceeae42b00f20a /examples/apps/docedit
parent856316cb9bdcc51fc9ccd9d0dd0276197e69ad69 (diff)
downloadfpGUI-acc50fa5d7ef195ae5f1746130a7edee646feab7.tar.xz
* Updated a few scripts in the docs directory.
* Minor changes in the style unit. * Added a new examples/apps/docedit project. Once complete it will be a demo application of fpGUI and at the same time show most used widgets in action. DocEdit will become something like lazde is to Lazarus.
Diffstat (limited to 'examples/apps/docedit')
-rw-r--r--examples/apps/docedit/docedit.lpi61
-rw-r--r--examples/apps/docedit/docedit.lpr28
-rw-r--r--examples/apps/docedit/frm_main.pas81
3 files changed, 170 insertions, 0 deletions
diff --git a/examples/apps/docedit/docedit.lpi b/examples/apps/docedit/docedit.lpi
new file mode 100644
index 00000000..059210cb
--- /dev/null
+++ b/examples/apps/docedit/docedit.lpi
@@ -0,0 +1,61 @@
+<?xml version="1.0"?>
+<CONFIG>
+ <ProjectOptions>
+ <PathDelim Value="/"/>
+ <Version Value="5"/>
+ <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="2">
+ <Item1>
+ <PackageName Value="FCL"/>
+ </Item1>
+ <Item2>
+ <PackageName Value="fpgui_package"/>
+ <MinVersion Minor="5" Valid="True"/>
+ </Item2>
+ </RequiredPackages>
+ <Units Count="2">
+ <Unit0>
+ <Filename Value="docedit.lpr"/>
+ <IsPartOfProject Value="True"/>
+ <UnitName Value="docedit"/>
+ </Unit0>
+ <Unit1>
+ <Filename Value="frm_main.pas"/>
+ <IsPartOfProject Value="True"/>
+ <UnitName Value="frm_main"/>
+ </Unit1>
+ </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/apps/docedit/docedit.lpr b/examples/apps/docedit/docedit.lpr
new file mode 100644
index 00000000..cb9978d2
--- /dev/null
+++ b/examples/apps/docedit/docedit.lpr
@@ -0,0 +1,28 @@
+program docedit;
+
+{$mode objfpc}{$H+}
+
+uses
+ {$IFDEF UNIX}{$IFDEF UseCThreads}
+ cthreads,
+ {$ENDIF}{$ENDIF}
+ Classes,
+ fpgfx,
+ frm_main;
+
+
+procedure MainProc;
+var
+ frm: TMainForm;
+begin
+ fpgApplication.Initialize;
+ frm := TMainForm.Create(nil);
+ frm.Show;
+ fpgApplication.Run;
+end;
+
+begin
+ MainProc;
+end.
+
+
diff --git a/examples/apps/docedit/frm_main.pas b/examples/apps/docedit/frm_main.pas
new file mode 100644
index 00000000..cae208bd
--- /dev/null
+++ b/examples/apps/docedit/frm_main.pas
@@ -0,0 +1,81 @@
+unit frm_main;
+
+{$mode objfpc}{$H+}
+
+interface
+
+uses
+ Classes,
+ SysUtils,
+ fpgfx,
+ gui_form,
+ gui_button,
+ gui_edit,
+ gui_label;
+
+type
+ TMainForm = class(TfpgForm)
+ private
+ btnQuit: TfpgButton;
+ lblXMLFile: TfpgLabel;
+ edXMLFile: TfpgEdit;
+ btnOpen: TfpgButton;
+ procedure btnQuitClicked(Sender: TObject);
+ procedure btnOpenClicked(Sender: TObject);
+ procedure InitializeComponents;
+ public
+ constructor Create(AOwner: TComponent); override;
+ end;
+
+
+implementation
+
+{ TMainForm }
+
+procedure TMainForm.btnQuitClicked(Sender: TObject);
+begin
+ Close;
+end;
+
+procedure TMainForm.btnOpenClicked(Sender: TObject);
+begin
+ // open xml file
+end;
+
+procedure TMainForm.InitializeComponents;
+begin
+ btnQuit := CreateButton(self, Width-88, Height-31, 80, 'Quit', @btnQuitClicked);
+ with btnQuit do
+ begin
+ ImageName := 'stdimg.Quit';
+ ShowImage := True;
+ Anchors := [anRight, anBottom];
+ end;
+
+ lblXMLFile := CreateLabel(self, 8, 8, 'XML File:');
+ edXMLFile := CreateEdit(self, lblXMLFile.Right+8, lblXMLFile.Top-2, 485, 23);
+ edXMLFile.Text := '/home/graemeg/programming/fpgui/docs/xml/corelib/gfx_clipboard.xml';
+
+ btnOpen := CreateButton(self, edXMLFile.Right+10, edXMLFile.Top, 80, 'Open', @btnOpenClicked);
+ with btnOpen do
+ begin
+ ImageName := 'stdimg.Open';
+ ShowImage := True;
+ end;
+
+end;
+
+constructor TMainForm.Create(AOwner: TComponent);
+begin
+ inherited Create(AOwner);
+ WindowTitle := 'Documentation Editor';
+ Sizeable := False;
+ // Golden ratio 1.618
+ Width := 650;
+ Height := 402;
+
+ InitializeComponents;
+end;
+
+end.
+