source: trunk/Forms/UFormMain.pas

Last change on this file was 13, checked in by chronos, 9 years ago
  • Added: New test form where general functionality of selected backend can be tested.
  • Added: Basic git backend implementation.
  • Added: Project group form and ability to open/save group of projects as configuration to XML file.
File size: 3.0 KB
Line 
1unit UFormMain;
2
3{$mode delphi}{$H+}
4
5interface
6
7uses
8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls,
9 Menus, ActnList, ExtCtrls;
10
11type
12
13 { TFormMain }
14
15 TFormMain = class(TForm)
16 MainMenu1: TMainMenu;
17 MenuItem1: TMenuItem;
18 MenuItem10: TMenuItem;
19 MenuItem11: TMenuItem;
20 MenuItem12: TMenuItem;
21 MenuItem13: TMenuItem;
22 MenuItem14: TMenuItem;
23 MenuItem15: TMenuItem;
24 MenuItem16: TMenuItem;
25 MenuItem17: TMenuItem;
26 MenuItem18: TMenuItem;
27 MenuItem19: TMenuItem;
28 MenuItem20: TMenuItem;
29 MenuItem21: TMenuItem;
30 MenuItemRecentProjectGroup: TMenuItem;
31 MenuItem23: TMenuItem;
32 MenuItem24: TMenuItem;
33 MenuItem25: TMenuItem;
34 MenuItemOpenRecent: TMenuItem;
35 MenuItem2: TMenuItem;
36 MenuItem3: TMenuItem;
37 MenuItem4: TMenuItem;
38 MenuItem5: TMenuItem;
39 MenuItem6: TMenuItem;
40 MenuItem7: TMenuItem;
41 MenuItem8: TMenuItem;
42 MenuItem9: TMenuItem;
43 MenuItemQuit: TMenuItem;
44 MenuItemFile: TMenuItem;
45 StatusBar1: TStatusBar;
46 ToolBarMain: TToolBar;
47 ToolButton1: TToolButton;
48 ToolButton2: TToolButton;
49 ToolButton3: TToolButton;
50 procedure FormActivate(Sender: TObject);
51 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
52 procedure FormShow(Sender: TObject);
53 private
54 Initialized: Boolean;
55 public
56 procedure ProjectGroupOpenRecentExecute(Sender: TObject);
57 procedure OpenRecentExecute(Sender: TObject);
58 procedure UpdateInterface;
59 procedure DockInit;
60 end;
61
62var
63 FormMain: TFormMain;
64
65implementation
66
67{$R *.lfm}
68
69uses
70 UCore, UFormBrowse, UFormProjectGroup;
71
72{ TFormMain }
73
74procedure TFormMain.FormShow(Sender: TObject);
75begin
76 DockInit;
77end;
78
79procedure TFormMain.OpenRecentExecute(Sender: TObject);
80begin
81 Core.ProjectOpen(Core.LastOpenedListProject.Items[TMenuItem(Sender).MenuIndex]);
82end;
83
84procedure TFormMain.ProjectGroupOpenRecentExecute(Sender: TObject);
85begin
86 Core.ProjectGroupOpen(Core.LastOpenedListProjectGroup.Items[TMenuItem(Sender).MenuIndex]);
87end;
88
89procedure TFormMain.FormActivate(Sender: TObject);
90begin
91 if not Initialized then begin
92 Initialized := True;
93 Core.Init;
94 end;
95end;
96
97procedure TFormMain.FormClose(Sender: TObject; var CloseAction: TCloseAction);
98begin
99 Core.Done;
100end;
101
102procedure TFormMain.UpdateInterface;
103const
104 AppName = 'VCSCommander';
105var
106 NewCaption: string;
107begin
108 NewCaption := '';
109 if Assigned(Core.Project) then
110 NewCaption := Core.Project.Directory + ' (' + Core.Project.Backend.Name + ') - ';
111 NewCaption := NewCaption + AppName;
112 Caption := NewCaption;
113end;
114
115procedure TFormMain.DockInit;
116var
117 NewSplitter: TSplitter;
118begin
119 FormProjectGroup.ManualDock(Self, nil, alLeft);
120 FormProjectGroup.Align := alLeft;
121 FormProjectGroup.Show;
122 NewSplitter := TSplitter.Create(nil);
123 NewSplitter.ManualDock(Self, nil, alLeft);
124 NewSplitter.Align := alLeft;
125 NewSplitter.Left := FormProjectGroup.Width;
126 NewSplitter.Show;
127 FormBrowse.ManualDock(Self, nil, alClient);
128 FormBrowse.Align := alClient;
129 FormBrowse.Show;
130end;
131
132end.
133
Note: See TracBrowser for help on using the repository browser.