Changeset 72 for trunk/Forms
- Timestamp:
- Dec 13, 2021, 8:47:20 PM (3 years ago)
- Location:
- trunk/Forms
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormContacts.lfm
r61 r72 14 14 object ListView1: TListView 15 15 Left = 0 16 Height = 8 1016 Height = 801 17 17 Top = 0 18 18 Width = 1210 … … 66 66 Left = 0 67 67 Height = 39 68 Top = 8 4268 Top = 833 69 69 Width = 1210 70 70 Align = alBottom … … 114 114 Left = 0 115 115 Height = 32 116 Top = 8 10116 Top = 801 117 117 Width = 1210 118 118 OnChange = ListViewFilter1Change … … 121 121 object StatusBar1: TStatusBar 122 122 Left = 0 123 Height = 27124 Top = 8 81123 Height = 36 124 Top = 872 125 125 Width = 1210 126 126 Panels = < -
trunk/Forms/UFormContacts.pas
r63 r72 473 473 begin 474 474 if FUpdateCount = 0 then DoUpdateInterface; 475 ALoadFromFile.Enabled := Assigned(ListView1.Selected); 476 ASaveToFile.Enabled := Assigned(ListView1.Selected); 477 AModify.Enabled := Assigned(ListView1.Selected); 478 AClone.Enabled := Assigned(ListView1.Selected); 479 ARemove.Enabled := Assigned(ListView1.Selected); 475 AAdd.Enabled := Assigned(Contacts); 476 AModify.Enabled := Assigned(Contacts) and Assigned(ListView1.Selected); 477 AClone.Enabled := Assigned(Contacts) and Assigned(ListView1.Selected); 478 ARemove.Enabled := Assigned(Contacts) and Assigned(ListView1.Selected); 480 479 ASelectAll.Enabled := ListView1.Items.Count > 0; 480 ALoadFromFile.Enabled := Assigned(Contacts) and Assigned(ListView1.Selected); 481 ASaveToFile.Enabled := Assigned(Contacts) and Assigned(ListView1.Selected); 481 482 end; 482 483 -
trunk/Forms/UFormProperties.lfm
r62 r72 74 74 Action = AClone 75 75 end 76 object ToolButton5: TToolButton 77 Left = 141 78 Height = 33 79 Top = 2 80 Style = tbsSeparator 81 end 82 object ToolButton6: TToolButton 83 Left = 149 84 Top = 2 85 Action = ALoadValueFromFile 86 end 87 object ToolButton7: TToolButton 88 Left = 184 89 Top = 2 90 Action = ASaveValueToFile 91 end 76 92 end 77 93 object ListViewFilter1: TListViewFilter … … 112 128 object MenuItem4: TMenuItem 113 129 Action = ASelectAll 130 end 131 object MenuItem6: TMenuItem 132 Caption = '-' 133 end 134 object MenuItem7: TMenuItem 135 Action = ALoadValueFromFile 136 end 137 object MenuItem8: TMenuItem 138 Action = ASaveValueToFile 114 139 end 115 140 end … … 146 171 OnExecute = ACloneExecute 147 172 end 173 object ASaveValueToFile: TAction 174 Caption = 'Save value to file...' 175 ImageIndex = 7 176 OnExecute = ASaveValueToFileExecute 177 end 178 object ALoadValueFromFile: TAction 179 Caption = 'Load value from file...' 180 ImageIndex = 5 181 OnExecute = ALoadValueFromFileExecute 182 end 148 183 end 149 184 object ListViewSort1: TListViewSort … … 157 192 Top = 428 158 193 end 194 object SaveDialog1: TSaveDialog 195 Left = 760 196 Top = 448 197 end 198 object OpenDialog1: TOpenDialog 199 Left = 760 200 Top = 520 201 end 159 202 end -
trunk/Forms/UFormProperties.lrj
r62 r72 8 8 {"hash":93079237,"name":"tformproperties.aremove.caption","sourcebytes":[82,101,109,111,118,101],"value":"Remove"}, 9 9 {"hash":195296268,"name":"tformproperties.aselectall.caption","sourcebytes":[83,101,108,101,99,116,32,97,108,108],"value":"Select all"}, 10 {"hash":4863557,"name":"tformproperties.aclone.caption","sourcebytes":[67,108,111,110,101],"value":"Clone"} 10 {"hash":4863557,"name":"tformproperties.aclone.caption","sourcebytes":[67,108,111,110,101],"value":"Clone"}, 11 {"hash":201478110,"name":"tformproperties.asavevaluetofile.caption","sourcebytes":[83,97,118,101,32,118,97,108,117,101,32,116,111,32,102,105,108,101,46,46,46],"value":"Save value to file..."}, 12 {"hash":231494782,"name":"tformproperties.aloadvaluefromfile.caption","sourcebytes":[76,111,97,100,32,118,97,108,117,101,32,102,114,111,109,32,102,105,108,101,46,46,46],"value":"Load value from file..."} 11 13 ]} -
trunk/Forms/UFormProperties.pas
r54 r72 16 16 AAdd: TAction; 17 17 AClone: TAction; 18 ASaveValueToFile: TAction; 19 ALoadValueFromFile: TAction; 18 20 ASelectAll: TAction; 19 21 ARemove: TAction; … … 28 30 MenuItem4: TMenuItem; 29 31 MenuItem5: TMenuItem; 32 MenuItem6: TMenuItem; 33 MenuItem7: TMenuItem; 34 MenuItem8: TMenuItem; 35 OpenDialog1: TOpenDialog; 30 36 PopupMenuField: TPopupMenu; 37 SaveDialog1: TSaveDialog; 31 38 StatusBar1: TStatusBar; 32 39 ToolBar1: TToolBar; … … 35 42 ToolButton3: TToolButton; 36 43 ToolButton4: TToolButton; 44 ToolButton5: TToolButton; 45 ToolButton6: TToolButton; 46 ToolButton7: TToolButton; 37 47 procedure AAddExecute(Sender: TObject); 38 48 procedure ACloneExecute(Sender: TObject); 49 procedure ALoadValueFromFileExecute(Sender: TObject); 39 50 procedure AModifyExecute(Sender: TObject); 40 51 procedure ARemoveExecute(Sender: TObject); 52 procedure ASaveValueToFileExecute(Sender: TObject); 41 53 procedure ASelectAllExecute(Sender: TObject); 42 54 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); … … 70 82 71 83 uses 72 UFormProperty, UCore ;84 UFormProperty, UCore, UCommon; 73 85 74 86 resourcestring … … 78 90 SFiltered = 'Filtered'; 79 91 SSelected = 'Selected'; 92 SAllFiles = 'All files'; 93 STextFiles = 'Text files'; 94 SValue = 'Value'; 95 96 const 97 TextFileExt = '.txt'; 80 98 81 99 { TFormProperties } … … 247 265 end; 248 266 267 procedure TFormProperties.ALoadValueFromFileExecute(Sender: TObject); 268 begin 269 if Assigned(ListView1.Selected) then begin 270 OpenDialog1.Filter := STextFiles + '|*' + TextFileExt + '|' + SAllFiles + '|*.*'; 271 OpenDialog1.DefaultExt := TextFileExt; 272 OpenDialog1.InitialDir := ExtractFileDir(Core.LastPropertyValueFileName); 273 OpenDialog1.FileName := ExtractFileName(Core.LastPropertyValueFileName); 274 if OpenDialog1.Execute then begin 275 TContactProperty(ListView1.Selected.Data).Value := LoadFileToStr(OpenDialog1.FileName); 276 Core.LastPropertyValueFileName := OpenDialog1.FileName; 277 ReloadList; 278 end; 279 end; 280 end; 281 249 282 procedure TFormProperties.AModifyExecute(Sender: TObject); 250 283 var … … 289 322 end; 290 323 324 procedure TFormProperties.ASaveValueToFileExecute(Sender: TObject); 325 begin 326 if Assigned(ListView1.Selected) then begin 327 SaveDialog1.Filter := STextFiles + '|*' + TextFileExt + '|' + SAllFiles + '|*.*'; 328 SaveDialog1.DefaultExt := TextFileExt; 329 SaveDialog1.InitialDir := ExtractFileDir(Core.LastPropertyValueFileName); 330 SaveDialog1.FileName := SValue + TextFileExt; 331 if SaveDialog1.Execute then begin 332 SaveStringToFile(TContactProperty(ListView1.Selected.Data).Value, SaveDialog1.FileName); 333 Core.LastPropertyValueFileName := SaveDialog1.FileName; 334 end; 335 end; 336 end; 337 291 338 procedure TFormProperties.ASelectAllExecute(Sender: TObject); 292 339 begin … … 324 371 AAdd.Enabled := Assigned(Properties); 325 372 AModify.Enabled := Assigned(Properties) and Assigned(ListView1.Selected); 373 AClone.Enabled := Assigned(Properties) and Assigned(ListView1.Selected);; 326 374 ARemove.Enabled := Assigned(Properties) and Assigned(ListView1.Selected); 375 ALoadValueFromFile.Enabled := Assigned(Properties) and Assigned(ListView1.Selected); 376 ASaveValueToFile.Enabled := Assigned(Properties) and Assigned(ListView1.Selected); 377 ASelectAll.Enabled := ListView1.Items.Count > 0; 327 378 328 379 Text := '';
Note:
See TracChangeset
for help on using the changeset viewer.