Changeset 20 for trunk/Forms
- Timestamp:
- May 4, 2016, 6:50:29 PM (9 years ago)
- Location:
- trunk/Forms
- Files:
-
- 6 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormCategories.lfm
r19 r20 10 10 LCLVersion = '1.6.0.4' 11 11 object ListViewCategories: TListView 12 Left = 1612 Left = 9 13 13 Height = 432 14 14 Top = 8 15 Width = 76 015 Width = 767 16 16 Anchors = [akTop, akLeft, akRight, akBottom] 17 17 Columns = < -
trunk/Forms/UFormCategories.pas
r14 r20 36 36 { private declarations } 37 37 public 38 Categories: TAcronymCategories; 38 39 procedure UpdateList; 39 40 procedure UpdateInterface; … … 53 54 SCategory = 'Category'; 54 55 SCategoryQuery = 'Enter name of category'; 55 SRemoveCategory = 'Remove categor y';56 SRemoveCategoryQuery = 'Do you really want to remove category?';56 SRemoveCategory = 'Remove categories'; 57 SRemoveCategoryQuery = 'Do you really want to remove selected categories?'; 57 58 SCategoryAlreadyExists = 'Category %s already exists!'; 58 59 … … 95 96 96 97 procedure TFormCategories.ARemoveExecute(Sender: TObject); 98 var 99 I: Integer; 97 100 begin 98 101 if Assigned(ListViewCategories.Selected) then begin 99 102 if MessageDlg(SRemoveCategory, SRemoveCategoryQuery, 100 103 TMsgDlgType.mtConfirmation, [mbCancel, mbOk], 0) = mrOk then begin 101 FormMain.AcronymDb.Categories.Remove(ListViewCategories.Selected.Data); 104 for I := ListViewCategories.Items.Count - 1 downto 0 do 105 if ListViewCategories.Items[I].Selected then 106 Categories.Remove(ListViewCategories.Items[I].Data); 102 107 UpdateList; 103 108 end; -
trunk/Forms/UFormMain.lfm
r19 r20 1 1 object FormMain: TFormMain 2 Left = 3932 Left = 427 3 3 Height = 446 4 Top = 4 054 Top = 423 5 5 Width = 631 6 6 Caption = 'Acronym Decoder' … … 4416 4416 OnExecute = AShowAcronymsExecute 4417 4417 end 4418 object AShowImportSources: TAction 4419 Caption = 'Import sources' 4420 OnExecute = AShowImportSourcesExecute 4421 end 4418 4422 end 4419 4423 object PersistentForm1: TPersistentForm … … 4462 4466 Action = AShowCategories 4463 4467 end 4468 object MenuItem4: TMenuItem 4469 Action = AShowImportSources 4470 end 4464 4471 end 4465 4472 object MenuItem16: TMenuItem -
trunk/Forms/UFormMain.lrt
r19 r20 15 15 TFORMMAIN.ASHOWCATEGORIES.CAPTION=Categories 16 16 TFORMMAIN.ASHOWACRONYMS.CAPTION=Acronyms 17 TFORMMAIN.ASHOWIMPORTSOURCES.CAPTION=Import sources 17 18 TFORMMAIN.MENUITEM8.CAPTION=File 18 19 TFORMMAIN.MENUITEMOPENRECENT.CAPTION=Open recent -
trunk/Forms/UFormMain.pas
r19 r20 16 16 17 17 TFormMain = class(TForm) 18 AShowImportSources: TAction; 18 19 AShowAcronyms: TAction; 19 20 AShowCategories: TAction; … … 50 51 MenuItem21: TMenuItem; 51 52 MenuItem22: TMenuItem; 53 MenuItem4: TMenuItem; 52 54 MenuItemOpenRecent: TMenuItem; 53 55 MenuItem2: TMenuItem; … … 71 73 procedure AShowCategoriesExecute(Sender: TObject); 72 74 procedure AShowExecute(Sender: TObject); 75 procedure AShowImportSourcesExecute(Sender: TObject); 73 76 procedure CheckBoxExactMathChange(Sender: TObject); 74 77 procedure EditSearchChange(Sender: TObject); … … 111 114 112 115 uses 113 UFormImport, UFormAcronym, UFormSettings, UFormCategories, UFormAcronyms; 116 UFormImport, UFormAcronym, UFormSettings, UFormCategories, UFormAcronyms, 117 UFormImportSource, UFormImportSources; 114 118 115 119 resourcestring … … 155 159 var 156 160 ModalResult: TModalResult; 157 begin 158 if Assigned(AcronymDb) and AcronymDb.Modified then begin 159 ModalResult := MessageDlg(SAppExit, SAppExitQuery, 160 mtConfirmation, [mbYes, mbNo, mbCancel], 0); 161 if ModalResult = mrYes then begin 162 AFileSave.Execute; 163 FreeAndNil(AcronymDb); 164 UpdateAcronymsList; 165 UpdateInterface; 166 ProjectClosed := True; 167 end 168 else if ModalResult = mrNo then begin 169 FreeAndNil(AcronymDb); 170 UpdateAcronymsList; 171 UpdateInterface; 172 ProjectClosed := True; 173 end else ProjectClosed := False; 174 end else ProjectClosed := True; 161 DoClose: Boolean; 162 begin 163 DoClose := False; 164 if Assigned(AcronymDb) then begin 165 if AcronymDb.Modified then begin 166 ModalResult := MessageDlg(SAppExit, SAppExitQuery, 167 mtConfirmation, [mbYes, mbNo, mbCancel], 0); 168 if ModalResult = mrYes then begin 169 AFileSave.Execute; 170 DoClose := True; 171 end 172 else if ModalResult = mrNo then begin 173 DoClose := True; 174 end else ProjectClosed := False; 175 end else DoClose := True; 176 end; 177 if DoClose then begin 178 FreeAndNil(AcronymDb); 179 UpdateAcronymsList; 180 UpdateInterface; 181 ProjectClosed := True; 182 end; 175 183 end; 176 184 … … 245 253 procedure TFormMain.AShowCategoriesExecute(Sender: TObject); 246 254 begin 255 FormCategories.Categories := AcronymDb.Categories; 247 256 FormCategories.ShowModal; 248 257 UpdateAcronymsList; … … 253 262 begin 254 263 Show; 264 end; 265 266 procedure TFormMain.AShowImportSourcesExecute(Sender: TObject); 267 begin 268 FormImportSources.ImportSources := AcronymDb.ImportSources; 269 FormImportSources.ShowModal; 270 UpdateInterface; 255 271 end; 256 272 … … 418 434 AImport.Enabled := Assigned(AcronymDb); 419 435 AShowCategories.Enabled := Assigned(AcronymDb); 436 AShowAcronyms.Enabled := Assigned(AcronymDb); 437 AShowImportSources.Enabled := Assigned(AcronymDb); 420 438 421 439 Title := Application.Title;
Note:
See TracChangeset
for help on using the changeset viewer.