Changeset 14 for trunk/Forms
- Timestamp:
- Mar 19, 2013, 8:38:28 PM (12 years ago)
- Location:
- trunk/Forms
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormAccounts.pas
r12 r14 31 31 Selected: Boolean); 32 32 private 33 { private declarations }33 DisableEditUpdate: Boolean; 34 34 public 35 35 Accounts: TListObject; … … 66 66 Selected: Boolean); 67 67 begin 68 if Assigned(ListView1.Selected) then begin 69 DisableEditUpdate := True; 70 LabeledEditToken.Text := TAccount(ListView1.Selected.Data).Token; 71 LabeledEditName.Text := TAccount(ListView1.Selected.Data).Name; 72 DisableEditUpdate := False; 73 end; 68 74 UpdateInterface; 69 75 end; … … 77 83 procedure TFormAccounts.LabeledEditTokenChange(Sender: TObject); 78 84 begin 79 if Assigned(ListView1.Selected) then begin 80 TAccount(ListView1.Selected.Data).Token := LabeledEditToken.Text; 81 TAccount(ListView1.Selected.Data).Name := LabeledEditName.Text; 85 if not DisableEditUpdate then begin 86 if Assigned(ListView1.Selected) then begin 87 TAccount(ListView1.Selected.Data).Token := LabeledEditToken.Text; 88 TAccount(ListView1.Selected.Data).Name := LabeledEditName.Text; 89 end; 90 Reload; 82 91 end; 83 Reload;84 92 end; 85 93 … … 111 119 ListView1.Items.Count := Accounts.Count; 112 120 ListView1.Refresh; 121 UpdateInterface; 113 122 end; 114 123 … … 116 125 begin 117 126 ButtonRemove.Enabled := Assigned(ListView1.Selected); 118 if Assigned(ListView1.Selected) then begin 119 LabeledEditToken.Text := TAccount(ListView1.Selected.Data).Token; 120 LabeledEditName.Text := TAccount(ListView1.Selected.Data).Name; 121 end; 127 LabeledEditToken.Enabled := Assigned(ListView1.Selected); 128 LabeledEditName.Enabled := Assigned(ListView1.Selected); 122 129 end; 123 130 -
trunk/Forms/UFormMain.lfm
r12 r14 66 66 Width = 80 67 67 CalendarDisplaySettings = [dsShowHeadings, dsShowDayNames] 68 OnAcceptDate = DateEditStartAcceptDate 68 69 OKCaption = 'OK' 69 70 CancelCaption = 'Cancel' … … 81 82 Width = 80 82 83 CalendarDisplaySettings = [dsShowHeadings, dsShowDayNames] 84 OnAcceptDate = DateEditToAcceptDate 83 85 OKCaption = 'OK' 84 86 CancelCaption = 'Cancel' -
trunk/Forms/UFormMain.pas
r13 r14 43 43 procedure ButtonNewClick(Sender: TObject); 44 44 procedure ComboBoxAccountsChange(Sender: TObject); 45 procedure DateEditStartAcceptDate(Sender: TObject; var ADate: TDateTime; 46 var AcceptDate: Boolean); 47 procedure DateEditToAcceptDate(Sender: TObject; var ADate: TDateTime; 48 var AcceptDate: Boolean); 45 49 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); 46 50 procedure FormCreate(Sender: TObject); … … 82 86 else Core.CurrentAccount := nil; 83 87 LoadInterface; 88 Core.SelectedAccountIndex := ComboBoxAccounts.ItemIndex; 89 end; 90 91 procedure TFormMain.DateEditStartAcceptDate(Sender: TObject; 92 var ADate: TDateTime; var AcceptDate: Boolean); 93 begin 94 AcceptDate := (ADate <= Now) and (ADate <= DateEditTo.Date); 95 end; 96 97 procedure TFormMain.DateEditToAcceptDate(Sender: TObject; var ADate: TDateTime; 98 var AcceptDate: Boolean); 99 begin 100 AcceptDate := (ADate <= Now) and (ADate >= DateEditStart.Date); 84 101 end; 85 102 … … 115 132 begin 116 133 Core.Accounts.LoadToStrings(ComboBoxAccounts.Items); 134 if (Core.SelectedAccountIndex >= 0) and 135 (Core.SelectedAccountIndex < ComboBoxAccounts.Items.Count) then 136 ComboBoxAccounts.ItemIndex := Core.SelectedAccountIndex; 117 137 DateEditStart.Date := Core.ReportTimeFrom; 118 138 DateEditTo.Date := Core.ReportTimeTo; 119 139 SpinEditYear.Value := Core.ReportYear; 140 SpinEditYear.MaxValue := YearOf(Now); 120 141 SpinEditId.Value := Core.ReportId; 121 142 ButtonInterval.Enabled := Assigned(Core.CurrentAccount); 122 143 ButtonMonthly.Enabled := Assigned(Core.CurrentAccount); 123 144 ButtonNew.Enabled := Assigned(Core.CurrentAccount); 145 Core.ADownloadInterval.Enabled := Assigned(Core.CurrentAccount); 146 Core.ADownloadMonthly.Enabled := Assigned(Core.CurrentAccount); 147 Core.ADownloadNew.Enabled := Assigned(Core.CurrentAccount); 124 148 if ComboBoxAccounts.ItemIndex <> -1 then begin 125 149 LabelBalance.Caption := FloatToStr(TAccount(ComboBoxAccounts.Items.Objects[ -
trunk/Forms/UFormSettings.lfm
r12 r14 1 1 object FormSettings: TFormSettings 2 2 Left = 420 3 Height = 2 733 Height = 281 4 4 Top = 127 5 Width = 55 05 Width = 558 6 6 Caption = 'Settings' 7 ClientHeight = 2 738 ClientWidth = 55 07 ClientHeight = 281 8 ClientWidth = 558 9 9 OnCreate = FormCreate 10 10 Position = poScreenCenter 11 11 LCLVersion = '1.1' 12 12 object ButtonCancel: TButton 13 Left = 3 7613 Left = 384 14 14 Height = 25 15 Top = 2 4215 Top = 250 16 16 Width = 75 17 17 Anchors = [akRight, akBottom] … … 21 21 end 22 22 object ButtonOk: TButton 23 Left = 4 6423 Left = 472 24 24 Height = 25 25 Top = 24 225 Top = 249 26 26 Width = 75 27 27 Anchors = [akRight] … … 52 52 Height = 27 53 53 Top = 88 54 Width = 44 054 Width = 448 55 55 Anchors = [akTop, akLeft, akRight] 56 56 EditLabel.AnchorSideLeft.Control = LabeledEditFolder … … 61 61 EditLabel.Height = 17 62 62 EditLabel.Top = 68 63 EditLabel.Width = 44 063 EditLabel.Width = 448 64 64 EditLabel.Caption = 'Destination folder:' 65 65 EditLabel.ParentColor = False … … 67 67 end 68 68 object Button1: TButton 69 Left = 4 6469 Left = 472 70 70 Height = 25 71 71 Top = 88 … … 76 76 TabOrder = 4 77 77 end 78 object LabeledEditFileNameFormat: TLabeledEdit 79 Left = 11 80 Height = 27 81 Top = 144 82 Width = 448 83 Anchors = [akTop, akLeft, akRight] 84 EditLabel.AnchorSideLeft.Control = LabeledEditFileNameFormat 85 EditLabel.AnchorSideRight.Control = LabeledEditFileNameFormat 86 EditLabel.AnchorSideRight.Side = asrBottom 87 EditLabel.AnchorSideBottom.Control = LabeledEditFileNameFormat 88 EditLabel.Left = 11 89 EditLabel.Height = 17 90 EditLabel.Top = 124 91 EditLabel.Width = 448 92 EditLabel.Caption = 'Output file name format:' 93 EditLabel.ParentColor = False 94 TabOrder = 5 95 end 96 object Label2: TLabel 97 Left = 11 98 Height = 38 99 Top = 176 100 Width = 532 101 Anchors = [akTop, akLeft, akRight] 102 Caption = '%f - data format, %d - date, %t - time, %a - account number, %n - account name, %% - percent symbol' 103 ParentColor = False 104 WordWrap = True 105 end 78 106 end -
trunk/Forms/UFormSettings.lrt
r12 r14 5 5 TFORMSETTINGS.LABELEDEDITFOLDER.EDITLABEL.CAPTION=Destination folder: 6 6 TFORMSETTINGS.BUTTON1.CAPTION=Select 7 TFORMSETTINGS.LABELEDEDITFILENAMEFORMAT.EDITLABEL.CAPTION=Output file name format: 8 TFORMSETTINGS.LABEL2.CAPTION=%f - data format, %d - date, %t - time, %a - account number, %n - account name, %% - percent symbol -
trunk/Forms/UFormSettings.pas
r12 r14 19 19 ComboBox1: TComboBox; 20 20 Label1: TLabel; 21 Label2: TLabel; 21 22 LabeledEditFolder: TLabeledEdit; 23 LabeledEditFileNameFormat: TLabeledEdit; 22 24 procedure Button1Click(Sender: TObject); 23 25 procedure FormCreate(Sender: TObject); … … 66 68 procedure TFormSettings.Load; 67 69 begin 70 LabeledEditFileNameFormat.Text := Core.OutputFormat; 68 71 ComboBox1.ItemIndex := Integer(Core.DataFormat); 69 72 LabeledEditFolder.Text := Core.TargetDirectory; … … 72 75 procedure TFormSettings.Save; 73 76 begin 77 Core.OutputFormat := LabeledEditFileNameFormat.Text; 74 78 Core.DataFormat := TFioDataFormat(ComboBox1.ItemIndex); 75 79 Core.TargetDirectory := LabeledEditFolder.Text;
Note:
See TracChangeset
for help on using the changeset viewer.