jvcllaz: Activate showing several weeks in the week calendar of TvTimeFrame demo.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7118 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2019-08-11 10:15:33 +00:00
parent d794bb55c2
commit 0be5a20ecf
2 changed files with 47 additions and 13 deletions

View File

@ -22,11 +22,12 @@ object MainForm: TMainForm
Height = 515 Height = 515
Top = 73 Top = 73
Width = 477 Width = 477
ActivePage = TabSheet1 ActivePage = pgMonths
Align = alClient Align = alClient
TabIndex = 0 TabIndex = 2
TabOrder = 0 TabOrder = 0
object TabSheet1: TTabSheet OnChange = PageControl1Change
object pgDays: TTabSheet
Caption = 'Day View' Caption = 'Day View'
ClientHeight = 487 ClientHeight = 487
ClientWidth = 469 ClientWidth = 469
@ -43,7 +44,6 @@ object MainForm: TMainForm
Template.LinearEndDate = 36406 Template.LinearEndDate = 36406
Template.LinearStartDate = 36406 Template.LinearStartDate = 36406
Grouping = grNone Grouping = grNone
GroupHdrHeight = 28
GridStartTime = 0 GridStartTime = 0
GridEndTime = 0 GridEndTime = 0
TimeBlocks = <> TimeBlocks = <>
@ -105,7 +105,7 @@ object MainForm: TMainForm
OnDblClick = JvTFDays1DblClick OnDblClick = JvTFDays1DblClick
end end
end end
object TabSheet2: TTabSheet object pgWeeks: TTabSheet
Caption = 'Week View' Caption = 'Week View'
ClientHeight = 487 ClientHeight = 487
ClientWidth = 469 ClientWidth = 469
@ -162,6 +162,7 @@ object MainForm: TMainForm
TitleAttr.Title = 'Week of Jan 14, 2002' TitleAttr.Title = 'Week of Jan 14, 2002'
CellAttr.Font.Color = clWindowText CellAttr.Font.Color = clWindowText
CellAttr.FrameAttr.Color = clGray CellAttr.FrameAttr.Color = clGray
CellAttr.TitleAttr.FrameAttr.Style = fsNone
CellAttr.TitleAttr.FrameAttr.Color = clGray CellAttr.TitleAttr.FrameAttr.Color = clGray
CellAttr.TitleAttr.DayTxtAttr.Font.Color = clWindowText CellAttr.TitleAttr.DayTxtAttr.Font.Color = clWindowText
CellAttr.TitleAttr.DayTxtAttr.Font.Style = [fsBold] CellAttr.TitleAttr.DayTxtAttr.Font.Style = [fsBold]
@ -192,7 +193,7 @@ object MainForm: TMainForm
DWTitleAttr.TxtAttr.Font.Style = [fsBold] DWTitleAttr.TxtAttr.Font.Style = [fsBold]
end end
end end
object TabSheet3: TTabSheet object pgMonths: TTabSheet
Caption = 'Month View' Caption = 'Month View'
ClientHeight = 487 ClientHeight = 487
ClientWidth = 469 ClientWidth = 469
@ -902,6 +903,23 @@ object MainForm: TMainForm
Spacing = 0 Spacing = 0
TabOrder = 14 TabOrder = 14
end end
object WeeksCombo: TComboBox
Left = 351
Height = 23
Top = 48
Width = 100
ItemHeight = 15
Items.Strings = (
'1 week'
'2 weeks'
'3 weeks'
'4 weeks'
)
OnChange = WeeksComboChange
Style = csDropDownList
TabOrder = 15
Visible = False
end
end end
object Panel2: TPanel object Panel2: TPanel
Left = 0 Left = 0
@ -1697,8 +1715,6 @@ object MainForm: TMainForm
PrimeTime.EndTime = 0.708333333333333 PrimeTime.EndTime = 0.708333333333333
PrimeTime.Color = clYellow PrimeTime.Color = clYellow
RowHdrType = rhGrid RowHdrType = rhGrid
RowHdrWidth = 0
RowHeight = 0
ShowPics = False ShowPics = False
ShowText = False ShowText = False
TimeFormat = 't' TimeFormat = 't'

View File

@ -46,6 +46,7 @@ type
{ TMainForm } { TMainForm }
TMainForm = class(TForm) TMainForm = class(TForm)
WeeksCombo: TComboBox;
ImageList: TImageList; ImageList: TImageList;
JvTFDaysPrinter1: TJvTFDaysPrinter; JvTFDaysPrinter1: TJvTFDaysPrinter;
IconsProvidedLabel: TLabel; IconsProvidedLabel: TLabel;
@ -62,9 +63,9 @@ type
DeleteApptQuery: TSQLQuery; DeleteApptQuery: TSQLQuery;
SchedulesQuery: TSQLQuery; SchedulesQuery: TSQLQuery;
PageControl1: TPageControl; PageControl1: TPageControl;
TabSheet1: TTabSheet; pgDays: TTabSheet;
TabSheet2: TTabSheet; pgWeeks: TTabSheet;
TabSheet3: TTabSheet; pgMonths: TTabSheet;
JvTFDays1: TJvTFDays; JvTFDays1: TJvTFDays;
JvTFWeeks1: TJvTFWeeks; JvTFWeeks1: TJvTFWeeks;
JvTFMonths1: TJvTFMonths; JvTFMonths1: TJvTFMonths;
@ -94,6 +95,7 @@ type
procedure IconsLinkMouseLeave(Sender: TObject); procedure IconsLinkMouseLeave(Sender: TObject);
procedure ModeComboChange(Sender: TObject); procedure ModeComboChange(Sender: TObject);
procedure PageControl1Change(Sender: TObject);
procedure SettingsButtonClick(Sender: TObject); procedure SettingsButtonClick(Sender: TObject);
procedure ViewSchedsButtonClick(Sender: TObject); procedure ViewSchedsButtonClick(Sender: TObject);
procedure HideSchedButtonClick(Sender: TObject); procedure HideSchedButtonClick(Sender: TObject);
@ -133,6 +135,7 @@ type
procedure FormShow(Sender: TObject); procedure FormShow(Sender: TObject);
procedure PrintButtonClick(Sender: TObject); procedure PrintButtonClick(Sender: TObject);
procedure WeeksComboChange(Sender: TObject);
private private
{ Private declarations } { Private declarations }
@ -320,6 +323,11 @@ begin
VisibleResources.ShowModal; VisibleResources.ShowModal;
end; end;
procedure TMainForm.WeeksComboChange(Sender: TObject);
begin
JvTFWeeks1.WeekCount := WeeksCombo.ItemIndex + 1;
end;
procedure TMainForm.HideSchedButtonClick(Sender: TObject); procedure TMainForm.HideSchedButtonClick(Sender: TObject);
var var
I, I,
@ -414,6 +422,13 @@ begin
JvTFWeeks1.DisplayDate := JvTFDays1.CurrentDate; JvTFWeeks1.DisplayDate := JvTFDays1.CurrentDate;
end; end;
procedure TMainForm.PageControl1Change(Sender: TObject);
begin
WeeksCombo.BoundsRect := DaysCombo.BoundsRect;
WeeksCombo.Visible := PageControl1.ActivePage = pgWeeks;
DaysCombo.Visible := PageControl1.ActivePage = pgDays;
end;
procedure TMainForm.GotoDatePickerChange(Sender: TObject); procedure TMainForm.GotoDatePickerChange(Sender: TObject);
begin begin
// GotoDatePicker.OnCloseUp should also point to this handler // GotoDatePicker.OnCloseUp should also point to this handler
@ -779,11 +794,13 @@ var
begin begin
ini := TMemIniFile.Create(ChangeFileExt(Application.ExeName, '.ini')); ini := TMemIniFile.Create(ChangeFileExt(Application.ExeName, '.ini'));
try try
PageControl1.ActivePageIndex := ini.ReadInteger('MainForm', 'PageIndex', 0);
ModeCombo.ItemIndex := ini.ReadInteger('MainForm', 'ModeCombo', 0); ModeCombo.ItemIndex := ini.ReadInteger('MainForm', 'ModeCombo', 0);
TimeIncCombo.ItemIndex := ini.ReadInteger('MainForm', 'TimeIncCombo', 1); TimeIncCombo.ItemIndex := ini.ReadInteger('MainForm', 'TimeIncCombo', 1);
DaysCombo.ItemIndex := ini.ReadInteger('MainForm', 'DaysCombo', 0); DaysCombo.ItemIndex := ini.ReadInteger('MainForm', 'DaysCombo', 0);
WeeksCombo.ItemIndex := ini.ReadInteger('MainForm', 'WeeksCombo', 0);
PageControl1.ActivePageIndex := ini.ReadInteger('MainForm', 'PageIndex', 0);
PageControl1Change(nil);
GlobalSettings.Hr2400 := ini.ReadBool('Settings', 'Hr2400', GlobalSettings.Hr2400); GlobalSettings.Hr2400 := ini.ReadBool('Settings', 'Hr2400', GlobalSettings.Hr2400);
GlobalSettings.FirstDayOfWeek := TTFDayofWeek(ini.ReadInteger('Settings', 'FirstDayOfWeek', ord(GlobalSettings.FirstDayOfWeek))); GlobalSettings.FirstDayOfWeek := TTFDayofWeek(ini.ReadInteger('Settings', 'FirstDayOfWeek', ord(GlobalSettings.FirstDayOfWeek)));
@ -807,6 +824,7 @@ begin
ini.WriteInteger('MainForm', 'ModeCombo', ModeCombo.ItemIndex); ini.WriteInteger('MainForm', 'ModeCombo', ModeCombo.ItemIndex);
ini.WriteInteger('MainForm', 'TimeIncCombo', TimeIncCombo.ItemIndex); ini.WriteInteger('MainForm', 'TimeIncCombo', TimeIncCombo.ItemIndex);
ini.WriteInteger('MainForm', 'DaysCombo', DaysCombo.ItemIndex); ini.WriteInteger('MainForm', 'DaysCombo', DaysCombo.ItemIndex);
ini.WriteInteger('MainForm', 'WeeksCombo', WeeksCombo.ItemIndex);
ini.WriteBool('Settings', 'Hr2400', GlobalSettings.Hr2400); ini.WriteBool('Settings', 'Hr2400', GlobalSettings.Hr2400);
ini.WriteInteger('Settings', 'FirstDayOfWeek', ord(GlobalSettings.FirstDayOfWeek)); ini.WriteInteger('Settings', 'FirstDayOfWeek', ord(GlobalSettings.FirstDayOfWeek));