Changeset 113 for branches/generator/Forms/UFormRule.pas
- Timestamp:
- Aug 9, 2017, 10:14:31 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/generator/Forms/UFormRule.pas
r112 r113 15 15 TFormRule = class(TForm) 16 16 AAdd: TAction; 17 AMoveUp: TAction; 18 AMoveDown: TAction; 17 19 AModify: TAction; 18 20 ARemove: TAction; … … 28 30 MenuItem2: TMenuItem; 29 31 MenuItem3: TMenuItem; 32 MenuItem4: TMenuItem; 33 MenuItem5: TMenuItem; 30 34 PopupMenu1: TPopupMenu; 31 35 ToolBar1: TToolBar; … … 33 37 ToolButton2: TToolButton; 34 38 ToolButton3: TToolButton; 39 ToolButton4: TToolButton; 40 ToolButton5: TToolButton; 35 41 procedure AAddExecute(Sender: TObject); 36 42 procedure AModifyExecute(Sender: TObject); 43 procedure AMoveDownExecute(Sender: TObject); 44 procedure AMoveUpExecute(Sender: TObject); 37 45 procedure ARemoveExecute(Sender: TObject); 38 46 procedure FormShow(Sender: TObject); … … 123 131 end; 124 132 133 procedure TFormRule.AMoveDownExecute(Sender: TObject); 134 begin 135 Rule.Items.Move(ListView.Selected.Index, ListView.Selected.Index + 1); 136 // ShowMessage(IntToStr(ListView.ItemIndex)); 137 ListView.ItemIndex := ListView.Selected.Index + 1; 138 // ShowMessage(IntToStr(ListView.ItemIndex)); 139 ReloadList; 140 end; 141 142 procedure TFormRule.AMoveUpExecute(Sender: TObject); 143 begin 144 Rule.Items.Move(ListView.Selected.Index, ListView.Selected.Index - 1); 145 ListView.ItemIndex := ListView.Selected.Index - 1; 146 ReloadList; 147 end; 148 125 149 procedure TFormRule.ARemoveExecute(Sender: TObject); 126 150 var … … 137 161 AModify.Enabled := Assigned(ListView.Selected); 138 162 ARemove.Enabled := Assigned(ListView.Selected); 163 AMoveUp.Enabled := Assigned(ListView.Selected) and (ListView.Selected.Index > 0); 164 AMoveDown.Enabled := Assigned(ListView.Selected) and (ListView.Selected.Index < (ListView.Items.Count - 1)); 139 165 end; 140 166
Note:
See TracChangeset
for help on using the changeset viewer.