Changeset 12 for trunk/Forms


Ignore:
Timestamp:
Mar 15, 2013, 11:42:38 PM (12 years ago)
Author:
chronos
Message:
  • Přidáno: Podpora pro více účtů.
Location:
trunk/Forms
Files:
3 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormMain.lfm

    r10 r12  
    2222  end
    2323  object GroupBox1: TGroupBox
    24     Left = 8
     24    Left = 16
    2525    Height = 57
    26     Top = 8
     26    Top = 120
    2727    Width = 498
    2828    Anchors = [akTop, akLeft, akRight]
     
    4242  end
    4343  object GroupBox2: TGroupBox
    44     Left = 8
     44    Left = 17
    4545    Height = 72
    46     Top = 80
     46    Top = 184
    4747    Width = 498
    4848    Anchors = [akTop, akLeft, akRight]
     
    108108  end
    109109  object GroupBox3: TGroupBox
    110     Left = 8
     110    Left = 16
    111111    Height = 65
    112     Top = 168
     112    Top = 280
    113113    Width = 499
    114114    Anchors = [akTop, akLeft, akRight]
     
    181181    TabOrder = 5
    182182  end
     183  object Label5: TLabel
     184    Left = 16
     185    Height = 17
     186    Top = 12
     187    Width = 56
     188    Caption = 'Account:'
     189    ParentColor = False
     190  end
     191  object ComboBoxAccounts: TComboBox
     192    Left = 96
     193    Height = 29
     194    Top = 8
     195    Width = 312
     196    Anchors = [akTop, akLeft, akRight]
     197    ItemHeight = 0
     198    OnChange = ComboBoxAccountsChange
     199    Style = csDropDownList
     200    TabOrder = 6
     201  end
     202  object ButtonNew1: TButton
     203    Left = 416
     204    Height = 25
     205    Top = 8
     206    Width = 88
     207    Anchors = [akTop, akRight]
     208    Caption = 'Edit'
     209    OnClick = ButtonNew1Click
     210    TabOrder = 7
     211  end
     212  object GroupBox4: TGroupBox
     213    Left = 16
     214    Height = 65
     215    Top = 48
     216    Width = 498
     217    Anchors = [akTop, akLeft, akRight]
     218    Caption = 'Account state'
     219    ClientHeight = 46
     220    ClientWidth = 494
     221    TabOrder = 8
     222    object Label6: TLabel
     223      Left = 14
     224      Height = 17
     225      Top = 7
     226      Width = 56
     227      Caption = 'Balance:'
     228      ParentColor = False
     229    end
     230    object LabelBalance: TLabel
     231      Left = 110
     232      Height = 17
     233      Top = 7
     234      Width = 12
     235      Caption = '   '
     236      ParentColor = False
     237    end
     238  end
    183239end
  • trunk/Forms/UFormMain.lrt

    r9 r12  
    1414TFORMMAIN.LABEL2.CAPTION=Year:
    1515TFORMMAIN.LABEL3.CAPTION=Number:
     16TFORMMAIN.LABEL5.CAPTION=Account:
     17TFORMMAIN.BUTTONNEW1.CAPTION=Edit
     18TFORMMAIN.GROUPBOX4.CAPTION=Account state
     19TFORMMAIN.LABEL6.CAPTION=Balance:
     20TFORMMAIN.LABELBALANCE.CAPTION=   
  • trunk/Forms/UFormMain.pas

    r9 r12  
    1616  TFormMain = class(TForm)
    1717    ButtonNew: TButton;
     18    ButtonNew1: TButton;
    1819    ButtonSettings: TButton;
    1920    ButtonInterval: TButton;
     
    2122    ButtonExit: TButton;
    2223    ButtonAbout: TButton;
     24    ComboBoxAccounts: TComboBox;
    2325    DateEditStart: TDateEdit;
    2426    DateEditTo: TDateEdit;
     
    2628    GroupBox2: TGroupBox;
    2729    GroupBox3: TGroupBox;
     30    GroupBox4: TGroupBox;
    2831    Label1: TLabel;
    2932    Label2: TLabel;
    3033    Label3: TLabel;
    3134    Label4: TLabel;
     35    Label5: TLabel;
     36    Label6: TLabel;
     37    LabelBalance: TLabel;
    3238    SpinEditYear: TSpinEdit;
    3339    SpinEditId: TSpinEdit;
    3440    procedure ButtonIntervalClick(Sender: TObject);
    3541    procedure ButtonMonthlyClick(Sender: TObject);
     42    procedure ButtonNew1Click(Sender: TObject);
    3643    procedure ButtonNewClick(Sender: TObject);
     44    procedure ComboBoxAccountsChange(Sender: TObject);
    3745    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    3846    procedure FormCreate(Sender: TObject);
     
    6876end;
    6977
     78procedure TFormMain.ComboBoxAccountsChange(Sender: TObject);
     79begin
     80  if ComboBoxAccounts.ItemIndex <> -1 then
     81    Core.CurrentAccount := TAccount(Core.Accounts[ComboBoxAccounts.ItemIndex])
     82    else Core.CurrentAccount := nil;
     83end;
     84
    7085procedure TFormMain.ButtonIntervalClick(Sender: TObject);
    7186begin
     
    7893  SaveInterface;
    7994  Core.ADownloadMonthly.Execute;
     95end;
     96
     97procedure TFormMain.ButtonNew1Click(Sender: TObject);
     98begin
     99  Core.AAccounts.Execute;
     100  LoadInterface;
    80101end;
    81102
     
    92113procedure TFormMain.LoadInterface;
    93114begin
     115  Core.Accounts.LoadToStrings(ComboBoxAccounts.Items);
    94116  DateEditStart.Date := Core.ReportTimeFrom;
    95117  DateEditTo.Date := Core.ReportTimeTo;
    96118  SpinEditYear.Value := Core.ReportYear;
    97119  SpinEditId.Value := Core.ReportId;
     120  ButtonInterval.Enabled := Assigned(Core.CurrentAccount);
     121  ButtonMonthly.Enabled := Assigned(Core.CurrentAccount);
     122  ButtonNew.Enabled := Assigned(Core.CurrentAccount);
    98123end;
    99124
  • trunk/Forms/UFormSettings.lfm

    r9 r12  
    1010  Position = poScreenCenter
    1111  LCLVersion = '1.1'
    12   object LabeledEditToken: TLabeledEdit
    13     Left = 8
    14     Height = 27
    15     Top = 25
    16     Width = 528
    17     Anchors = [akTop, akLeft, akRight]
    18     EditLabel.AnchorSideLeft.Control = LabeledEditToken
    19     EditLabel.AnchorSideRight.Control = LabeledEditToken
    20     EditLabel.AnchorSideRight.Side = asrBottom
    21     EditLabel.AnchorSideBottom.Control = LabeledEditToken
    22     EditLabel.Left = 8
    23     EditLabel.Height = 17
    24     EditLabel.Top = 5
    25     EditLabel.Width = 528
    26     EditLabel.Caption = 'Token'
    27     EditLabel.ParentColor = False
    28     TabOrder = 0
    29   end
    3012  object ButtonCancel: TButton
    3113    Left = 376
     
    3618    Caption = 'Cancel'
    3719    ModalResult = 2
    38     TabOrder = 1
     20    TabOrder = 0
    3921  end
    4022  object ButtonOk: TButton
     
    4729    Default = True
    4830    ModalResult = 1
    49     TabOrder = 2
     31    TabOrder = 1
    5032  end
    5133  object ComboBox1: TComboBox
    52     Left = 8
     34    Left = 11
    5335    Height = 29
    54     Top = 80
     36    Top = 32
    5537    Width = 236
    5638    ItemHeight = 0
    5739    Style = csDropDownList
    58     TabOrder = 3
     40    TabOrder = 2
    5941  end
    6042  object Label1: TLabel
    61     Left = 8
     43    Left = 11
    6244    Height = 17
    63     Top = 64
     45    Top = 16
    6446    Width = 83
    6547    Caption = 'Data format:'
     
    6749  end
    6850  object LabeledEditFolder: TLabeledEdit
    69     Left = 8
     51    Left = 11
    7052    Height = 27
    71     Top = 136
     53    Top = 88
    7254    Width = 440
    7355    Anchors = [akTop, akLeft, akRight]
     
    7658    EditLabel.AnchorSideRight.Side = asrBottom
    7759    EditLabel.AnchorSideBottom.Control = LabeledEditFolder
    78     EditLabel.Left = 8
     60    EditLabel.Left = 11
    7961    EditLabel.Height = 17
    80     EditLabel.Top = 116
     62    EditLabel.Top = 68
    8163    EditLabel.Width = 440
    8264    EditLabel.Caption = 'Destination folder:'
    8365    EditLabel.ParentColor = False
    84     TabOrder = 4
     66    TabOrder = 3
    8567  end
    8668  object Button1: TButton
    87     Left = 461
     69    Left = 464
    8870    Height = 25
    89     Top = 136
     71    Top = 88
    9072    Width = 75
    9173    Anchors = [akTop, akRight]
    9274    Caption = 'Select'
    9375    OnClick = Button1Click
    94     TabOrder = 5
     76    TabOrder = 4
    9577  end
    9678end
  • trunk/Forms/UFormSettings.lrt

    r9 r12  
    11TFORMSETTINGS.CAPTION=Settings
    2 TFORMSETTINGS.LABELEDEDITTOKEN.EDITLABEL.CAPTION=Token
    32TFORMSETTINGS.BUTTONCANCEL.CAPTION=Cancel
    43TFORMSETTINGS.BUTTONOK.CAPTION=Ok
  • trunk/Forms/UFormSettings.pas

    r10 r12  
    1919    ComboBox1: TComboBox;
    2020    Label1: TLabel;
    21     LabeledEditToken: TLabeledEdit;
    2221    LabeledEditFolder: TLabeledEdit;
    2322    procedure Button1Click(Sender: TObject);
     
    6766procedure TFormSettings.Load;
    6867begin
    69   LabeledEditToken.Text := Core.Token;
    7068  ComboBox1.ItemIndex := Integer(Core.DataFormat);
    7169  LabeledEditFolder.Text := Core.TargetDirectory;
     
    7472procedure TFormSettings.Save;
    7573begin
    76   Core.Token := LabeledEditToken.Text;
    7774  Core.DataFormat := TFioDataFormat(ComboBox1.ItemIndex);
    7875  Core.TargetDirectory := LabeledEditFolder.Text;
Note: See TracChangeset for help on using the changeset viewer.