Changeset 113 for branches/generator/Forms
- Timestamp:
- Aug 9, 2017, 10:14:31 PM (7 years ago)
- Location:
- branches/generator/Forms
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/generator/Forms/UFormRule.lfm
r112 r113 114 114 Action = ARemove 115 115 end 116 object ToolButton4: TToolButton 117 Left = 70 118 Top = 2 119 Action = AMoveUp 120 end 121 object ToolButton5: TToolButton 122 Left = 93 123 Top = 2 124 Action = AMoveDown 125 end 116 126 end 117 127 object ActionList1: TActionList … … 134 144 OnExecute = ARemoveExecute 135 145 end 146 object AMoveUp: TAction 147 Caption = 'Move up' 148 ImageIndex = 7 149 OnExecute = AMoveUpExecute 150 end 151 object AMoveDown: TAction 152 Caption = 'Move down' 153 ImageIndex = 6 154 OnExecute = AMoveDownExecute 155 end 136 156 end 137 157 object PopupMenu1: TPopupMenu 138 158 Images = Core.ImageList1 139 159 left = 118 140 top = 18 5160 top = 187 141 161 object MenuItem1: TMenuItem 142 162 Action = AAdd … … 148 168 Action = ARemove 149 169 end 170 object MenuItem4: TMenuItem 171 Action = AMoveUp 172 end 173 object MenuItem5: TMenuItem 174 Action = AMoveDown 175 end 150 176 end 151 177 end -
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.