Changeset 64 for trunk/Forms/UFormMain.pas
- Timestamp:
- Jul 26, 2016, 5:48:35 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormMain.pas
r63 r64 119 119 procedure TrayIcon1Click(Sender: TObject); 120 120 private 121 Initialized: Boolean; 121 122 FAlwaysOnTop: Boolean; 122 123 RegistryContext: TRegistryContext; 123 124 ProjectClosed: Boolean; 124 125 ImportTotalItemCount: Integer; 126 procedure Initialize; 125 127 procedure ProcessImportsJob(Job: TJob); 126 128 procedure SetAlwaysOnTop(AValue: Boolean); … … 166 168 167 169 procedure TFormMain.FormCreate(Sender: TObject); 170 var 171 I: Integer; 168 172 begin 169 173 AcronymDb := TAcronymDb.Create; 174 Initialized := False; 175 for I := 0 to ToolBar1.ButtonCount - 1 do 176 ToolBar1.Buttons[I].Hint := ToolBar1.Buttons[I].Caption; 170 177 end; 171 178 … … 362 369 363 370 procedure TFormMain.FormShow(Sender: TObject); 364 var 365 I: Integer; 366 begin 367 LoadConfig; 371 begin 372 Initialize; 373 368 374 PersistentForm1.Load(Self); 369 370 if ParamCount > 0 then begin 371 AcronymDB.LoadFromFile(ParamStr(1)); 372 LastOpenedList1.AddItem(OpenDialog1.FileName); 373 end else 374 if (LastOpenedList1.Items.Count > 0) and FileExists(LastOpenedList1.Items[0]) then 375 AcronymDB.LoadFromFile(LastOpenedList1.Items[0]); 376 UpdateAcronymsList; 377 ListViewFilter1.UpdateFromListView(ListViewAcronyms); 378 UpdateInterface; 379 for I := 0 to ToolBar1.ButtonCount - 1 do 380 ToolBar1.Buttons[I].Hint := ToolBar1.Buttons[I].Caption; 375 UpdateInterface; 381 376 end; 382 377 … … 444 439 Visible := not Visible; 445 440 if Visible then BringToFront; 441 end; 442 443 procedure TFormMain.Initialize; 444 begin 445 if not Initialized then begin 446 Initialized := True; 447 LoadConfig; 448 449 if ParamCount > 0 then begin 450 AcronymDB.LoadFromFile(ParamStr(1)); 451 LastOpenedList1.AddItem(OpenDialog1.FileName); 452 end else 453 if (LastOpenedList1.Items.Count > 0) and FileExists(LastOpenedList1.Items[0]) then 454 AcronymDB.LoadFromFile(LastOpenedList1.Items[0]); 455 UpdateAcronymsList; 456 ListViewFilter1.UpdateFromListView(ListViewAcronyms); 457 end; 446 458 end; 447 459
Note:
See TracChangeset
for help on using the changeset viewer.