Changeset 10 for trunk/Forms
- Timestamp:
- Jun 9, 2011, 9:33:21 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:ignore
-
old new 3 3 chronis 4 4 heaptrclog.trc 5 chronis.exe
-
- Property svn:ignore
-
trunk/Forms/ULoginForm.lfm
r7 r10 9 9 ClientHeight = 177 10 10 ClientWidth = 405 11 LCLVersion = '0.9. 29'11 LCLVersion = '0.9.31' 12 12 object Label1: TLabel 13 13 Left = 16 14 14 Height = 14 15 15 Top = 48 16 Width = 6116 Width = 53 17 17 Caption = 'Username:' 18 18 ParentColor = False … … 22 22 Height = 14 23 23 Top = 80 24 Width = 5 724 Width = 51 25 25 Caption = 'Password:' 26 26 ParentColor = False … … 44 44 object Edit1: TEdit 45 45 Left = 88 46 Height = 2 346 Height = 21 47 47 Top = 40 48 48 Width = 104 … … 51 51 object MaskEdit1: TMaskEdit 52 52 Left = 88 53 Height = 2 353 Height = 21 54 54 Top = 71 55 55 Width = 104 -
trunk/Forms/ULoginForm.lrt
r7 r10 1 TLOGINFORM. LOGINFORM.CAPTION=Login1 TLOGINFORM.CAPTION=Login 2 2 TLOGINFORM.LABEL1.CAPTION=Username: 3 3 TLOGINFORM.LABEL2.CAPTION=Password: 4 4 TLOGINFORM.BUTTONCANCEL.CAPTION=Close 5 5 TLOGINFORM.BUTTONLOGIN.CAPTION=Login 6 TLOGINFORM.MASKEDIT1.TEXT=* -
trunk/Forms/UMainForm.lfm
r9 r10 1 1 object MainForm: TMainForm 2 Left = 2 553 Height = 4 454 Top = 755 Width = 64 92 Left = 268 3 Height = 451 4 Top = 156 5 Width = 646 6 6 ActiveControl = Panel1 7 7 Caption = 'ChronIS' 8 ClientHeight = 4 189 ClientWidth = 64 98 ClientHeight = 432 9 ClientWidth = 646 10 10 Menu = MainMenu1 11 11 OnClose = FormClose … … 13 13 OnDestroy = FormDestroy 14 14 OnShow = FormShow 15 LCLVersion = '0.9. 29'15 LCLVersion = '0.9.31' 16 16 object Panel1: TPanel 17 17 Left = 0 18 Height = 4 1818 Height = 432 19 19 Top = 0 20 20 Width = 184 21 21 Align = alLeft 22 22 BevelOuter = bvNone 23 ClientHeight = 4 1823 ClientHeight = 432 24 24 ClientWidth = 184 25 25 TabOrder = 0 26 26 object Label1: TLabel 27 27 Left = 7 28 Height = 1 828 Height = 14 29 29 Top = 4 30 Width = 5130 Width = 39 31 31 Caption = 'Groups:' 32 32 ParentColor = False … … 34 34 object TreeView1: TTreeView 35 35 Left = 4 36 Height = 39436 Height = 408 37 37 Top = 19 38 38 Width = 180 39 39 Anchors = [akTop, akLeft, akRight, akBottom] 40 DefaultItemHeight = 1 940 DefaultItemHeight = 16 41 41 Images = ImageListActions 42 42 ReadOnly = True … … 48 48 object Panel2: TPanel 49 49 Left = 189 50 Height = 4 1850 Height = 432 51 51 Top = 0 52 Width = 4 6052 Width = 457 53 53 Align = alClient 54 54 BevelOuter = bvNone 55 ClientHeight = 4 1856 ClientWidth = 4 6055 ClientHeight = 432 56 ClientWidth = 457 57 57 TabOrder = 1 58 58 object Label2: TLabel 59 59 Left = 2 60 Height = 1 860 Height = 14 61 61 Top = 4 62 Width = 5462 Width = 43 63 63 Caption = 'Reports:' 64 64 ParentColor = False … … 66 66 object ListView1: TListView 67 67 Left = 2 68 Height = 3 6268 Height = 376 69 69 Top = 19 70 Width = 45 670 Width = 453 71 71 Anchors = [akTop, akLeft, akRight, akBottom] 72 72 Columns = <> … … 86 86 Left = 3 87 87 Height = 25 88 Top = 38988 Top = 403 89 89 Width = 75 90 90 Action = AItemAdd … … 95 95 Left = 83 96 96 Height = 25 97 Top = 38997 Top = 403 98 98 Width = 75 99 99 Action = AItemDelete … … 104 104 object Splitter1: TSplitter 105 105 Left = 184 106 Height = 4 18106 Height = 432 107 107 Top = 0 108 108 Width = 5 … … 166 166 OnExecute = AToggleFullscreenExecute 167 167 ShortCut = 122 168 end 169 object AConnect: TAction 170 Caption = 'Connect' 171 Hint = 'Connect' 172 OnExecute = AConnectExecute 173 end 174 object ASettings: TAction 175 Caption = 'Settings' 176 Hint = 'Settings' 177 OnExecute = ASettingsExecute 168 178 end 169 179 end … … 296 306 object MenuItem13: TMenuItem 297 307 Caption = 'Server' 308 object MenuItem17: TMenuItem 309 Action = AConnect 310 end 298 311 object MenuItem14: TMenuItem 299 312 Action = AExit … … 305 318 Action = AToggleFullscreen 306 319 end 320 object MenuItem16: TMenuItem 321 Action = ASettings 322 end 307 323 end 308 324 object MenuItem12: TMenuItem -
trunk/Forms/UMainForm.lrt
r7 r10 1 TMAINFORM. MAINFORM.CAPTION=ChronIS1 TMAINFORM.CAPTION=ChronIS 2 2 TMAINFORM.LABEL1.CAPTION=Groups: 3 3 TMAINFORM.LABEL2.CAPTION=Reports: … … 14 14 TMAINFORM.AEXIT.CAPTION=Exit 15 15 TMAINFORM.ATOGGLEFULLSCREEN.CAPTION=Fullscreen mode 16 TMAINFORM.ACONNECT.CAPTION=Connect 17 TMAINFORM.ACONNECT.HINT=Connect 18 TMAINFORM.ASETTINGS.CAPTION=Settings 19 TMAINFORM.ASETTINGS.HINT=Settings 16 20 TMAINFORM.MENUITEM13.CAPTION=Server 17 21 TMAINFORM.MENUITEM11.CAPTION=View -
trunk/Forms/UMainForm.pas
r9 r10 17 17 18 18 TMainForm = class(TForm) 19 AConnect: TAction; 20 ASettings: TAction; 19 21 AToggleFullscreen: TAction; 20 22 AExit: TAction; … … 44 46 MenuItem14: TMenuItem; 45 47 MenuItem15: TMenuItem; 48 MenuItem16: TMenuItem; 49 MenuItem17: TMenuItem; 46 50 MenuItem2: TMenuItem; 47 51 MenuItem3: TMenuItem; … … 59 63 Splitter1: TSplitter; 60 64 TreeView1: TTreeView; 65 procedure AConnectExecute(Sender: TObject); 61 66 procedure AExitExecute(Sender: TObject); 62 67 procedure AItemAddExecute(Sender: TObject); … … 66 71 procedure AObjectGroupAddGroupExecute(Sender: TObject); 67 72 procedure AObjectGroupEditExecute(Sender: TObject); 73 procedure ASettingsExecute(Sender: TObject); 68 74 procedure AToggleFullscreenExecute(Sender: TObject); 69 75 procedure ButtonAddClick(Sender: TObject); … … 85 91 RegistryKey: string; 86 92 RegistryRootKey: HKEY; 87 procedure LoadConfiguration;88 93 procedure LoadFromRegistry; 89 94 procedure SaveToRegistry; 95 procedure InitStructure; 90 96 public 91 97 SelectedObjectId: Integer; … … 112 118 113 119 uses 114 UItemView, UItemEdit, UItemAdd ;120 UItemView, UItemEdit, UItemAdd, ULoginForm, USettingForm, UApplicationInfo; 115 121 116 122 {$R *.lfm} 117 123 118 124 { TMainForm } 119 120 procedure TMainForm.LoadConfiguration;121 var122 Config: TXMLDocument;123 I1: Integer;124 I2: Integer;125 I3: Integer;126 begin127 if FileExists(ConfigFileName) then try128 ReadXMLFile(Config, ConfigFileName);129 for I1 := 0 to Config.ChildNodes.Count - 1 do130 with Config.ChildNodes[I1] do begin131 if NodeName = 'configuration' then132 for I2 := 0 to ChildNodes.Count - 1 do133 with ChildNodes[I2] do begin134 if NodeName = 'database' then135 for I3 := 0 to ChildNodes.Count - 1 do136 with ChildNodes[I3] do begin137 if NodeName = 'hostname' then138 System.Database.HostName := TextContent;139 if NodeName = 'schema' then140 System.Database.Database := TextContent;141 if NodeName = 'username' then142 System.Database.UserName := TextContent;143 if NodeName = 'password' then144 System.Database.Password := TextContent;145 end;146 end;147 end;148 finally149 Config.Free;150 end;151 end;152 125 153 126 procedure TMainForm.LoadFromRegistry; … … 158 131 OpenKey(RegistryKey, True); 159 132 Panel1.Width := ReadIntegerWithDefault('GroupTreeWidth', 200); 133 System.Database.Database := ReadStringWithDefault('DatabaseSchema', 'chronis'); 134 System.Database.Hostname := ReadStringWithDefault('DatabaseHostName', 'localhost'); 135 System.Database.UserName := ReadStringWithDefault('DatabaseUserName', 'chronis'); 136 System.Database.Password := ReadStringWithDefault('DatabasePassword', ''); 160 137 finally 161 138 Free; … … 170 147 OpenKey(RegistryKey, True); 171 148 WriteInteger('GroupTreeWidth', Panel1.Width); 149 WriteString('DatabaseSchema', System.Database.Database); 150 WriteString('DatabaseHostName', System.Database.Hostname); 151 WriteString('DatabaseUserName', System.Database.UserName); 152 WriteString('DatabasePassword', System.Database.Password); 172 153 finally 173 154 Free; … … 175 156 end; 176 157 158 procedure TMainForm.InitStructure; 159 begin 160 161 end; 162 177 163 procedure TMainForm.FormCreate(Sender: TObject); 178 164 begin 179 165 System := TChronisBase.Create; 180 166 System.Database := TSqlDatabase.Create; 181 LoadConfiguration;182 System.Database.Connect;183 167 TreeState := TTreeState.Create; 184 168 Report := TReport.Create; … … 187 171 SelectedObject.Base := System; 188 172 RegistryRootKey := HKEY_CURRENT_USER; 189 RegistryKey := '\Software\Chronosoft\Chronis'; 173 RegistryKey := '\Software\' + ApplicationInfo.CompanyName + '\' + 174 ApplicationInfo.Name; 190 175 PersistentForm := TPersistentForm.Create; 191 176 PersistentForm.RegistryKey := RegistryKey; … … 237 222 ItemEditForm.Show; 238 223 end; 224 end; 225 226 procedure TMainForm.ASettingsExecute(Sender: TObject); 227 begin 228 SettingForm.ShowModal; 239 229 end; 240 230 … … 281 271 end; 282 272 273 procedure TMainForm.AConnectExecute(Sender: TObject); 274 begin 275 LoginForm.ShowModal; 276 end; 277 283 278 procedure TMainForm.FormShow(Sender: TObject); 284 279 begin 285 280 PersistentForm.Load(Self); 281 LoadFromRegistry; 282 System.Database.Connect; 283 InitStructure; 286 284 LoadTree; 287 LoadFromRegistry;288 285 end; 289 286
Note:
See TracChangeset
for help on using the changeset viewer.