Ignore:
Timestamp:
Mar 25, 2013, 11:47:38 PM (11 years ago)
Author:
chronos
Message:
  • Upraveno: Příprava pro zobrazování seznamu operací.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormMain.pas

    r20 r22  
    3838    Label7: TLabel;
    3939    LabelBalance: TLabel;
    40     ListView1: TListView;
     40    ListViewOperation: TListView;
    4141    SpinEditYear: TSpinEdit;
    4242    SpinEditId: TSpinEdit;
     
    5555    procedure FormCreate(Sender: TObject);
    5656    procedure FormShow(Sender: TObject);
     57    procedure ListViewOperationData(Sender: TObject; Item: TListItem);
    5758  private
    5859    { private declarations }
    5960  public
     61    procedure ReloadList;
    6062    procedure LoadInterface;
    6163    procedure SaveInterface;
     
    114116    Core.LoadAccount(Core.CurrentAccount);
    115117    LoadInterface;
     118    ReloadList;
    116119  end;
    117120end;
     
    137140  LoadInterface;
    138141  Core.CoolTranslator1.Translate;
     142end;
     143
     144procedure TFormMain.ListViewOperationData(Sender: TObject; Item: TListItem);
     145begin
     146  if Assigned(Core.CurrentAccount) then
     147  with Core.CurrentAccount do begin
     148  if (Item.Index >= 0) and (Item.Index < Operations.Count) then
     149  with TAccountOperation(Operations[Item.Index]) do begin
     150    Item.Caption := IntToStr(Item.Index + 1);
     151    Item.Data := Operations[Item.Index];
     152    Item.SubItems.Add(DateToStr(Time));
     153    Item.SubItems.Add(Account);
     154    Item.SubItems.Add(FloatToStr(Value));
     155    Item.SubItems.Add(VarSym);
     156    Item.SubItems.Add(SpecSym);
     157    Item.SubItems.Add(ConstSym);
     158  end;
     159  end;
     160end;
     161
     162procedure TFormMain.ReloadList;
     163begin
     164  if Assigned(Core.CurrentAccount) then
     165    ListViewOperation.Items.Count := Core.CurrentAccount.Operations.Count
     166    else ListViewOperation.Items.Count;
     167  ListViewOperation.Refresh;
    139168end;
    140169
Note: See TracChangeset for help on using the changeset viewer.