Changeset 116 for branches/generator/Forms
- Timestamp:
- Nov 27, 2017, 10:04:52 AM (7 years ago)
- Location:
- branches/generator/Forms
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/generator/Forms/UFormRule.lfm
r114 r116 1 1 object FormRule: TFormRule 2 2 Left = 507 3 Height = 5 053 Height = 514 4 4 Top = 293 5 Width = 66 05 Width = 663 6 6 ActiveControl = ButtonOk 7 7 Caption = 'Rule' 8 ClientHeight = 505 9 ClientWidth = 660 8 ClientHeight = 514 9 ClientWidth = 663 10 OnCreate = FormCreate 10 11 OnShow = FormShow 11 12 LCLVersion = '1.6.4.0' … … 13 14 Left = 376 14 15 Height = 25 15 Top = 4 6716 Top = 476 16 17 Width = 75 17 18 Anchors = [akLeft, akBottom] … … 23 24 Left = 168 24 25 Height = 25 25 Top = 4 6726 Top = 476 26 27 Width = 75 27 28 Anchors = [akLeft, akBottom] … … 31 32 end 32 33 object Label1: TLabel 33 Left = 2434 Left = 16 34 35 Height = 20 35 Top = 2936 Top = 16 36 37 Width = 43 37 38 Caption = 'Name:' 38 39 ParentColor = False 39 40 end 40 object EditName: TEdit 41 Left = 184 42 Height = 28 43 Top = 19 44 Width = 392 41 object PageControl1: TPageControl 42 Left = 16 43 Height = 421 44 Top = 48 45 Width = 640 46 ActivePage = TabSheet1 47 Anchors = [akTop, akLeft, akRight, akBottom] 48 TabIndex = 0 45 49 TabOrder = 2 46 end 47 object ListView: TListView 48 Left = 16 49 Height = 307 50 Top = 112 51 Width = 624 52 Anchors = [akTop, akLeft, akRight, akBottom] 53 Columns = < 54 item 55 Caption = 'Name' 56 Width = 604 57 end> 58 MultiSelect = True 59 OwnerData = True 60 PopupMenu = PopupMenu1 61 ReadOnly = True 62 RowSelect = True 63 TabOrder = 3 64 ViewStyle = vsReport 65 OnData = ListViewData 66 OnDblClick = ListViewDblClick 67 OnKeyPress = ListViewKeyPress 68 OnSelectItem = ListViewSelectItem 69 end 70 object Label2: TLabel 71 Left = 24 72 Height = 20 73 Top = 64 74 Width = 63 75 Caption = 'Operator:' 76 ParentColor = False 77 end 78 object ComboBox1: TComboBox 79 Left = 186 80 Height = 28 81 Top = 61 82 Width = 390 83 ItemHeight = 20 84 Items.Strings = ( 85 'And' 86 'Or' 87 ) 88 Style = csDropDownList 89 TabOrder = 4 90 end 91 object ToolBar1: TToolBar 92 Left = 16 93 Height = 26 94 Top = 424 95 Width = 624 96 Align = alCustom 97 Anchors = [akLeft, akRight, akBottom] 98 Caption = 'ToolBar1' 99 Images = Core.ImageList1 100 TabOrder = 5 101 object ToolButton1: TToolButton 102 Left = 1 103 Top = 2 104 Action = AAdd 50 object TabSheet1: TTabSheet 51 Caption = 'Items' 105 52 end 106 object ToolButton2: TToolButton 107 Left = 24 108 Top = 2 109 Action = AModify 110 end 111 object ToolButton3: TToolButton 112 Left = 47 113 Top = 2 114 Action = ARemove 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 53 object TabSheet2: TTabSheet 54 Caption = 'Links' 125 55 end 126 56 end 127 object ActionList1: TActionList 128 Images = Core.ImageList1 129 left = 347 130 top = 187 131 object AAdd: TAction 132 Caption = 'Add' 133 ImageIndex = 0 134 OnExecute = AAddExecute 135 end 136 object AModify: TAction 137 Caption = 'Modify' 138 ImageIndex = 3 139 OnExecute = AModifyExecute 140 end 141 object ARemove: TAction 142 Caption = 'Remove' 143 ImageIndex = 1 144 OnExecute = ARemoveExecute 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 156 end 157 object PopupMenu1: TPopupMenu 158 Images = Core.ImageList1 159 left = 118 160 top = 187 161 object MenuItem1: TMenuItem 162 Action = AAdd 163 Bitmap.Data = { 164 36040000424D3604000000000000360000002800000010000000100000000100 165 2000000000000004000064000000640000000000000000000000000000000000 166 0000000000000000000000000000000000000000000000000000000000000000 167 0000000000000000000000000000000000000000000000000000000000000000 168 000000000000000000000000000000000000D4D4D4FFB2B2B2FFB2B2B2FFD4D4 169 D4FF000000000000000000000000000000000000000000000000000000000000 170 0000000000000000000000000000709B70FF004A00FF004800FF4E764EFFB2B2 171 B2FF000000000000000000000000000000000000000000000000000000000000 172 0000000000000000000000000000004E00FF00C800FF00C400FF004800FFB2B2 173 B2FF000000000000000000000000000000000000000000000000000000000000 174 0000000000000000000000000000005000FF00CA00FF00C600FF004A00FFB2B2 175 B2FF000000000000000000000000000000000000000000000000000000000000 176 0000000000000000000000000000005300FF00CE00FF00CA00FF004C00FFB2B2 177 B2FF00000000000000000000000000000000000000000000000000000000D4D4 178 D4FFB2B2B2FFB2B2B2FFB2B2B2FF005400FF00D200FF00CE00FF004E00FFB2B2 179 B2FFB2B2B2FFB2B2B2FFB2B2B2FFB2B2B2FFD4D4D4FF0000000070A670FF005E 180 00FF005C00FF005A00FF005800FF005600FF00D600FF00D000FF005000FF004E 181 00FF004C00FF004A00FF004A00FF4E764EFFB2B2B2FF00000000006200FF8CFE 182 8CFF00EA00FF00E600FF00E200FF00DE00FF00DA00FF00D400FF00D000FF00CC 183 00FF00C800FF00C400FF00C200FF004800FFB2B2B2FF00000000006400FFECFF 184 ECFF8CFE8CFF8CFE8CFF8CFE8CFF8CFE8CFF00DE00FF00D900FF00D400FF00D0 185 00FF00CC00FF00C800FF00C400FF004A00FFD4D4D4FF0000000070A970FF0064 186 00FF006400FF006200FF006000FF006000FF8CFE8CFF00DD00FF005800FF0056 187 00FF005400FF005300FF005000FF709C70FF0000000000000000000000000000 188 0000000000000000000000000000006000FF8CFE8CFF00E000FF005A00FFB2B2 189 B2FF000000000000000000000000000000000000000000000000000000000000 190 0000000000000000000000000000006200FF8CFE8CFF00E500FF005C00FFB2B2 191 B2FF000000000000000000000000000000000000000000000000000000000000 192 0000000000000000000000000000006400FF8CFE8CFF00E800FF005E00FFB2B2 193 B2FF000000000000000000000000000000000000000000000000000000000000 194 0000000000000000000000000000006400FFECFFECFF8CFE8CFF006000FFD4D4 195 D4FF000000000000000000000000000000000000000000000000000000000000 196 000000000000000000000000000070A970FF006400FF006200FF70A670FF0000 197 0000000000000000000000000000000000000000000000000000 198 } 199 end 200 object MenuItem2: TMenuItem 201 Action = AModify 202 Bitmap.Data = { 203 36040000424D3604000000000000360000002800000010000000100000000100 204 2000000000000004000064000000640000000000000000000000986B37FF976A 205 36FF966935FF966734FF956633FF946532FF946531FF936430FF92622FFF9261 206 2EFF91602DFF90602CFF905F2BFF8F5D2AFF8E5C29FF8D5B28FF996C38FFF8F7 207 F6FFF8F7F5FFF7F6F5FFF6F6F4FFF6F5F3FFF5F5F3FFF5F4F2FFF4F3F1FFF4F3 208 F1FFF3F2F0FFF3F2EFFFF2F1EFFFF2F0EEFFF1F0EDFF8E5D29FF996D3AFFF9F8 209 F7FF959594FF878787FF9B9A9AFFF7F6F4FFF6F5F3FFF6F5F3FFF5F4F2FFF4F3 210 F1FFF4F3F1FFF3F2F0FFF3F2EFFFF2F1EFFFF2F1EEFF8F5E2AFF9A6E3BFFF9F9 211 F8FF7C7C7CFFC4C4C4FF878787FFF7F6F5FF7A7A7AFF787878FF747474FF7171 212 70FF6D6D6CFF696968FF656565FF616161FFF2F1EFFF905F2BFF9B6F3CFFFAF9 213 F8FFBEBEBDFF929292FFBCBCBBFFF8F7F6FFF7F7F5FFF7F6F4FFF6F5F4FFF6F5 214 F3FFF5F4F2FFF5F4F2FFF4F3F1FFF4F2F0FFF3F2F0FF91602DFF9C703DFFFAFA 215 F9FFFAF9F9FFF9F9F8FFF9F8F7FFF8F8F7FFF8F7F6FFF7F7F5FFF7F6F5FFF6F5 216 F4FFF6F5F3FFF5F4F3FFF5F4F2FFF4F3F1FFF4F3F0FF92612EFF9D723EFFFBFB 217 FAFF9F9F9EFF7F7F7FFFAEAEADFFF9F8F7FFF8F8F7FFF8F7F6FFF7F7F5FFF7F6 218 F5FFF6F6F4FFF6F5F3FFF5F4F3FFF5F4F2FFF4F3F1FF92622FFF9D7340FFFCFB 219 FBFF818181FFC4C4C4FF8F8F8FFFFAF9F8FF7B7B7AFF797979FF757574FF7271 220 71FF6D6D6DFF696969FF666665FF626261FFF5F4F2FF936430FF9E7441FFFCFC 221 FCFFB5B5B5FF848484FFBEBDBDFFFAFAF9FFFAF9F8FFF9F9F7FFF9F8F7FFF8F8 222 F6FFF8F7F5FFF7F6F5FFF7F6F4FFF6F5F3FFF6F5F3FF946531FF9F7542FFFDFD 223 FCFFFCFCFCFFFCFCFBFFFBFBFAFFFBFAFAFFFAFAF9FFFAF9F8FFF9F9F8FFF9F8 224 F7FFF8F8F6FFF8F7F6FFF7F6F5FFF7F6F4FFF6F5F4FF956633FFA07643FFFEFD 225 FDFF8C8C8CFF525252FFA4A4A4FFFBFBFAFFFBFBFAFFFAFAF9FFFAF9F8FFF9F9 226 F8FFF9F8F7FFF8F8F6FFF8F7F6FFF7F7F5FFF7F6F4FF966734FFA17844FFFEFE 227 FEFF5F5F5FFF949494FF535353FFFCFCFBFF7B7B7BFF797979FF757575FF7272 228 72FF6E6E6EFF6A6A69FF666666FF626262FFF7F7F5FF966935FFA17946FFFFFF 229 FFFF878787FF5D5D5DFFA0A0A0FFFDFCFCFFFCFCFBFFFCFBFBFFFBFBFAFFFBFA 230 F9FFFAFAF9FFFAF9F8FFF9F8F7FFF8F8F7FFF8F7F6FF976A36FFA27A47FFFFFF 231 FFFFFFFFFFFFFEFEFEFFFEFEFEFFFDFDFDFFFDFDFCFFFCFCFBFFFCFBFBFFFBFB 232 FAFFFBFAF9FFFAFAF9FFFAF9F8FFF9F9F7FFF9F8F7FF986B37FFA37B48FFBEA2 233 7FFFBEA17EFFBDA17DFFBDA07CFFBD9F7CFFBC9F7BFFBB9E7AFFBB9D7AFFBB9D 234 79FFBA9C78FFB99B78FFB99A77FFB89A76FFB89975FF996C39FFA37B48FFA37B 235 48FFA27A47FFA27946FFA17845FFA07744FFA07643FF9F7542FF9E7441FF9E73 236 40FF9D723FFF9C713EFF9C703DFF9B6F3CFF9A6E3BFF9A6D3AFF 237 } 238 end 239 object MenuItem3: TMenuItem 240 Action = ARemove 241 Bitmap.Data = { 242 36040000424D3604000000000000360000002800000010000000100000000100 243 2000000000000004000064000000640000000000000000000000000000000000 244 0000000000000000000000000000000000000000000000000000000000000000 245 0000000000000000000000000000000000000000000000000000000000000000 246 0000000000000000000000000000000000000000000000000000000000000000 247 0000000000000000000000000000000000003A3AE2FFC0C0C0FF000000000000 248 000000000000000000003A3AE2FFC0C0C0FF0000000000000000000000000000 249 0000000000000000000000000000000000000000000000000000000000000000 250 0000000000003A3AE2FF3A3AE2FF3A3AE2FFC0C0C0FF00000000000000000000 251 00000000000000000000000000003A3AE2FFC0C0C0FF00000000000000000000 252 0000000000003A3AE2FF3A3AE2FF3A3AE2FFC0C0C0FF00000000000000000000 253 000000000000000000003A3AE2FFC0C0C0FF0000000000000000000000000000 254 000000000000000000003838E0FF3838E0FF3838E0FFC0C0C0FF000000000000 255 0000000000003838E0FF3838E0FFC0C0C0FF0000000000000000000000000000 256 00000000000000000000000000003535DDFF3535DDFF3535DDFFC0C0C0FF0000 257 00003535DDFF3535DDFFC0C0C0FF000000000000000000000000000000000000 258 0000000000000000000000000000000000003232DAFF3232DAFF3232DAFF3232 259 DAFF3232DAFFC0C0C0FF00000000000000000000000000000000000000000000 260 000000000000000000000000000000000000000000002F2FD7FF2F2FD7FF2F2F 261 D7FFC0C0C0FF0000000000000000000000000000000000000000000000000000 262 0000000000000000000000000000000000002C2CD4FF2C2CD4FF2C2CD4FF2C2C 263 D4FF2C2CD4FFC0C0C0FF00000000000000000000000000000000000000000000 264 00000000000000000000000000002929D1FF2929D1FF2929D1FFC0C0C0FF0000 265 00002929D1FFC0C0C0FF00000000000000000000000000000000000000000000 266 0000000000002626CEFF2626CEFF2626CEFF2626CEFFC0C0C0FF000000000000 267 0000000000002626CEFF2626CEFFC0C0C0FF0000000000000000000000000000 268 00002020C8FF2020C8FF2020C8FF2020C8FFC0C0C0FF00000000000000000000 269 000000000000000000002020C8FF2020C8FFC0C0C0FF00000000000000000000 270 00001818C0FF1818C0FFC0C0C0FF000000000000000000000000000000000000 271 00000000000000000000000000001818C0FF1818C0FFC0C0C0FF000000000000 272 0000000000000000000000000000000000000000000000000000000000000000 273 0000000000000000000000000000000000000000000000000000000000000000 274 0000000000000000000000000000000000000000000000000000000000000000 275 0000000000000000000000000000000000000000000000000000 276 } 277 end 278 object MenuItem4: TMenuItem 279 Action = AMoveUp 280 Bitmap.Data = { 281 36040000424D3604000000000000360000002800000010000000100000000100 282 2000000000000004000064000000640000000000000000000000000000000000 283 0000000000000000000000000000000000000000000000000000000000000000 284 0000000000000000000000000000000000000000000000000000000000000000 285 0000000000000000000000000000000000FF000000FF000000FF000000FF0000 286 00FF000000FF000000FF00000000000000000000000000000000000000000000 287 0000000000000000000000000000000000FFFF442CFFFF3C28FFFF3522FFFF2E 288 1EFFFF2619FF000000FF00000000000000000000000000000000000000000000 289 0000000000000000000000000000000000FFFF5337FFFF4C32FFFF442CFFFF3C 290 28FFFF3623FF000000FF00000000000000000000000000000000000000000000 291 0000000000000000000000000000000000FFFF6341FFFF5C3BFFFF5437FFFF4C 292 32FFFF442CFF000000FF00000000000000000000000000000000000000000000 293 0000000000000000000000000000000000FFFF724AFFFF6B46FFFF6441FFFF5D 294 3CFFFF5437FF000000FF00000000000000000000000000000000000000000000 295 0000000000000000000000000000000000FFFF8255FFFF7A4FFFFF744BFFFF6C 296 46FFFF6441FF000000FF00000000000000000000000000000000000000000000 297 0000000000000000000000000000000000FFFF915FFFFF8A5AFFFF8255FFFF7C 298 51FFFF744CFF000000FF00000000000000000000000000000000000000000000 299 00FF000000FF000000FF000000FF000000FFFFA169FFFF9A65FFFF9360FFFF8A 300 5AFFFF8456FF000000FF000000FF000000FF000000FF000000FF000000000000 301 0000000000FFFFC681FFFFBF7DFFFFB878FFFFB073FFFFAA6EFFFFA269FFFF9A 302 65FFFF9360FFFF8C5BFFFF8456FFFF7C51FF000000FF00000000000000000000 303 000000000000000000FFFFCF87FFFFC882FFFFC17DFFFFB878FFFFB174FFFFAA 304 6EFFFFA269FFFF9A65FFFF9461FF000000FF0000000000000000000000000000 305 00000000000000000000000000FFFFD78CFFFFD088FFFFC882FFFFC17DFFFFBA 306 79FFFFB374FFFFAA6EFF000000FF000000000000000000000000000000000000 307 0000000000000000000000000000000000FFFFE092FFFFD88CFFFFD088FFFFC8 308 82FFFFC27EFF000000FF00000000000000000000000000000000000000000000 309 000000000000000000000000000000000000000000FFFFE797FFFFE092FFFFD8 310 8CFF000000FF0000000000000000000000000000000000000000000000000000 311 00000000000000000000000000000000000000000000000000FFFFF09CFF0000 312 00FF000000000000000000000000000000000000000000000000000000000000 313 0000000000000000000000000000000000000000000000000000000000FF0000 314 0000000000000000000000000000000000000000000000000000 315 } 316 end 317 object MenuItem5: TMenuItem 318 Action = AMoveDown 319 Bitmap.Data = { 320 36040000424D3604000000000000360000002800000010000000100000000100 321 2000000000000004000064000000640000000000000000000000000000000000 322 00000000000000000000000000000000000000000000000000FF000000000000 323 0000000000000000000000000000000000000000000000000000000000000000 324 000000000000000000000000000000000000000000FFFFF09CFF000000FF0000 325 0000000000000000000000000000000000000000000000000000000000000000 326 0000000000000000000000000000000000FFFFD88CFFFFE092FFFFE797FF0000 327 00FF000000000000000000000000000000000000000000000000000000000000 328 00000000000000000000000000FFFFC27EFFFFC882FFFFD088FFFFD88CFFFFE0 329 92FF000000FF0000000000000000000000000000000000000000000000000000 330 000000000000000000FFFFAA6EFFFFB374FFFFBA79FFFFC17DFFFFC882FFFFD0 331 88FFFFD78CFF000000FF00000000000000000000000000000000000000000000 332 0000000000FFFF9461FFFF9A65FFFFA269FFFFAA6EFFFFB174FFFFB878FFFFC1 333 7DFFFFC882FFFFCF87FF000000FF000000000000000000000000000000000000 334 00FFFF7C51FFFF8456FFFF8C5BFFFF9360FFFF9A65FFFFA269FFFFAA6EFFFFB0 335 73FFFFB878FFFFBF7DFFFFC681FF000000FF0000000000000000000000FF0000 336 00FF000000FF000000FF000000FFFF8456FFFF8A5AFFFF9360FFFF9A65FFFFA1 337 69FF000000FF000000FF000000FF000000FF000000FF00000000000000000000 338 00000000000000000000000000FFFF744CFFFF7C51FFFF8255FFFF8A5AFFFF91 339 5FFF000000FF0000000000000000000000000000000000000000000000000000 340 00000000000000000000000000FFFF6441FFFF6C46FFFF744BFFFF7A4FFFFF82 341 55FF000000FF0000000000000000000000000000000000000000000000000000 342 00000000000000000000000000FFFF5437FFFF5D3CFFFF6441FFFF6B46FFFF72 343 4AFF000000FF0000000000000000000000000000000000000000000000000000 344 00000000000000000000000000FFFF442CFFFF4C32FFFF5437FFFF5C3BFFFF63 345 41FF000000FF0000000000000000000000000000000000000000000000000000 346 00000000000000000000000000FFFF3623FFFF3C28FFFF442CFFFF4C32FFFF53 347 37FF000000FF0000000000000000000000000000000000000000000000000000 348 00000000000000000000000000FFFF2619FFFF2E1EFFFF3522FFFF3C28FFFF44 349 2CFF000000FF0000000000000000000000000000000000000000000000000000 350 00000000000000000000000000FF000000FF000000FF000000FF000000FF0000 351 00FF000000FF0000000000000000000000000000000000000000000000000000 352 0000000000000000000000000000000000000000000000000000000000000000 353 0000000000000000000000000000000000000000000000000000 354 } 355 end 57 object EditName: TEdit 58 Left = 135 59 Height = 28 60 Top = 11 61 Width = 433 62 TabOrder = 3 356 63 end 357 64 end -
branches/generator/Forms/UFormRule.pas
r113 r116 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, 9 ComCtrls, ActnList, Menus, URules ;9 ComCtrls, ActnList, Menus, URules, UFormRuleItems; 10 10 11 11 type … … 14 14 15 15 TFormRule = class(TForm) 16 AAdd: TAction;17 AMoveUp: TAction;18 AMoveDown: TAction;19 AModify: TAction;20 ARemove: TAction;21 ActionList1: TActionList;22 16 ButtonOk: TButton; 23 17 ButtonCancel: TButton; 24 ComboBox1: TComboBox;25 18 EditName: TEdit; 26 19 Label1: TLabel; 27 Label2: TLabel; 28 ListView: TListView; 29 MenuItem1: TMenuItem; 30 MenuItem2: TMenuItem; 31 MenuItem3: TMenuItem; 32 MenuItem4: TMenuItem; 33 MenuItem5: TMenuItem; 34 PopupMenu1: TPopupMenu; 35 ToolBar1: TToolBar; 36 ToolButton1: TToolButton; 37 ToolButton2: TToolButton; 38 ToolButton3: TToolButton; 39 ToolButton4: TToolButton; 40 ToolButton5: TToolButton; 41 procedure AAddExecute(Sender: TObject); 42 procedure AModifyExecute(Sender: TObject); 43 procedure AMoveDownExecute(Sender: TObject); 44 procedure AMoveUpExecute(Sender: TObject); 45 procedure ARemoveExecute(Sender: TObject); 20 PageControl1: TPageControl; 21 TabSheet1: TTabSheet; 22 TabSheet2: TTabSheet; 23 procedure FormCreate(Sender: TObject); 46 24 procedure FormShow(Sender: TObject); 47 procedure ListViewData(Sender: TObject; Item: TListItem);48 procedure ListViewDblClick(Sender: TObject);49 procedure ListViewKeyPress(Sender: TObject; var Key: char);50 procedure ListViewSelectItem(Sender: TObject; Item: TListItem;51 Selected: Boolean);52 25 private 53 { private declarations }26 FormRuleItems: TFormRuleItems; 54 27 public 55 28 Rule: TRule; 56 procedure UpdateInterface;57 procedure ReloadList;58 29 procedure LoadData(Rule: TRule); 59 30 procedure SaveData(Rule: TRule); … … 76 47 begin 77 48 EditName.SetFocus; 78 ReloadList;79 UpdateInterface;80 49 end; 81 50 82 procedure TFormRule. ListViewData(Sender: TObject; Item: TListItem);51 procedure TFormRule.FormCreate(Sender: TObject); 83 52 begin 84 if (Item.Index >= 0) and (Item.Index < Rule.Items.Count) then begin 85 Item.Caption := Rule.Items[Item.Index].GetBNF; 86 Item.Data := Rule.Items[Item.Index]; 87 end; 88 end; 89 90 procedure TFormRule.ListViewDblClick(Sender: TObject); 91 begin 92 AModify.Execute; 93 end; 94 95 procedure TFormRule.ListViewKeyPress(Sender: TObject; var Key: char); 96 begin 97 if Key = #13 then AModify.Execute; 98 end; 99 100 procedure TFormRule.ListViewSelectItem(Sender: TObject; Item: TListItem; 101 Selected: Boolean); 102 begin 103 UpdateInterface; 104 end; 105 106 procedure TFormRule.AAddExecute(Sender: TObject); 107 var 108 NewRuleItem: TRuleItem; 109 begin 110 NewRuleItem := TRuleItem.Create; 111 NewRuleItem.Grammer := Rule.Grammer; 112 FormRuleItem.LoadData(NewRuleItem); 113 if FormRuleItem.ShowModal = mrOk then begin 114 FormRuleItem.SaveData(NewRuleItem); 115 NewRuleItem.ParentRule := Rule; 116 Rule.Items.Add(NewRuleItem); 117 ReloadList; 118 end else FreeAndNil(NewRuleItem); 119 end; 120 121 procedure TFormRule.AModifyExecute(Sender: TObject); 122 var 123 RuleItem: TRuleItem; 124 begin 125 RuleItem := TRuleItem(ListView.Selected.Data); 126 FormRuleItem.LoadData(RuleItem); 127 if FormRuleItem.ShowModal = mrOk then begin 128 FormRuleItem.SaveData(RuleItem); 129 ReloadList; 130 end; 131 end; 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 149 procedure TFormRule.ARemoveExecute(Sender: TObject); 150 var 151 Item: TListItem; 152 begin 153 for Item in ListView.Items do 154 if Item.Selected then 155 Rule.Items.Remove(TRuleItem(Item.Data)); 156 ReloadList; 157 end; 158 159 procedure TFormRule.UpdateInterface; 160 begin 161 AModify.Enabled := Assigned(ListView.Selected); 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)); 165 end; 166 167 procedure TFormRule.ReloadList; 168 begin 169 ListView.Items.Count := Rule.Items.Count; 170 ListView.Refresh; 53 FormRuleItems := TFormRuleItems.Create(nil); 54 FormRuleItems.ManualDock(TabSheet1); 55 FormRuleItems.Align := alClient; 56 FormRuleItems.Show; 171 57 end; 172 58 … … 174 60 begin 175 61 Self.Rule := Rule; 176 ComboBox1.ItemIndex := Integer(Rule.RuleType);177 62 EditName.Text := Rule.Name; 178 Rule.Items := Rule.Items;63 FormRuleItems.LoadData(Rule.Items); 179 64 end; 180 65 181 66 procedure TFormRule.SaveData(Rule: TRule); 182 67 begin 183 Rule.RuleType := TRuleType(ComboBox1.ItemIndex);184 68 Rule.Name := EditName.Text; 69 FormRuleItems.SaveData(Rule.Items); 185 70 end; 186 71 -
branches/generator/Forms/UFormRules.lfm
r115 r116 8 8 ClientWidth = 857 9 9 OnClose = FormClose 10 OnCreate = FormCreate 10 11 OnShow = FormShow 11 12 LCLVersion = '1.6.4.0' -
branches/generator/Forms/UFormRules.pas
r114 r116 6 6 7 7 uses 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, 9 9 ComCtrls, ActnList, Menus, URules; 10 10 … … 32 32 procedure ARemoveExecute(Sender: TObject); 33 33 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); 34 procedure FormCreate(Sender: TObject); 34 35 procedure FormShow(Sender: TObject); 35 36 procedure ListView1Data(Sender: TObject; Item: TListItem); … … 107 108 end; 108 109 110 procedure TFormRules.FormCreate(Sender: TObject); 111 begin 112 Rules := nil; 113 end; 114 109 115 procedure TFormRules.ListView1Data(Sender: TObject; Item: TListItem); 110 116 begin … … 112 118 Item.Caption := Rules[Item.Index].Name; 113 119 Item.Data := Rules[Item.Index]; 114 Item.SubItems.Add(Rules[Item.Index].Items.GetBNF(Rules[Item.Index]. RuleType));120 Item.SubItems.Add(Rules[Item.Index].Items.GetBNF(Rules[Item.Index].Items.RuleType)); 115 121 end; 116 122 end; … … 140 146 procedure TFormRules.ReloadList; 141 147 begin 142 ListView1.Items.Count := Rules.Count; 148 if Assigned(Rules) then ListView1.Items.Count := Rules.Count 149 else ListView1.Items.Count := 0; 143 150 ListView1.Refresh; 144 151 end;
Note:
See TracChangeset
for help on using the changeset viewer.