Changeset 27 for trunk/Forms
- Timestamp:
- Jun 7, 2016, 3:56:46 PM (9 years ago)
- Location:
- trunk/Forms
- Files:
-
- 3 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormAcronyms.lfm
r22 r27 11 11 object ListViewAcronyms: TListView 12 12 Left = 8 13 Height = 51013 Height = 480 14 14 Top = 40 15 15 Width = 725 … … 47 47 OnChange = ListViewFilter1Change 48 48 Anchors = [akTop, akLeft, akRight] 49 end 50 object StatusBar1: TStatusBar 51 Left = 0 52 Height = 28 53 Top = 530 54 Width = 740 55 Panels = < 56 item 57 Width = 100 58 end 59 item 60 Width = 100 61 end> 62 SimplePanel = False 49 63 end 50 64 object ListViewSort1: TListViewSort -
trunk/Forms/UFormAcronyms.pas
r22 r27 27 27 MenuItem7: TMenuItem; 28 28 PopupMenuAcronym: TPopupMenu; 29 StatusBar1: TStatusBar; 29 30 procedure AAddExecute(Sender: TObject); 30 31 procedure AModifyExecute(Sender: TObject); … … 41 42 procedure ListViewSort1Filter(ListViewSort: TListViewSort); 42 43 private 44 MeaningCount: Integer; 43 45 procedure FilterList(List: TListObject); 44 46 procedure UpdateAcronymsList; … … 211 213 FormMain.AcronymDb.Acronyms.Sort(AcronymComparer); 212 214 FormMain.AcronymDb.AssignToList(ListViewSort1.List); 215 MeaningCount := ListViewSort1.List.Count; 213 216 FilterList(ListViewSort1.List); 214 217 end; … … 247 250 ListViewSort1.Refresh; 248 251 UpdateInterface; 252 StatusBar1.Panels[0].Text := 'Total: ' + IntToStr(MeaningCount); 253 StatusBar1.Panels[1].Text := 'Filtered: ' + IntToStr(ListViewAcronyms.Items.Count); 249 254 end; 250 255 -
trunk/Forms/UFormImportFormat.lfm
r25 r27 7 7 ClientHeight = 433 8 8 ClientWidth = 664 9 LCLVersion = '1.7' 9 OnShow = FormShow 10 LCLVersion = '1.6.0.4' 10 11 object ButtonOk: TButton 11 12 Left = 560 … … 13 14 Top = 384 14 15 Width = 75 16 Anchors = [akRight, akBottom] 15 17 Caption = 'Ok' 16 18 ModalResult = 1 … … 22 24 Top = 384 23 25 Width = 75 26 Anchors = [akRight, akBottom] 24 27 Caption = 'Cancel' 25 28 ModalResult = 2 … … 28 31 object Label1: TLabel 29 32 Left = 20 30 Height = 2 233 Height = 20 31 34 Top = 16 32 Width = 4 935 Width = 43 33 36 Caption = 'Name:' 34 37 ParentColor = False … … 36 39 object EditName: TEdit 37 40 Left = 179 38 Height = 3241 Height = 28 39 42 Top = 11 40 43 Width = 461 … … 42 45 TabOrder = 2 43 46 end 44 object Label 2: TLabel47 object Label8: TLabel 45 48 Left = 20 46 Height = 22 47 Top = 133 48 Width = 112 49 Caption = 'Acronym start:' 50 ParentColor = False 51 end 52 object EditAcronymStart: TEdit 53 Left = 179 54 Height = 32 55 Top = 128 56 Width = 461 57 Anchors = [akTop, akLeft, akRight] 58 TabOrder = 3 59 end 60 object Label3: TLabel 61 Left = 20 62 Height = 22 63 Top = 173 64 Width = 105 65 Caption = 'Acronym end:' 66 ParentColor = False 67 end 68 object EditAcronymEnd: TEdit 69 Left = 179 70 Height = 32 71 Top = 168 72 Width = 461 73 Anchors = [akTop, akLeft, akRight] 74 TabOrder = 4 75 end 76 object Label4: TLabel 77 Left = 20 78 Height = 22 79 Top = 213 80 Width = 111 81 Caption = 'Meaning start:' 82 ParentColor = False 83 end 84 object EditMeaningStart: TEdit 85 Left = 179 86 Height = 32 87 Top = 208 88 Width = 461 89 Anchors = [akTop, akLeft, akRight] 90 TabOrder = 5 91 end 92 object Label5: TLabel 93 Left = 20 94 Height = 22 95 Top = 253 96 Width = 104 97 Caption = 'Meaning end:' 98 ParentColor = False 99 end 100 object EditMeaningEnd: TEdit 101 Left = 179 102 Height = 32 103 Top = 248 104 Width = 461 105 Anchors = [akTop, akLeft, akRight] 106 TabOrder = 6 107 end 108 object Label6: TLabel 109 Left = 20 110 Height = 22 111 Top = 293 112 Width = 132 113 Caption = 'Description start:' 114 ParentColor = False 115 end 116 object EditDescriptionStart: TEdit 117 Left = 179 118 Height = 32 119 Top = 288 120 Width = 461 121 Anchors = [akTop, akLeft, akRight] 122 TabOrder = 7 123 end 124 object Label7: TLabel 125 Left = 20 126 Height = 22 127 Top = 333 128 Width = 125 129 Caption = 'Description end:' 130 ParentColor = False 131 end 132 object EditDescriptionEnd: TEdit 133 Left = 179 134 Height = 32 135 Top = 328 136 Width = 461 137 Anchors = [akTop, akLeft, akRight] 138 TabOrder = 8 139 end 140 object Label8: TLabel 141 Left = 24 142 Height = 22 49 Height = 20 143 50 Top = 53 144 Width = 8551 Width = 72 145 52 Caption = 'Block start:' 146 53 ParentColor = False … … 148 55 object EditBlockStart: TEdit 149 56 Left = 179 150 Height = 3257 Height = 28 151 58 Top = 48 152 59 Width = 461 153 60 Anchors = [akTop, akLeft, akRight] 154 TabOrder = 961 TabOrder = 3 155 62 end 156 63 object Label9: TLabel 157 Left = 2 4158 Height = 2 264 Left = 20 65 Height = 20 159 66 Top = 93 160 Width = 7867 Width = 68 161 68 Caption = 'Block end:' 162 69 ParentColor = False … … 164 71 object EditBlockEnd: TEdit 165 72 Left = 179 166 Height = 3273 Height = 28 167 74 Top = 88 168 75 Width = 461 169 76 Anchors = [akTop, akLeft, akRight] 170 TabOrder = 10 77 TabOrder = 4 78 end 79 object ListViewItemRules: TListView 80 Left = 20 81 Height = 230 82 Top = 144 83 Width = 620 84 Anchors = [akTop, akLeft, akRight, akBottom] 85 Columns = < 86 item 87 Caption = 'Start string' 88 Width = 100 89 end 90 item 91 Caption = 'End string' 92 Width = 100 93 end 94 item 95 Caption = 'Action' 96 Width = 100 97 end 98 item 99 Caption = 'Variable' 100 Width = 100 101 end> 102 OwnerData = True 103 PopupMenu = PopupMenu1 104 ReadOnly = True 105 RowSelect = True 106 TabOrder = 5 107 ViewStyle = vsReport 108 OnData = ListViewItemRulesData 109 OnDblClick = AModifyExecute 110 end 111 object Label2: TLabel 112 Left = 20 113 Height = 20 114 Top = 120 115 Width = 68 116 Caption = 'Item rules:' 117 ParentColor = False 118 end 119 object PopupMenu1: TPopupMenu 120 Images = FormMain.ImageList1 121 left = 181 122 top = 240 123 object MenuItem1: TMenuItem 124 Action = AAdd 125 end 126 object MenuItem2: TMenuItem 127 Action = AModify 128 end 129 object MenuItem3: TMenuItem 130 Action = ARemove 131 end 132 object MenuItem4: TMenuItem 133 Action = AMoveUp 134 end 135 object MenuItem5: TMenuItem 136 Action = AMoveDown 137 end 138 end 139 object ActionList1: TActionList 140 Images = FormMain.ImageList1 141 left = 383 142 top = 245 143 object AAdd: TAction 144 Caption = 'Add' 145 OnExecute = AAddExecute 146 ShortCut = 45 147 end 148 object AModify: TAction 149 Caption = 'Modify' 150 OnExecute = AModifyExecute 151 ShortCut = 13 152 end 153 object ARemove: TAction 154 Caption = 'Remove' 155 OnExecute = ARemoveExecute 156 ShortCut = 46 157 end 158 object AMoveUp: TAction 159 Caption = 'Move up' 160 OnExecute = AMoveUpExecute 161 end 162 object AMoveDown: TAction 163 Caption = 'Move down' 164 OnExecute = AMoveDownExecute 165 end 171 166 end 172 167 end -
trunk/Forms/UFormImportFormat.lrt
r25 r27 3 3 TFORMIMPORTFORMAT.BUTTONCANCEL.CAPTION=Cancel 4 4 TFORMIMPORTFORMAT.LABEL1.CAPTION=Name: 5 TFORMIMPORTFORMAT.LABEL2.CAPTION=Acronym start:6 TFORMIMPORTFORMAT.LABEL3.CAPTION=Acronym end:7 TFORMIMPORTFORMAT.LABEL4.CAPTION=Meaning start:8 TFORMIMPORTFORMAT.LABEL5.CAPTION=Meaning end:9 TFORMIMPORTFORMAT.LABEL6.CAPTION=Description start:10 TFORMIMPORTFORMAT.LABEL7.CAPTION=Description end:11 5 TFORMIMPORTFORMAT.LABEL8.CAPTION=Block start: 12 6 TFORMIMPORTFORMAT.LABEL9.CAPTION=Block end: 7 TFORMIMPORTFORMAT.LISTVIEWITEMRULES.COLUMNS[0].CAPTION=Start string 8 TFORMIMPORTFORMAT.LISTVIEWITEMRULES.COLUMNS[1].CAPTION=End string 9 TFORMIMPORTFORMAT.LISTVIEWITEMRULES.COLUMNS[2].CAPTION=Action 10 TFORMIMPORTFORMAT.LISTVIEWITEMRULES.COLUMNS[3].CAPTION=Variable 11 TFORMIMPORTFORMAT.LABEL2.CAPTION=Item rules: 12 TFORMIMPORTFORMAT.AADD.CAPTION=Add 13 TFORMIMPORTFORMAT.AMODIFY.CAPTION=Modify 14 TFORMIMPORTFORMAT.AREMOVE.CAPTION=Remove 15 TFORMIMPORTFORMAT.AMOVEUP.CAPTION=Move up 16 TFORMIMPORTFORMAT.AMOVEDOWN.CAPTION=Move down -
trunk/Forms/UFormImportFormat.pas
r25 r27 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, 9 UAcronym;9 ComCtrls, Menus, ActnList, UAcronym; 10 10 11 11 type … … 14 14 15 15 TFormImportFormat = class(TForm) 16 AAdd: TAction; 17 AMoveUp: TAction; 18 AMoveDown: TAction; 19 AModify: TAction; 20 ARemove: TAction; 21 ActionList1: TActionList; 16 22 ButtonOk: TButton; 17 23 ButtonCancel: TButton; … … 19 25 EditBlockStart: TEdit; 20 26 EditName: TEdit; 21 EditAcronymStart: TEdit;22 EditAcronymEnd: TEdit;23 EditMeaningStart: TEdit;24 EditMeaningEnd: TEdit;25 EditDescriptionStart: TEdit;26 EditDescriptionEnd: TEdit;27 27 Label1: TLabel; 28 28 Label2: TLabel; 29 Label3: TLabel;30 Label4: TLabel;31 Label5: TLabel;32 Label6: TLabel;33 Label7: TLabel;34 29 Label8: TLabel; 35 30 Label9: TLabel; 31 ListViewItemRules: TListView; 32 MenuItem1: TMenuItem; 33 MenuItem2: TMenuItem; 34 MenuItem3: TMenuItem; 35 MenuItem4: TMenuItem; 36 MenuItem5: TMenuItem; 37 PopupMenu1: TPopupMenu; 38 procedure AAddExecute(Sender: TObject); 39 procedure AModifyExecute(Sender: TObject); 40 procedure AMoveDownExecute(Sender: TObject); 41 procedure AMoveUpExecute(Sender: TObject); 42 procedure ARemoveExecute(Sender: TObject); 43 procedure FormShow(Sender: TObject); 44 procedure ListViewItemRulesData(Sender: TObject; Item: TListItem); 36 45 private 37 46 { private declarations } 38 47 public 48 ImportFormat: TImportFormat; 39 49 procedure Load(ImportFormat: TImportFormat); 40 50 procedure Save(ImportFormat: TImportFormat); 51 procedure ReloadList; 41 52 end; 42 53 … … 44 55 FormImportFormat: TFormImportFormat; 45 56 57 46 58 implementation 59 60 uses 61 UFormImportPattern; 47 62 48 63 {$R *.lfm} 49 64 65 resourcestring 66 SRemoveImportPattern = 'Remove import pattern'; 67 SRemoveImportPatternQuery = 'Do you really want to remove selected import patterns?'; 68 69 50 70 { TFormImportFormat } 71 72 procedure TFormImportFormat.AAddExecute(Sender: TObject); 73 var 74 NewImportPattern: TImportPattern; 75 begin 76 NewImportPattern := TImportPattern.Create; 77 FormImportPattern.Load(NewImportPattern); 78 if FormImportPattern.ShowModal = mrOk then begin 79 FormImportPattern.Save(NewImportPattern); 80 ImportFormat.ItemPatterns.Add(NewImportPattern); 81 NewImportPattern := nil; 82 ReloadList; 83 end; 84 if Assigned(NewImportPattern) then NewImportPattern.Free; 85 end; 86 87 procedure TFormImportFormat.AModifyExecute(Sender: TObject); 88 var 89 NewImportPattern: TImportPattern; 90 begin 91 if Assigned(ListViewItemRules.Selected) then begin 92 NewImportPattern := TImportPattern.Create; 93 NewImportPattern.Assign(ListViewItemRules.Selected.Data); 94 FormImportPattern.Load(NewImportPattern); 95 if FormImportPattern.ShowModal = mrOk then begin 96 FormImportPattern.Save(NewImportPattern); 97 TImportPattern(ListViewItemRules.Selected.Data).Assign(NewImportPattern); 98 ReloadList; 99 end; 100 if Assigned(NewImportPattern) then NewImportPattern.Free; 101 end; 102 end; 103 104 procedure TFormImportFormat.AMoveDownExecute(Sender: TObject); 105 begin 106 if ListViewItemRules.Selected.Index < (ImportFormat.ItemPatterns.Count - 1) then 107 with ImportFormat do 108 ItemPatterns.Exchange(ListViewItemRules.Selected.Index, 109 ListViewItemRules.Selected.Index + 1); 110 ReloadList; 111 end; 112 113 procedure TFormImportFormat.AMoveUpExecute(Sender: TObject); 114 begin 115 if ListViewItemRules.Selected.Index > 0 then 116 with ImportFormat do 117 ItemPatterns.Exchange(ListViewItemRules.Selected.Index, 118 ListViewItemRules.Selected.Index - 1); 119 ReloadList; 120 end; 121 122 procedure TFormImportFormat.ARemoveExecute(Sender: TObject); 123 var 124 I: Integer; 125 begin 126 if Assigned(ListViewItemRules.Selected) then begin 127 if MessageDlg(SRemoveImportPattern, SRemoveImportPatternQuery, 128 TMsgDlgType.mtConfirmation, [mbCancel, mbOk], 0) = mrOk then begin 129 for I := ListViewItemRules.Items.Count - 1 downto 0 do 130 if ListViewItemRules.Items[I].Selected then 131 ImportFormat.ItemPatterns.Remove(ListViewItemRules.Items[I].Data); 132 ReloadList; 133 end; 134 end; 135 end; 136 137 procedure TFormImportFormat.FormShow(Sender: TObject); 138 begin 139 ReloadList; 140 end; 141 142 procedure TFormImportFormat.ListViewItemRulesData(Sender: TObject; 143 Item: TListItem); 144 begin 145 if Item.Index < ImportFormat.ItemPatterns.Count then 146 with TImportPattern(ImportFormat.ItemPatterns[Item.Index]) do begin 147 Item.Caption := StartString; 148 Item.SubItems.Add(EndString); 149 Item.SubItems.Add(ImportPatternFlagString[Flag]); 150 Item.SubItems.Add(ImportVariableString[Variable]); 151 Item.Data := ImportFormat.ItemPatterns[Item.Index]; 152 end; 153 end; 51 154 52 155 procedure TFormImportFormat.Load(ImportFormat: TImportFormat); 53 156 begin 157 Self.ImportFormat := ImportFormat; 54 158 EditName.Text := ImportFormat.Name; 55 159 EditBlockStart.Text := ImportFormat.Block.StartString; 56 160 EditBlockEnd.Text := ImportFormat.Block.EndString; 57 EditAcronymStart.Text := ImportFormat.Acronym.StartString; 58 EditAcronymEnd.Text := ImportFormat.Acronym.EndString; 59 EditMeaningStart.Text := ImportFormat.Meaning.StartString; 60 EditMeaningEnd.Text := ImportFormat.Meaning.EndString; 61 EditDescriptionStart.Text := ImportFormat.Description.StartString; 62 EditDescriptionEnd.Text := ImportFormat.Description.EndString; 161 ReloadList; 63 162 end; 64 163 … … 68 167 ImportFormat.Block.StartString := EditBlockStart.Text; 69 168 ImportFormat.Block.EndString := EditBlockEnd.Text; 70 ImportFormat.Acronym.StartString := EditAcronymStart.Text;71 ImportFormat.Acronym.EndString := EditAcronymEnd.Text; 72 ImportFormat.Meaning.StartString := EditMeaningStart.Text;73 ImportFormat.Meaning.EndString := EditMeaningEnd.Text; 74 ImportFormat.Description.StartString := EditDescriptionStart.Text;75 ImportFormat.Description.EndString := EditDescriptionEnd.Text;169 end; 170 171 procedure TFormImportFormat.ReloadList; 172 begin 173 ListViewItemRules.Items.Count := ImportFormat.ItemPatterns.Count; 174 ListViewItemRules.Refresh; 76 175 end; 77 176 -
trunk/Forms/UFormMain.lfm
r22 r27 5 5 Width = 631 6 6 Caption = 'Acronym Decoder' 7 ClientHeight = 4 147 ClientHeight = 421 8 8 ClientWidth = 631 9 9 Menu = MainMenu1 … … 16 16 object ListViewAcronyms: TListView 17 17 Left = 8 18 Height = 3 3318 Height = 340 19 19 Top = 64 20 20 Width = 613 … … 51 51 object CheckBoxExactMath: TCheckBox 52 52 Left = 8 53 Height = 2 853 Height = 24 54 54 Top = 3 55 Width = 1 2955 Width = 104 56 56 Caption = 'Exact match' 57 57 OnChange = CheckBoxExactMathChange -
trunk/Forms/UFormMain.pas
r26 r27 274 274 begin 275 275 FormAcronyms.ShowModal; 276 UpdateInterface; 276 277 end; 277 278
Note:
See TracChangeset
for help on using the changeset viewer.