summaryrefslogtreecommitdiff
path: root/uidesigner/uidesigner.lpr
blob: 17d54a244169cab52f1dd212cbcfa8be09438311 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
{
    fpGUI  -  Free Pascal GUI Library

    Copyright (C) 2006 - 2014 See the file AUTHORS.txt, included in this
    distribution, for details of the copyright.

    See the file COPYING.modifiedLGPL, included in this distribution,
    for details about redistributing fpGUI.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

    Description:
      The starting unit for the UI Designer project.
}

program uidesigner;

{$mode objfpc}{$H+}

uses
  {$IFDEF UNIX}{$IFDEF UseCThreads}
  cthreads,
  {$ENDIF}{$ENDIF}
  Classes,
  SysUtils,
  fpg_base,
  fpg_main,
  fpg_utils,
  vfdmain,
  vfdresizer,
  vfdforms,
  vfdfile,
  newformdesigner,
  vfdwidgets,
  vfdformparser,
  vfdeditors,
  vfdwidgetclass,
  vfdutils,
  vfdprops,
  vfddesigner,
  vfdpropeditgrid,
  vfd_constants;


procedure MainProc;
begin
  fpgApplication.Initialize;
  try
    RegisterWidgets;
    PropList := TPropertyList.Create;
    maindsgn := TMainDesigner.Create;
    maindsgn.CreateWindows;

    // Making sure the correct form is set as the MainForm
    fpgApplication.MainForm := frmMain;

    { If a file is passed in as a parameter, then load it }
    maindsgn.EditedFileName := ParamStr(1);
    if fpgFileExists(maindsgn.EditedFileName) then
      maindsgn.OnLoadFile(maindsgn);

    fpgApplication.Run;
    
    PropList.Free;
    
  finally
    maindsgn.Free;
  end;
end;

begin
  MainProc;
end.