summaryrefslogtreecommitdiff
path: root/extras/code_templates
diff options
context:
space:
mode:
Diffstat (limited to 'extras/code_templates')
-rw-r--r--extras/code_templates/lazarus.dci50
-rw-r--r--extras/code_templates/readme.txt27
2 files changed, 77 insertions, 0 deletions
diff --git a/extras/code_templates/lazarus.dci b/extras/code_templates/lazarus.dci
new file mode 100644
index 00000000..a21c6190
--- /dev/null
+++ b/extras/code_templates/lazarus.dci
@@ -0,0 +1,50 @@
+[fpguiapp | fpGUI template application]
+uses
+ fpGFX, fpGUI;
+
+type
+ TMainForm = class(TForm)
+ private
+ FMainLayout: TBoxLayout;
+ lblTemplate: TLabel;
+ public
+ procedure AfterConstruction; override;
+ end;
+
+
+{ TMainForm }
+
+procedure TMainForm.AfterConstruction;
+begin
+ inherited AfterConstruction;
+ Name := 'MainForm';
+ BorderWidth := 8;
+ Text := 'fpGUI Template Application';
+
+ FMainLayout := TBoxLayout.Create(self);
+ FMainLayout.Spacing := 8;
+ FMainLayout.Orientation := Vertical;
+ FMainLayout.VertAlign := vertFill;
+ InsertChild(FMainLayout);
+
+ lblTemplate := TLabel.Create('MainForm', self);
+ FMainLayout.InsertChild(lblTemplate);
+
+ // Create other components here
+
+end;
+
+
+var
+ MainForm: TMainForm;
+begin
+ GFApplication.Initialize;
+ MainForm := TMainForm.Create(GFApplication);
+ try
+ MainForm.Show;
+ GFApplication.Run;
+ finally
+ MainForm.Free;
+ end;
+end.
+
diff --git a/extras/code_templates/readme.txt b/extras/code_templates/readme.txt
new file mode 100644
index 00000000..ee1f3aab
--- /dev/null
+++ b/extras/code_templates/readme.txt
@@ -0,0 +1,27 @@
+
+fpGUI Code Templates
+--------------------
+
+This is a directory where you will find fpGUI Code Templates for use with
+the Lazarus IDE.
+
+
+1) Open the template you want to add to Lazurus. For example basicapp.txt
+
+2) Open the lazarus.dci file with you favourite editor. This is the file that
+ Lazarus uses to store all code templates. The location of
+ the lararus.dci is normally as follows:
+
+ Linux:
+ /home/<your user name>/.lazarus/lazarus.dci
+
+3) Copy all the text from the template file you opened in (1).
+
+4) Move to the end of the lazarus.dci file you opened in (2) and paste the
+ text from the clipboard.
+
+5) Save the lazarus.dci file and you are ready to go!
+
+
+ -----------.oO0Oo.-----------
+