jvcllaz: Use system colors in JvTFWeeks and JvTFMonths. Store more settings of demo program in ini file.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7112 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2019-08-09 22:22:02 +00:00
parent 701e4e31d5
commit 141290dc94
5 changed files with 84 additions and 53 deletions

View File

@ -22,9 +22,9 @@ object MainForm: TMainForm
Height = 515
Top = 73
Width = 477
ActivePage = TabSheet2
ActivePage = TabSheet3
Align = alClient
TabIndex = 1
TabIndex = 2
TabOrder = 0
object TabSheet1: TTabSheet
Caption = 'Day View'
@ -89,7 +89,7 @@ object MainForm: TMainForm
OnDateChanging = JvTFDays1DateChanging
OnDateChanged = JvTFDays1DateChanged
OnGranularityChanged = JvTFDays1GranularityChanged
DateFormat = 'ddddd'
DateFormat = 'dddddd'
TimeFormat = 't'
Align = alClient
Color = clWindow
@ -151,14 +151,14 @@ object MainForm: TMainForm
TitleAttr.TxtAttr.Font.Style = [fsBold]
TitleAttr.Title = 'Week of Jan 14, 2002'
CellAttr.Font.Color = clWindowText
CellAttr.TitleAttr.Color = clWhite
CellAttr.TitleAttr.FrameAttr.Color = clGray
CellAttr.TitleAttr.DayTxtAttr.Font.Color = clWindowText
CellAttr.DrawBottomLine = False
CellAttr.TitleAttr.DayTxtAttr.Font.Style = [fsBold]
CellAttr.DrawBottomLine = True
SelCellAttr.Font.Color = clWindowText
SelCellAttr.TitleAttr.Color = clNavy
SelCellAttr.TitleAttr.DayTxtAttr.Font.Color = clWhite
SelCellAttr.DrawBottomLine = False
SelCellAttr.TitleAttr.Color = clHighlight
SelCellAttr.TitleAttr.DayTxtAttr.Font.Color = clHighlightText
SelCellAttr.DrawBottomLine = True
CellPics = StateImageList
Viewer = GlanceTextViewer1
DateFormat = 'ddddd'
@ -176,7 +176,6 @@ object MainForm: TMainForm
DWNames.DWN_Friday = 'F'
DWNames.DWN_Saturday = 'S'
DWTitleAttr.Height = 20
DWTitleAttr.Visible = False
DWTitleAttr.TxtAttr.Font.Color = clWindowText
DWTitleAttr.TxtAttr.Font.Height = -11
DWTitleAttr.TxtAttr.Font.Style = [fsBold]
@ -185,21 +184,15 @@ object MainForm: TMainForm
object TabSheet3: TTabSheet
Caption = 'Month View'
ClientHeight = 487
ClientWidth = 437
ClientWidth = 469
ImageIndex = 2
object JvTFMonths1: TJvTFMonths
Left = 0
Height = 487
Top = 0
Width = 437
Width = 469
ScheduleManager = utfScheduleManager1
Cells = <
item
Color = clBlack
CellDate = 37255
CellPics = <>
CanSelect = True
end
item
Color = clBlack
CellDate = 37256
@ -445,6 +438,12 @@ object MainForm: TMainForm
CellDate = 37296
CellPics = <>
CanSelect = True
end
item
Color = clBlack
CellDate = 37297
CellPics = <>
CanSelect = True
end>
GapSize = 0
TitleAttr.TxtAttr.Font.Color = clWindowText
@ -452,13 +451,12 @@ object MainForm: TMainForm
TitleAttr.TxtAttr.Font.Style = [fsBold]
TitleAttr.Title = 'Januar 2002'
CellAttr.Font.Color = clWindowText
CellAttr.TitleAttr.Color = clWhite
CellAttr.TitleAttr.DayTxtAttr.Font.Color = clWindowText
CellAttr.DrawBottomLine = False
CellAttr.TitleAttr.DayTxtAttr.Font.Style = [fsBold]
CellAttr.DrawBottomLine = True
SelCellAttr.Font.Color = clWindowText
SelCellAttr.TitleAttr.Color = clNavy
SelCellAttr.TitleAttr.DayTxtAttr.Font.Color = clWhite
SelCellAttr.DrawBottomLine = False
SelCellAttr.TitleAttr.Color = clHighlight
SelCellAttr.TitleAttr.DayTxtAttr.Font.Color = clHighlightText
SelCellAttr.DrawBottomLine = True
Viewer = GlanceTextViewer2
DateFormat = 'ddddd'
TimeFormat = 't'
@ -475,18 +473,25 @@ object MainForm: TMainForm
DWNames.DWN_Thursday = 'T'
DWNames.DWN_Friday = 'F'
DWNames.DWN_Saturday = 'S'
DWTitleAttr.Color = clBtnShadow
DWTitleAttr.FrameAttr.Style = fs3DRaised
DWTitleAttr.Height = 20
DWTitleAttr.TxtAttr.Font.Color = clWindowText
DWTitleAttr.TxtAttr.Font.Color = clBtnHighlight
DWTitleAttr.TxtAttr.Font.Height = -11
DWTitleAttr.TxtAttr.Font.Style = [fsBold]
DWTitleAttr.TxtAttr.AlignH = taCenter
ExtraDayCellAttr.Font.Color = clWindowText
ExtraDayCellAttr.TitleAttr.Color = clWhite
ExtraDayCellAttr.TitleAttr.DayTxtAttr.Font.Color = clWindowText
ExtraDayCellAttr.DrawBottomLine = False
ExtraDayCellAttr.TitleAttr.Color = clWindow
ExtraDayCellAttr.TitleAttr.FrameAttr.Color = clSilver
ExtraDayCellAttr.TitleAttr.DayTxtAttr.Font.Color = clSilver
ExtraDayCellAttr.TitleAttr.DayTxtAttr.Font.Style = [fsBold]
ExtraDayCellAttr.DrawBottomLine = True
OffDayCellAttr.Font.Color = clWindowText
OffDayCellAttr.TitleAttr.Color = clWhite
OffDayCellAttr.TitleAttr.DayTxtAttr.Font.Color = clWindowText
OffDayCellAttr.DrawBottomLine = False
OffDayCellAttr.TitleAttr.DayTxtAttr.Font.Color = clRed
OffDayCellAttr.TitleAttr.DayTxtAttr.Font.Style = [fsBold]
OffDayCellAttr.DrawBottomLine = True
StartOfWeek = dowMonday
FirstDayOfMonthFormat = 'mmm d'
DayFormat = 'd'
end
@ -723,7 +728,7 @@ object MainForm: TMainForm
'2 mins'
'1 min'
)
OnClick = TimeIncComboChange
OnChange = TimeIncComboChange
ParentShowHint = False
ShowHint = True
Style = csDropDownList
@ -796,20 +801,22 @@ object MainForm: TMainForm
Width = 105
Anchors = [akTop, akLeft, akRight]
ItemHeight = 15
ItemIndex = 0
Items.Strings = (
'31 days'
'14 days'
'7 days'
'5 days'
'3 days'
'2 days'
'1 day'
'2 days'
'3 days'
'5 days'
'7 days'
'14 days'
'31 days'
)
OnChange = DaysComboChange
ParentShowHint = False
ShowHint = True
Style = csDropDownList
TabOrder = 12
Text = '1 day'
end
object PrintButton: TBitBtn
AnchorSideLeft.Control = DeleteApptButton

View File

@ -362,16 +362,27 @@ begin
end;
procedure TMainForm.DaysComboChange(Sender: TObject);
var
s: String;
begin
Case DaysCombo.ItemIndex of
0 : JvTFDays1.Template.LinearDayCount := 31;
1 : JvTFDays1.Template.LinearDayCount := 14;
2 : JvTFDays1.Template.LinearDayCount := 7;
0 : JvTFDays1.Template.LinearDayCount := 1;
1 : JvTFDays1.Template.LinearDayCount := 2;
2 : JvTFDays1.Template.LinearDayCount := 3;
3 : JvTFDays1.Template.LinearDayCount := 5;
4 : JvTFDays1.Template.LinearDayCount := 3;
5 : JvTFDays1.Template.LinearDayCount := 2;
6 : JvTFDays1.Template.LinearDayCount := 1;
4 : JvTFDays1.Template.LinearDayCount := 7;
5 : JvTFDays1.Template.LinearDayCount := 14;
6 : JvTFDays1.Template.LinearDayCount := 31;
End;
if JvTFDays1.Template.LinearDayCount <= 2 then
JvTFDays1.DateFormat := DefaultFormatSettings.LongDateFormat
else
if JvTFDays1.Template.LinearDayCount <= 5 then
JvTFDays1.DateFormat := DefaultFormatSettings.ShortDateFormat
else begin
s := StringReplace(DefaultFormatSettings.ShortDateFormat, 'yyyy', 'yy', [rfIgnoreCase]);
JvTFDays1.DateFormat := s;
end;
end;
procedure TMainForm.ShareButtonClick(Sender: TObject);
@ -565,12 +576,15 @@ begin
//GotoDatePicker.Date := Date;
GotoDatePicker.Date := EncodeDate(2002, 1, 1);
ReadIni;
(*
// Initialize the granularity
TimeIncCombo.ItemIndex := 1; // 30 mins
// Initialize the mode
ModeCombo.ItemIndex := 0; // Single mode
DaysCombo.ItemIndex := 6; // One day
DaysCombo.ItemIndex := 0; // One day
*)
// Populate the resource related controls
With SchedulesQuery do
@ -742,8 +756,6 @@ procedure TMainForm.FormCreate(Sender: TObject);
var
fn: String;
begin
ReadIni;
fn := Application.Location + 'data.sqlite';
dbUTF.DatabaseName := fn;
dbUTF.Connected := FileExists(fn);
@ -760,6 +772,12 @@ var
begin
ini := TMemIniFile.Create(ChangeFileExt(Application.ExeName, '.ini'));
try
PageControl1.ActivePageIndex := ini.ReadInteger('MainForm', 'PageIndex', 0);
ModeCombo.ItemIndex := ini.ReadInteger('MainForm', 'ModeCombo', 0);
TimeIncCombo.ItemIndex := ini.ReadInteger('MainForm', 'TimeIncCombo', 1);
DaysCombo.ItemIndex := ini.ReadInteger('MainForm', 'DaysCombo', 0);
GlobalSettings.Hr2400 := ini.ReadBool('Settings', 'Hr2400', GlobalSettings.Hr2400);
ApplySettings;
finally
@ -773,6 +791,12 @@ var
begin
ini := TMemIniFile.Create(ChangeFileExt(Application.ExeName, '.ini'));
try
ini.WriteInteger('MainForm', 'PageIndex', PageControl1.ActivePageIndex);
ini.WriteInteger('MainForm', 'ModeCombo', ModeCombo.ItemIndex);
ini.WriteInteger('MainForm', 'TimeIncCombo', TimeIncCombo.ItemIndex);
ini.WriteInteger('MainForm', 'DaysCombo', DaysCombo.ItemIndex);
ini.WriteBool('Settings', 'Hr2400', GlobalSettings.Hr2400);
finally
ini.Free;

View File

@ -338,7 +338,7 @@ type
procedure Assign(Source: TPersistent); override;
property GlanceControl: TJvTFCustomGlance read FGlanceControl;
published
property Color: TColor read FColor write SetColor default clWhite;
property Color: TColor read FColor write SetColor default clWindow;
property Font: TFont read FFont write SetFont;
property FrameAttr: TJvTFGlanceFrameAttr read FFrameAttr write SetFrameAttr;
property TitleAttr: TJvTFGlanceTitleAttr read FTitleAttr write SetTitleAttr;
@ -1311,8 +1311,8 @@ begin
FCellAttr := TJvTFGlanceCellAttr.Create(Self);
FCellAttr.TitleAttr.DayTxtAttr.AlignH := taLeftJustify;
FSelCellAttr := TJvTFGlanceCellAttr.Create(Self);
FSelCellAttr.TitleAttr.Color := clNavy;
FSelCellAttr.TitleAttr.DayTxtAttr.Font.Color := clWhite;
FSelCellAttr.TitleAttr.Color := clHighlight;
FSelCellAttr.TitleAttr.DayTxtAttr.Font.Color := clHighlightText;
//FSelOrder := soColMajor;
FSelOrder := soRowMajor;
@ -3247,11 +3247,12 @@ begin
inherited Create;
FGlanceControl := AOwner;
FColor := clWhite;
FColor := clWindow;
FFrameAttr := TJvTFGlanceFrameAttr.Create(AOwner);
FTitleAttr := TJvTFGlanceTitleAttr.Create(AOwner);
FFont := TFont.Create;
FFont.Color := clWindowText;
FFont.OnChange := @FontChange;
end;

View File

@ -131,9 +131,9 @@ begin
FExtraDayCellAttr := TJvTFGlanceCellAttr.Create(Self);
FOffDayCellAttr := TJvTFGlanceCellAttr.Create(Self);
CellAttr.TitleAttr.Color := clWhite;
FExtraDayCellAttr.TitleAttr.Color := clWhite;
FOffDayCellAttr.TitleAttr.Color := clWhite;
//CellAttr.TitleAttr.Color := clWhite;
//FExtraDayCellAttr.TitleAttr.Color := clWhite;
//FOffDayCellAttr.TitleAttr.Color := clWhite;
FDayFormat := 'd';
FFirstDayOfMonthFormat := 'mmm d';

View File

@ -181,7 +181,6 @@ begin
inherited Create(AOwner);
GapSize := 4;
CellAttr.TitleAttr.Color := clWhite;
CellAttr.TitleAttr.FrameAttr.Color := clGray;
FDWNames := TJvTFDWNames.Create;