Changeset 120 for branches/generator/Forms/UFormRule.pas
- Timestamp:
- Nov 29, 2017, 1:21:22 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/generator/Forms/UFormRule.pas
r119 r120 19 19 EditName: TEdit; 20 20 Label1: TLabel; 21 ListView1: TListView; 21 22 PageControl1: TPageControl; 22 23 TabSheet1: TTabSheet; 23 24 TabSheet2: TTabSheet; 25 TabSheetUsedBy: TTabSheet; 24 26 procedure FormCreate(Sender: TObject); 25 27 procedure FormDestroy(Sender: TObject); 26 28 procedure FormShow(Sender: TObject); 29 procedure ListView1Data(Sender: TObject; Item: TListItem); 27 30 private 28 31 FormRuleItems: TFormRuleItems; 32 UsedByRules: TStringList; 33 procedure ReloadUsedByRules; 29 34 public 30 35 Rule: TRule; … … 39 44 implementation 40 45 46 uses 47 UCore; 48 41 49 {$R *.lfm} 42 50 … … 46 54 begin 47 55 EditName.SetFocus; 56 PageControl1.TabIndex := 0; // Select first tab by default 57 end; 58 59 procedure TFormRule.ListView1Data(Sender: TObject; Item: TListItem); 60 begin 61 if Item.Index < UsedByRules.Count then 62 begin 63 Item.Caption := UsedByRules[Item.Index]; 64 Item.Data := UsedByRules.Objects[Item.Index]; 65 end; 66 end; 67 68 procedure TFormRule.ReloadUsedByRules; 69 begin 70 ListView1.Items.Count := UsedByRules.Count; 71 ListView1.Refresh; 48 72 end; 49 73 … … 54 78 FormRuleItems.Align := alClient; 55 79 FormRuleItems.Show; 80 UsedByRules := TStringList.Create; 56 81 end; 57 82 58 83 procedure TFormRule.FormDestroy(Sender: TObject); 59 84 begin 85 FreeAndNil(UsedByRules); 60 86 FreeAndNil(FormRuleItems); 61 87 end; … … 64 90 begin 65 91 Self.Rule := Rule; 92 Rule.Grammer.GetUsedByRule(Rule, UsedByRules); 93 ReloadUsedByRules; 66 94 EditName.Text := Rule.Name; 67 95 CheckBoxCreateNode.Checked := Rule.CreateSourceNode;
Note:
See TracChangeset
for help on using the changeset viewer.