Changeset 284 for trunk/Forms/UFormNations.pas
- Timestamp:
- Mar 10, 2019, 6:19:51 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormNations.pas
r283 r284 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls, 9 ActnList, Menus, U GameSystem, UNation;9 ActnList, Menus, UNation; 10 10 11 11 type … … 33 33 ToolButton4: TToolButton; 34 34 procedure AAddExecute(Sender: TObject); 35 procedure ACloneExecute(Sender: TObject); 35 36 procedure AModifyExecute(Sender: TObject); 36 37 procedure ARemoveExecute(Sender: TObject); … … 137 138 end; 138 139 140 procedure TFormNations.ACloneExecute(Sender: TObject); 141 var 142 TempEntry: TNation; 143 begin 144 if Assigned(ListView1.Selected) then 145 with TNation(ListView1.Selected.Data) do begin 146 TempEntry := TNation.Create; 147 TempEntry.Assign(TNation(ListView1.Selected.Data)); 148 FormNation := TFormNation.Create(Self); 149 try 150 TempEntry.Name := Nations.GetNextAvailableName(TempEntry.Name); 151 FormNation.Load(TempEntry); 152 if FormNation.ShowModal = mrOk then begin 153 FormNation.Save(TempEntry); 154 Nations.Add(TempEntry); 155 TempEntry := nil; 156 UpdateList; 157 UpdateInterface; 158 end; 159 finally 160 FreeAndNil(FormNation); 161 end; 162 TempEntry.Free; 163 end; 164 end; 165 139 166 procedure TFormNations.ASelectAllExecute(Sender: TObject); 140 167 var
Note:
See TracChangeset
for help on using the changeset viewer.