summaryrefslogtreecommitdiff
path: root/examples/apps/ide/src
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graemeg@gmail.com>2013-03-15 15:05:45 +0000
committerDavid Laurence Emerson <dle3ab@angelbase.com>2013-05-28 00:42:48 -0700
commitdc1859b7e87a08c76d8aaac872f148c1090c7d37 (patch)
treef3c240ba65a83f0513410baa18864fd2752a184c /examples/apps/ide/src
parentcd989d3d12e439bab5c0e648c85a6c338bfc6fc5 (diff)
downloadfpGUI-dc1859b7e87a08c76d8aaac872f148c1090c7d37.tar.xz
ide: Adds template files (units, programs etc)
Soon the IDE will be able to select and process these files correctly.
Diffstat (limited to 'examples/apps/ide/src')
-rw-r--r--examples/apps/ide/src/templates/default/program.pas11
-rw-r--r--examples/apps/ide/src/templates/fpgui/mainform.pas45
-rw-r--r--examples/apps/ide/src/templates/fpgui/program.pas31
-rw-r--r--examples/apps/ide/src/templates/fpgui/program_all_in_one.pas55
-rw-r--r--examples/apps/ide/src/templates/fpgui/simpleform.pas45
-rw-r--r--examples/apps/ide/src/templates/fptest/program.pas30
-rw-r--r--examples/apps/ide/src/templates/fptest/testunit.pas39
7 files changed, 256 insertions, 0 deletions
diff --git a/examples/apps/ide/src/templates/default/program.pas b/examples/apps/ide/src/templates/default/program.pas
new file mode 100644
index 00000000..d901e3ac
--- /dev/null
+++ b/examples/apps/ide/src/templates/default/program.pas
@@ -0,0 +1,11 @@
+program ${PROGRAMNAME};
+
+{$mode objfpc}{$H+}
+
+uses
+ Classes,
+ SysUtils;
+
+begin
+ WriteLn('Hello');
+end.
diff --git a/examples/apps/ide/src/templates/fpgui/mainform.pas b/examples/apps/ide/src/templates/fpgui/mainform.pas
new file mode 100644
index 00000000..6b9500ac
--- /dev/null
+++ b/examples/apps/ide/src/templates/fpgui/mainform.pas
@@ -0,0 +1,45 @@
+unit frm_main;
+
+{$mode objfpc}{$H+}
+
+interface
+
+uses
+ SysUtils,
+ Classes,
+ fpg_base,
+ fpg_main,
+ fpg_form;
+
+type
+
+ TMainForm = class(TfpgForm)
+ private
+ {@VFD_HEAD_BEGIN: MainForm}
+ {@VFD_HEAD_END: MainForm}
+ public
+ procedure AfterCreate; override;
+ end;
+
+{@VFD_NEWFORM_DECL}
+
+implementation
+
+{@VFD_NEWFORM_IMPL}
+
+procedure TMainForm.AfterCreate;
+begin
+ {%region 'Auto-generated GUI code' -fold}
+ {@VFD_BODY_BEGIN: MainForm}
+ Name := 'MainForm';
+ SetPosition(374, 228, 490, 258);
+ WindowTitle := 'MainForm';
+ Hint := '';
+ WindowPosition := wpOneThirdDown;
+
+ {@VFD_BODY_END: MainForm}
+ {%endregion}
+end;
+
+
+end.
diff --git a/examples/apps/ide/src/templates/fpgui/program.pas b/examples/apps/ide/src/templates/fpgui/program.pas
new file mode 100644
index 00000000..7f3f9732
--- /dev/null
+++ b/examples/apps/ide/src/templates/fpgui/program.pas
@@ -0,0 +1,31 @@
+program ${PROGRAMNAME};
+
+{$mode objfpc}{$H+}
+
+uses
+ {$IFDEF UNIX}{$IFDEF UseCThreads}
+ cthreads,
+ {$ENDIF}{$ENDIF}
+ Classes,
+ fpg_main,
+ frm_main;
+
+
+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/apps/ide/src/templates/fpgui/program_all_in_one.pas b/examples/apps/ide/src/templates/fpgui/program_all_in_one.pas
new file mode 100644
index 00000000..0b17ee85
--- /dev/null
+++ b/examples/apps/ide/src/templates/fpgui/program_all_in_one.pas
@@ -0,0 +1,55 @@
+program ${PROJECTNAME};
+
+{$mode objfpc}{$H+}
+
+uses
+ {$IFDEF UNIX}{$IFDEF UseCThreads}
+ cthreads,
+ {$ENDIF}{$ENDIF}
+ Classes, fpg_main, fpg_form;
+
+type
+
+ TMainForm = class(TfpgForm)
+ public
+ {@VFD_HEAD_BEGIN: MainForm}
+ {@VFD_HEAD_END: MainForm}
+ procedure AfterCreate; override;
+ end;
+
+{@VFD_NEWFORM_DECL}
+
+
+
+{@VFD_NEWFORM_IMPL}
+
+procedure TMainForm.AfterCreate;
+begin
+ {@VFD_BODY_BEGIN: MainForm}
+ Name := 'MainForm';
+ SetPosition(316, 186, 300, 250);
+ WindowTitle := 'MainForm';
+
+ {@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/apps/ide/src/templates/fpgui/simpleform.pas b/examples/apps/ide/src/templates/fpgui/simpleform.pas
new file mode 100644
index 00000000..d804f4a3
--- /dev/null
+++ b/examples/apps/ide/src/templates/fpgui/simpleform.pas
@@ -0,0 +1,45 @@
+unit ${UNITNAME};
+
+{$mode objfpc}{$H+}
+
+interface
+
+uses
+ SysUtils,
+ Classes,
+ fpg_base,
+ fpg_main,
+ fpg_form;
+
+type
+
+ T${FORMNAME} = class(TfpgForm)
+ private
+ {@VFD_HEAD_BEGIN: ${FORMNAME}}
+ {@VFD_HEAD_END: ${FORMNAME}}
+ public
+ procedure AfterCreate; override;
+ end;
+
+{@VFD_NEWFORM_DECL}
+
+implementation
+
+{@VFD_NEWFORM_IMPL}
+
+procedure T${FORMNAME}.AfterCreate;
+begin
+ {%region 'Auto-generated GUI code' -fold}
+ {@VFD_BODY_BEGIN: ${FORMNAME}}
+ Name := '${FORMNAME}';
+ SetPosition(374, 228, 490, 258);
+ WindowTitle := 'New Form';
+ Hint := '';
+ WindowPosition := wpOneThirdDown;
+
+ {@VFD_BODY_END: ${FORMNAME}}
+ {%endregion}
+end;
+
+
+end.
diff --git a/examples/apps/ide/src/templates/fptest/program.pas b/examples/apps/ide/src/templates/fptest/program.pas
new file mode 100644
index 00000000..8c4729bc
--- /dev/null
+++ b/examples/apps/ide/src/templates/fptest/program.pas
@@ -0,0 +1,30 @@
+program ${%PROGRAMNAME%};
+
+{$Mode objfpc}{$H+}
+
+
+{$Define TextRunner}
+{.$Define GUIRunner}
+
+
+{$ifdef GuiRunner}
+ {$apptype gui}
+{$endif}
+
+
+uses
+ {$IFDEF TextRunner}
+ TextTestRunner,
+ {$ENDIF}
+ {$IFDEF GUIRunner}
+ GUITestRunner,
+ {$ENDIF}
+ Classes,
+ SampleTests;
+
+begin
+ // Register all tests
+ SampleTests.RegisterTests;
+
+ RunRegisteredTests;
+end.
diff --git a/examples/apps/ide/src/templates/fptest/testunit.pas b/examples/apps/ide/src/templates/fptest/testunit.pas
new file mode 100644
index 00000000..83d2a624
--- /dev/null
+++ b/examples/apps/ide/src/templates/fptest/testunit.pas
@@ -0,0 +1,39 @@
+unit ${UNITNAME};
+
+{$mode objfpc}{$H+}
+
+interface
+
+uses
+ TestFramework;
+
+type
+ TMyTestCase = class(TTestCase)
+ published
+ procedure FirstTest;
+ end;
+
+
+procedure RegisterTests;
+
+
+implementation
+
+//uses
+// SomeUnitToTest;
+
+
+procedure RegisterTests;
+begin
+ TestFramework.RegisterTest(TMyTestCase.Suite);
+end;
+
+{ TMyTestCase }
+
+procedure TMyTestCase.FirstTest;
+begin
+ Check(2, 1+1, 'Failed on 1');
+end;
+
+
+end.