Ignore:
Timestamp:
Nov 27, 2017, 10:04:52 AM (7 years ago)
Author:
chronos
Message:
  • Modified: Rule items interface moved to separate unit UFormRuleItems.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/generator/Forms/UFormRules.pas

    r114 r116  
    66
    77uses
    8   Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
     8  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs,
    99  ComCtrls, ActnList, Menus, URules;
    1010
     
    3232    procedure ARemoveExecute(Sender: TObject);
    3333    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
     34    procedure FormCreate(Sender: TObject);
    3435    procedure FormShow(Sender: TObject);
    3536    procedure ListView1Data(Sender: TObject; Item: TListItem);
     
    107108end;
    108109
     110procedure TFormRules.FormCreate(Sender: TObject);
     111begin
     112  Rules := nil;
     113end;
     114
    109115procedure TFormRules.ListView1Data(Sender: TObject; Item: TListItem);
    110116begin
     
    112118    Item.Caption := Rules[Item.Index].Name;
    113119    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));
    115121  end;
    116122end;
     
    140146procedure TFormRules.ReloadList;
    141147begin
    142   ListView1.Items.Count := Rules.Count;
     148  if Assigned(Rules) then ListView1.Items.Count := Rules.Count
     149    else ListView1.Items.Count := 0;
    143150  ListView1.Refresh;
    144151end;
Note: See TracChangeset for help on using the changeset viewer.