jvcllaz: Don't always begin JvTimeFrame on Jan 1, 2001, but on user-defined date.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7139 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz 2019-08-16 10:15:01 +00:00
parent 38184c0550
commit e63668a359
3 changed files with 23 additions and 17 deletions

View File

@ -688,7 +688,11 @@ begin
ResourceComboChange(nil);
DaysComboChange(nil);
ModeComboChange(nil);
GotoDatePicker.Date := EncodeDate(2002, 1, 1);
if GlobalSettings.StartToday then
GotoDatePicker.Date := Date()
else
GotoDatePicker.Date := GlobalSettings.StartDate;
GotoDatePickerChange(nil);
TimeIncComboChange(nil);
end;
@ -886,17 +890,12 @@ procedure TMainForm.FormCreate(Sender: TObject);
var
fn: String;
begin
with DefaultFormatSettings do begin
CurrencyFormat := 1;
NegCurrFormat := 5;
with FormatSettings do begin
ThousandSeparator := ',';
DecimalSeparator := '.';
CurrencyDecimals := 2;
DateSeparator := '-';
DateSeparator := '/';
TimeSeparator := ':';
ListSeparator := ',';
CurrencyString := '$';
ShortDateFormat := 'd/m/y';
ShortDateFormat := 'd/mm/yyyy';
LongDateFormat := 'dd" "mmmm" "yyyy';
TimeAMString := 'AM';
TimePMString := 'PM';

View File

@ -258,12 +258,12 @@ object SettingsForm: TSettingsForm
Left = 134
Height = 23
Top = 8
Width = 183
Width = 216
AutoSize = True
BorderSpacing.Top = 8
BevelOuter = bvNone
ClientHeight = 23
ClientWidth = 183
ClientWidth = 216
TabOrder = 5
object rbStartToday: TRadioButton
AnchorSideLeft.Control = StartDatePanel
@ -297,7 +297,7 @@ object SettingsForm: TSettingsForm
Left = 80
Height = 23
Top = 0
Width = 103
Width = 136
CalendarDisplaySettings = [dsShowHeadings, dsShowDayNames]
OnAcceptDate = deStartDateAcceptDate
DefaultToday = True

View File

@ -80,7 +80,10 @@ implementation
procedure TSettingsForm.ControlsToSettings;
begin
GlobalSettings.StartToday := rbStartToday.Checked;
GlobalSettings.StartDate := deStartDate.Date;
if not GlobalSettings.StartToday and (GlobalSettings.StartDate = Date) then
GlobalSettings.StartDate := 0
else
GlobalSettings.StartDate := deStartDate.Date;
GlobalSettings.Hr2400 := cbTimeFormat.ItemIndex = 0;
GlobalSettings.FirstDayOfWeek := TTFDayOfWeek(cbFirstDayOfWeek.ItemIndex);
@ -99,10 +102,14 @@ end;
procedure TSettingsForm.SettingsToControls;
begin
rbStartToday.Checked := GlobalSettings.StartToday;
deStartDate.Date := GlobalSettings.StartDate;
if not rbStartToday.Checked and (deStartDate.Date <> 0) then
if GlobalSettings.StartToday then
rbStartToday.Checked := true
else
rbStartDate.Checked := true;
if GlobalSettings.StartDate = 0 then
deStartDate.Date := Date()
else
deStartDate.Date := GlobalSettings.StartDate;
cbTimeFormat.ItemIndex := ord(not GlobalSettings.Hr2400);
cbFirstDayOfWeek.ItemIndex := ord(GlobalSettings.FirstDayOfWeek);
@ -128,7 +135,7 @@ begin
try
cbFirstDayOfWeek.Clear;
for i:=1 to 7 do
cbFirstDayOfWeek.Items.Add(DefaultFormatSettings.LongDayNames[i]);
cbFirstDayOfWeek.Items.Add(FormatSettings.LongDayNames[i]);
finally
cbFirstDayOfWeek.Items.EndUpdate;
end;