tvplanit: Default values for visual controls (day/week/month view, tasklist, contact grid, calendar).

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8365 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2022-07-25 22:55:31 +00:00
parent b664097af4
commit c778149181
9 changed files with 102 additions and 122 deletions

View File

@ -7,7 +7,6 @@ object Form1: TForm1
ClientHeight = 686 ClientHeight = 686
ClientWidth = 980 ClientWidth = 980
OnCreate = FormCreate OnCreate = FormCreate
LCLVersion = '2.3.0.0'
object Panel1: TPanel object Panel1: TPanel
Left = 0 Left = 0
Height = 33 Height = 33
@ -95,10 +94,7 @@ object Form1: TForm1
Width = 301 Width = 301
DataStore = VpIniDatastore1 DataStore = VpIniDatastore1
ControlLink = VpControlLink1 ControlLink = VpControlLink1
Color = clWindow
Align = alLeft Align = alLeft
ReadOnly = False
TabStop = True
TabOrder = 0 TabOrder = 0
AllDayEventAttributes.BackgroundColor = clBtnShadow AllDayEventAttributes.BackgroundColor = clBtnShadow
AllDayEventAttributes.EventBorderColor = cl3DDkShadow AllDayEventAttributes.EventBorderColor = cl3DDkShadow
@ -117,13 +113,6 @@ object Form1: TForm1
RowHeadAttributes.HourFont.Height = -24 RowHeadAttributes.HourFont.Height = -24
RowHeadAttributes.MinuteFont.Height = -12 RowHeadAttributes.MinuteFont.Height = -12
RowHeadAttributes.Color = clBtnFace RowHeadAttributes.Color = clBtnFace
ShowResourceName = True
LineColor = clGray
GutterWidth = 7
DateLabelFormat = 'dddd, mmmm dd, yyyy'
Granularity = gr30Min
DefaultTopHour = h_07
TimeFormat = tf12Hour
end end
object Panel2: TPanel object Panel2: TPanel
Left = 306 Left = 306
@ -143,24 +132,16 @@ object Form1: TForm1
Width = 386 Width = 386
DataStore = VpIniDatastore1 DataStore = VpIniDatastore1
ControlLink = VpControlLink1 ControlLink = VpControlLink1
Color = clWindow
AllDayEventAttributes.BackgroundColor = clWindow AllDayEventAttributes.BackgroundColor = clWindow
AllDayEventAttributes.EventBorderColor = clGray AllDayEventAttributes.EventBorderColor = clGray
AllDayEventAttributes.EventBackgroundColor = clBtnFace AllDayEventAttributes.EventBackgroundColor = clBtnFace
DateLabelFormat = 'dddd, mmmm dd, yyyy'
DayHeadAttributes.Color = clBtnFace DayHeadAttributes.Color = clBtnFace
DayHeadAttributes.DateFormat = 'dddd mmmm, dd'
DayHeadAttributes.Font.Height = -13 DayHeadAttributes.Font.Height = -13
DayHeadAttributes.Font.Name = 'Tahoma' DayHeadAttributes.Font.Name = 'Tahoma'
DayHeadAttributes.Bordered = True
DrawingStyle = dsFlat DrawingStyle = dsFlat
HeadAttributes.Color = clBtnFace HeadAttributes.Color = clBtnFace
LineColor = clGray
TimeFormat = tf12Hour
ShowEventTime = True
WeekStartsOn = dtMonday WeekStartsOn = dtMonday
Align = alClient Align = alClient
TabStop = True
TabOrder = 0 TabOrder = 0
end end
object VpMonthView1: TVpMonthView object VpMonthView1: TVpMonthView
@ -170,28 +151,17 @@ object Form1: TForm1
Width = 386 Width = 386
DataStore = VpIniDatastore1 DataStore = VpIniDatastore1
ControlLink = VpControlLink1 ControlLink = VpControlLink1
Color = clWindow
Align = alBottom Align = alBottom
TabStop = True
TabOrder = 1 TabOrder = 1
DateLabelFormat = 'mmmm yyyy'
DayHeadAttributes.Font.Height = -13 DayHeadAttributes.Font.Height = -13
DayHeadAttributes.Font.Name = 'Tahoma' DayHeadAttributes.Font.Name = 'Tahoma'
DayHeadAttributes.Color = clBtnFace DayHeadAttributes.Color = clBtnFace
DayNameStyle = dsShort
DrawingStyle = dsFlat DrawingStyle = dsFlat
EventDayStyle = []
HeadAttributes.Color = clBtnFace HeadAttributes.Color = clBtnFace
KBNavigation = True
OffDayColor = clSilver OffDayColor = clSilver
SelectedDayColor = clRed
ShowEvents = True
ShowEventTime = False
TimeFormat = tf12Hour
TodayAttributes.Color = clSilver TodayAttributes.Color = clSilver
TodayAttributes.BorderPen.Color = clRed TodayAttributes.BorderPen.Color = clRed
TodayAttributes.BorderPen.Width = 3 TodayAttributes.BorderPen.Width = 3
WeekStartsOn = dtSunday
end end
object Splitter2: TSplitter object Splitter2: TSplitter
Cursor = crVSplit Cursor = crVSplit
@ -210,11 +180,8 @@ object Form1: TForm1
Width = 275 Width = 275
DataStore = VpIniDatastore1 DataStore = VpIniDatastore1
ControlLink = VpControlLink1 ControlLink = VpControlLink1
Color = clWindow
Align = alClient Align = alClient
TabStop = True
TabOrder = 2 TabOrder = 2
ReadOnly = False
DisplayOptions.CheckBGColor = clWindow DisplayOptions.CheckBGColor = clWindow
DisplayOptions.CheckColor = cl3DDkShadow DisplayOptions.CheckColor = cl3DDkShadow
DisplayOptions.CheckStyle = csCheck DisplayOptions.CheckStyle = csCheck
@ -225,11 +192,9 @@ object Form1: TForm1
DisplayOptions.OverdueColor = clRed DisplayOptions.OverdueColor = clRed
DisplayOptions.NormalColor = clBlack DisplayOptions.NormalColor = clBlack
DisplayOptions.CompletedColor = clGray DisplayOptions.CompletedColor = clGray
LineColor = clGray
MaxVisibleTasks = 250 MaxVisibleTasks = 250
TaskHeadAttributes.Color = clSilver TaskHeadAttributes.Color = clSilver
DrawingStyle = dsFlat DrawingStyle = dsFlat
ShowResourceName = True
end end
object Splitter1: TSplitter object Splitter1: TSplitter
Left = 692 Left = 692
@ -264,13 +229,8 @@ object Form1: TForm1
Width = 932 Width = 932
DataStore = VpIniDatastore1 DataStore = VpIniDatastore1
ControlLink = VpControlLink1 ControlLink = VpControlLink1
Color = clWindow
Align = alClient Align = alClient
TabStop = True
TabOrder = 1 TabOrder = 1
AllowInPlaceEditing = True
BarWidth = 3
BarColor = clSilver
ColumnWidth = 200 ColumnWidth = 200
ContactHeadAttributes.Color = clSilver ContactHeadAttributes.Color = clSilver
ContactHeadAttributes.Bordered = True ContactHeadAttributes.Bordered = True
@ -323,8 +283,6 @@ object Form1: TForm1
CategoryColorMap.Category9.Description = 'Category 9' CategoryColorMap.Category9.Description = 'Category 9'
HiddenCategories.BackgroundColor = clSilver HiddenCategories.BackgroundColor = clSilver
HiddenCategories.Color = clGray HiddenCategories.Color = clGray
EnableEventTimer = True
PlayEventSounds = True
AutoConnect = True AutoConnect = True
FileName = 'data.ini' FileName = 'data.ini'
Left = 136 Left = 136

View File

@ -100,7 +100,8 @@ begin
if datastore.Resources.Count > 0 then if datastore.Resources.Count > 0 then
begin begin
lastRes := datastore.Resources.Items[datastore.Resources.Count-1]; lastRes := datastore.Resources.Items[datastore.Resources.Count-1];
datastore.ResourceID := lastRes.ResourceID; datastore.Resource := lastRes;
// datastore.ResourceID := lastRes.ResourceID;
end; end;
end; end;

View File

@ -278,13 +278,14 @@ type
{$IFDEF LCL} {$IFDEF LCL}
property BorderSpacing; property BorderSpacing;
{$ENDIF} {$ENDIF}
property BorderStyle: TBorderStyle read FBorderStyle write SetBorderStyle; property BorderStyle: TBorderStyle read FBorderStyle write SetBorderStyle default bsNone;
property Color; property Color;
property Colors: TVpCalColors read FColors write FColors; property Colors: TVpCalColors read FColors write FColors;
property Date: TDateTime read FDate write SetDate; property Date: TDateTime read FDate write SetDate;
property DateFormat: TVpDateFormat read FDateFormat write SetDateFormat; property DateFormat: TVpDateFormat read FDateFormat write SetDateFormat default dfLong;
property DayNameWidth: TVpDayNameWidth read FDayNameWidth write SetDayNameWidth; property DayNameWidth: TVpDayNameWidth read FDayNameWidth write SetDayNameWidth;
property Options: TVpCalDisplayOptions read FOptions write SetDisplayOptions; property Options: TVpCalDisplayOptions read FOptions write SetDisplayOptions
default [cdoHighlightSat, cdoHighlightSun, cdoShortNames, cdoShowNavBtns, cdoShowRevert, cdoShowToday, cdoShowYear];
property ReadOnly: Boolean read FReadOnly write FReadOnly; property ReadOnly: Boolean read FReadOnly write FReadOnly;
property WantDblClicks: Boolean read FWantDblClicks write SetWantDblClicks; property WantDblClicks: Boolean read FWantDblClicks write SetWantDblClicks;
property WeekStarts: TVpDayType read FWeekStarts write SetWeekStarts; property WeekStarts: TVpDayType read FWeekStarts write SetWeekStarts;

View File

@ -44,7 +44,7 @@ uses
{$ELSE} {$ELSE}
Windows, Windows,
{$ENDIF} {$ENDIF}
Forms, StdCtrls; Graphics, Forms, StdCtrls;
const const
BuildTime = {$I %DATE%} + {$I %TIME}; //'09/13/2002 09:25 AM'; BuildTime = {$I %DATE%} + {$I %TIME}; //'09/13/2002 09:25 AM';
@ -259,6 +259,9 @@ const
CONDITIONAL_INCLUDE = 0; CONDITIONAL_INCLUDE = 0;
CONDITIONAL_IGNORE = 1; CONDITIONAL_IGNORE = 1;
DEFAULT_COLOR = clWindow;
DEFAULT_LINECOLOR = clSilver;
{ Version numbers } { Version numbers }
VpXSLImplementation = 0.0; VpXSLImplementation = 0.0;
VpXMLSpecification = '1.0'; VpXMLSpecification = '1.0';

View File

@ -265,18 +265,22 @@ type
{$IFDEF LCL} {$IFDEF LCL}
property BorderSpacing; property BorderSpacing;
{$ENDIF} {$ENDIF}
property TabStop; property TabStop default true;
property TabOrder; property TabOrder;
property AllowInPlaceEditing: Boolean property AllowInPlaceEditing: Boolean
read FAllowInPlaceEdit write FAllowInPlaceEdit; read FAllowInPlaceEdit write FAllowInPlaceEdit default true;
property BarWidth: Integer read GetBarWidth write SetBarWidth; property BarWidth: Integer
property BarColor: TColor read FBarColor write SetBarColor; read GetBarWidth write SetBarWidth default 3;
property Color: TColor read FColor write SetColor; property BarColor: TColor
property ColumnWidth: Integer read FColumnWidth write SetColumnWidth; read FBarColor write SetBarColor default DEFAULT_LINECOLOR;
property Color: TColor
read FColor write SetColor default DEFAULT_COLOR;
property ColumnWidth: Integer
read FColumnWidth write SetColumnWidth default 145;
property ContactHeadAttributes: TVpContactHeadAttr property ContactHeadAttributes: TVpContactHeadAttr
read FContactHeadAttr write FContactHeadAttr; read FContactHeadAttr write FContactHeadAttr;
property DrawingStyle: TVpDrawingStyle property DrawingStyle: TVpDrawingStyle
read FDrawingStyle write SetDrawingStyle; read FDrawingStyle write SetDrawingStyle default ds3d;
property HintMode: TVpHintMode property HintMode: TVpHintMode
read FHintMode write FHintMode default hmPlannerHint; read FHintMode write FHintMode default hmPlannerHint;
property PrintNumColumns: Integer property PrintNumColumns: Integer
@ -467,8 +471,8 @@ begin
cgCreatingEditor := false; cgCreatingEditor := false;
FDrawingStyle := ds3d; FDrawingStyle := ds3d;
cgPainting := false; cgPainting := false;
FColor := clWindow; FColor := DEFAULT_COLOR;
FBarColor := clSilver; FBarColor := DEFAULT_LINECOLOR;
BarWidth := 3; BarWidth := 3;
FColumnWidth := 145; FColumnWidth := 145;
FContactIndex := -1; FContactIndex := -1;

View File

@ -238,6 +238,7 @@ type
FHintMode: TVpHintMode; FHintMode: TVpHintMode;
FMouseEvent: TVpEvent; FMouseEvent: TVpEvent;
FOnHoliday: TVpHolidayEvent; FOnHoliday: TVpHolidayEvent;
function IsStoredDateLabelFormat: Boolean;
protected{ private } protected{ private }
FGranularity: TVpGranularity; FGranularity: TVpGranularity;
@ -487,8 +488,8 @@ type
property BorderSpacing; property BorderSpacing;
{$ENDIF} {$ENDIF}
property Constraints; property Constraints;
property ReadOnly; property ReadOnly default false;
property TabStop; property TabStop default true;
property TabOrder; property TabOrder;
property Font; property Font;
property AllDayEventAttributes: TVpAllDayEventAttributes read FAllDayEventAttr write FAllDayEventAttr; property AllDayEventAttributes: TVpAllDayEventAttributes read FAllDayEventAttr write FAllDayEventAttr;
@ -497,22 +498,22 @@ type
property DotDotDotColor: TColor read FDotDotDotColor write SetDotDotDotColor default clBlack; property DotDotDotColor: TColor read FDotDotDotColor write SetDotDotDotColor default clBlack;
property ShowEventTimes: Boolean read FShowEventTimes write SetShowEventTimes default true; property ShowEventTimes: Boolean read FShowEventTimes write SetShowEventTimes default true;
property DragDropTransparent: Boolean read FDragDropTransparent write FDragDropTransparent default false; property DragDropTransparent: Boolean read FDragDropTransparent write FDragDropTransparent default false;
property DrawingStyle: TVpDrawingStyle read FDrawingStyle write SetDrawingStyle stored True; property DrawingStyle: TVpDrawingStyle read FDrawingStyle write SetDrawingStyle default ds3d;
property TimeSlotColors: TVpTimeSlotColor read FTimeSlotColors write FTimeSlotColors; property TimeSlotColors: TVpTimeSlotColor read FTimeSlotColors write FTimeSlotColors;
property HeadAttributes: TVpCHAttributes read FHeadAttr write FHeadAttr; property HeadAttributes: TVpCHAttributes read FHeadAttr write FHeadAttr;
property RowHeadAttributes: TVpRHAttributes read FRowHeadAttr write FRowHeadAttr; property RowHeadAttributes: TVpRHAttributes read FRowHeadAttr write FRowHeadAttr;
property IconAttributes: TVpDayViewIconAttributes read FIconAttributes write FIconAttributes; property IconAttributes: TVpDayViewIconAttributes read FIconAttributes write FIconAttributes;
property Color: TColor read FColor write SetColor; property Color: TColor read FColor write SetColor default DEFAULT_COLOR;
property OwnerDrawRowHeader: TVpOwnerDrawRowEvent read FOwnerDrawRowHead write FOwnerDrawRowHead; property OwnerDrawRowHeader: TVpOwnerDrawRowEvent read FOwnerDrawRowHead write FOwnerDrawRowHead;
property OwnerDrawColHeader: TVpOwnerDrawEvent read FOwnerDrawColHead write FOwnerDrawColHead; property OwnerDrawColHeader: TVpOwnerDrawEvent read FOwnerDrawColHead write FOwnerDrawColHead;
property OwnerDrawCells: TVpOwnerDrawRowEvent read FOwnerDrawCells write FOwnerDrawCells; property OwnerDrawCells: TVpOwnerDrawRowEvent read FOwnerDrawCells write FOwnerDrawCells;
property ShowResourceName: Boolean read FShowResourceName write SetShowResourceName; property ShowResourceName: Boolean read FShowResourceName write SetShowResourceName default true;
property LineColor: TColor read FLineColor write SetLineColor; property LineColor: TColor read FLineColor write SetLineColor default DEFAULT_LINECOLOR;
property GutterWidth: Integer read FGutterWidth write SetGutterWidth; property GutterWidth: Integer read FGutterWidth write SetGutterWidth default 7;
property DateLabelFormat: string read FDateLabelFormat write SetDateLabelFormat; property DateLabelFormat: string read FDateLabelFormat write SetDateLabelFormat stored IsStoredDateLabelFormat;
Property Granularity: TVpGranularity read FGranularity write SetGranularity; Property Granularity: TVpGranularity read FGranularity write SetGranularity default gr30Min;
property DefaultTopHour: TVpHours read FDefTopHour write SetDefTopHour; property DefaultTopHour: TVpHours read FDefTopHour write SetDefTopHour default h_07;
property TimeFormat: TVpTimeFormat read FTimeFormat write SetTimeFormat; property TimeFormat: TVpTimeFormat read FTimeFormat write SetTimeFormat default tf12Hour;
property IncludeWeekends: Boolean read FIncludeWeekends write SetIncludeWeekends default True; property IncludeWeekends: Boolean read FIncludeWeekends write SetIncludeWeekends default True;
property NumDays: Integer read FNumDays write SetNumDays default 1; property NumDays: Integer read FNumDays write SetNumDays default 1;
property WrapStyle: TVpDVWrapStyle read FWrapStyle Write SetWrapStyle default wsIconFlow; property WrapStyle: TVpDVWrapStyle read FWrapStyle Write SetWrapStyle default wsIconFlow;
@ -830,8 +831,8 @@ begin
dvPainting := false; dvPainting := false;
FShowNavButtons := true; FShowNavButtons := true;
FShowResourceName := true; FShowResourceName := true;
FColor := clWindow; FColor := DEFAULT_COLOR;
FLineColor := clGray; FLineColor := DEFAULT_LINECOLOR;
Granularity := gr30min; Granularity := gr30min;
FDefTopHour := h_07; FDefTopHour := h_07;
FDisplayDate := Now; FDisplayDate := Now;
@ -1829,7 +1830,11 @@ begin
SetVScrollPos; SetVScrollPos;
end; end;
end; end;
{=====}
function TVpDayView.IsStoredDateLabelFormat: Boolean;
begin
Result := FDateLabeLFormat <> 'dddddd';
end;
procedure TVpDayView.SetDateLabelFormat(Value: string); procedure TVpDayView.SetDateLabelFormat(Value: string);
begin begin
@ -1838,7 +1843,6 @@ begin
Invalidate; Invalidate;
end; end;
end; end;
{=====}
procedure TVpDayView.SetGutterWidth(Value: Integer); procedure TVpDayView.SetGutterWidth(Value: Integer);
begin begin

View File

@ -147,6 +147,7 @@ type
FAllowDragAndDrop: Boolean; FAllowDragAndDrop: Boolean;
FDragDropTransparent: Boolean; FDragDropTransparent: Boolean;
FApplyCategoryInfos: Boolean; FApplyCategoryInfos: Boolean;
function IsStoredDateLabelFormat: Boolean;
procedure SetApplyCategoryInfos(AValue: Boolean); procedure SetApplyCategoryInfos(AValue: Boolean);
protected{ private } protected{ private }
FKBNavigate: Boolean; FKBNavigate: Boolean;
@ -313,37 +314,37 @@ type
{$IFDEF LCL} {$IFDEF LCL}
property BorderSpacing; property BorderSpacing;
{$ENDIF} {$ENDIF}
property TabStop; property TabStop default true;
property TabOrder; property TabOrder;
property AllowDragAndDrop: Boolean read FAllowDragAndDrop write FAllowDragAndDrop default false; property AllowDragAndDrop: Boolean read FAllowDragAndDrop write FAllowDragAndDrop default false;
property ApplyCategoryInfos: Boolean read FApplyCategoryInfos write SetApplyCategoryInfos default false; property ApplyCategoryInfos: Boolean read FApplyCategoryInfos write SetApplyCategoryInfos default false;
property Color: TColor read FColor write SetColor; property Color: TColor read FColor write SetColor default DEFAULT_COLOR;
property DateLabelFormat: string read FDateLabelFormat write SetDateLabelFormat; property DateLabelFormat: string read FDateLabelFormat write SetDateLabelFormat stored IsStoredDateLabelFormat;
property DayHeadAttributes: TVpMonthviewAttr read FDayHeadAttr write FDayHeadAttr; property DayHeadAttributes: TVpMonthviewAttr read FDayHeadAttr write FDayHeadAttr;
property DayNameStyle: TVpMVDayNameStyle read FDayNameStyle write SetDayNameStyle; property DayNameStyle: TVpMVDayNameStyle read FDayNameStyle write SetDayNameStyle default dsShort;
property DayNumberFont: TVpFont read FDayNumberFont write SetDayNumberFont; property DayNumberFont: TVpFont read FDayNumberFont write SetDayNumberFont;
property DragDropTransparent: Boolean read FDragDropTransparent write FDragDropTransparent default false; property DragDropTransparent: Boolean read FDragDropTransparent write FDragDropTransparent default false;
property DrawingStyle: TVpDrawingStyle read FDrawingStyle write SetDrawingStyle stored True; property DrawingStyle: TVpDrawingStyle read FDrawingStyle write SetDrawingStyle default ds3d;
property EventDayStyle: TFontStyles read FEventDayStyle write SetEventDayStyle; property EventDayStyle: TFontStyles read FEventDayStyle write SetEventDayStyle default [];
property EventFont: TVpFont read FEventFont write SetEventFont; property EventFont: TVpFont read FEventFont write SetEventFont;
// property HeadAttributes: TVpMvHeadAttr read FHeadAttr write FHeadAttr; // property HeadAttributes: TVpMvHeadAttr read FHeadAttr write FHeadAttr;
property HeadAttributes: TVpMonthViewAttr read FHeadAttr write FHeadAttr; property HeadAttributes: TVpMonthViewAttr read FHeadAttr write FHeadAttr;
property HolidayAttributes: TVpMvHolidayAttr read FHolidayAttr write FHolidayAttr; property HolidayAttributes: TVpMvHolidayAttr read FHolidayAttr write FHolidayAttr;
property HintMode: TVpHintMode read FHintMode write FHintMode default hmPlannerHint; property HintMode: TVpHintMode read FHintMode write FHintMode default hmPlannerHint;
property KBNavigation: Boolean read FKBNavigate write FKBNavigate; property KBNavigation: Boolean read FKBNavigate write FKBNavigate default true;
property LineColor: TColor read FLineColor write SetLineColor default clGray; property LineColor: TColor read FLineColor write SetLineColor default DEFAULT_LINECOLOR;
property OffDayColor: TColor read FOffDayColor write SetOffDayColor default OFF_COLOR; property OffDayColor: TColor read FOffDayColor write SetOffDayColor default OFF_COLOR;
property OffDayFontColor: TColor read FOffDayFontColor write SetOffDayFontColor default clGray; property OffDayFontColor: TColor read FOffDayFontColor write SetOffDayFontColor default clGray;
property OwnerDrawCells: TVpOwnerDrawDayEvent read FOwnerDrawCells write FOwnerDrawCells; property OwnerDrawCells: TVpOwnerDrawDayEvent read FOwnerDrawCells write FOwnerDrawCells;
property RightClickChangeDate: Boolean property RightClickChangeDate: Boolean
read FRightClickChangeDate write SetRightClickChangeDate default vpDefWVRClickChangeDate; read FRightClickChangeDate write SetRightClickChangeDate default vpDefWVRClickChangeDate;
property SelectedDayColor: TColor read FSelectedDayColor write SetSelectedDayColor; property SelectedDayColor: TColor read FSelectedDayColor write SetSelectedDayColor default clRed;
property ShowEvents: Boolean read FShowEvents write SetShowEvents; property ShowEvents: Boolean read FShowEvents write SetShowEvents default true;
property ShowEventTime: Boolean read FShowEventTime write SetShowEventTime; property ShowEventTime: Boolean read FShowEventTime write SetShowEventTime default false;
property TimeFormat: TVpTimeFormat read FTimeFormat write SetTimeFormat; property TimeFormat: TVpTimeFormat read FTimeFormat write SetTimeFormat default tf12Hour;
property TodayAttributes: TVpMvTodayAttr read FTodayAttr write FTodayAttr; property TodayAttributes: TVpMvTodayAttr read FTodayAttr write FTodayAttr;
property WeekendAttributes: TVpMvWeekendAttr read FWeekendAttr write FWeekendAttr; property WeekendAttributes: TVpMvWeekendAttr read FWeekendAttr write FWeekendAttr;
property WeekStartsOn: TVpDayType read FWeekStartsOn write SetWeekStartsOn; property WeekStartsOn: TVpDayType read FWeekStartsOn write SetWeekStartsOn default dtSunday;
{events} {events}
property OnAddEvent: TVpOnAddNewEvent read FOnAddEvent write FOnAddEvent; property OnAddEvent: TVpOnAddNewEvent read FOnAddEvent write FOnAddEvent;
property OnEventClick: TVpOnEventClick read FOnEventClick write FOnEventClick; property OnEventClick: TVpOnEventClick read FOnEventClick write FOnEventClick;
@ -489,8 +490,8 @@ begin
FSelectedDayColor := clRed; FSelectedDayColor := clRed;
FDrawingStyle := ds3d; FDrawingStyle := ds3d;
// mvPainting := false; // mvPainting := false;
FColor := clWindow; FColor := DEFAULT_COLOR;
FLineColor := clGray; FLineColor := DEFAULT_LINECOLOR;
FDate := Trunc(Now); FDate := Trunc(Now);
FTimeFormat := tf12Hour; FTimeFormat := tf12Hour;
FDateLabelFormat := 'mmmm yyyy'; FDateLabelFormat := 'mmmm yyyy';
@ -816,6 +817,11 @@ begin
Invalidate; Invalidate;
end; end;
function TVpMonthView.IsStoredDateLabelFormat: Boolean;
begin
Result := FDateLabelFormat <> 'mmmm yyyy';
end;
procedure TVpMonthView.SetDateLabelFormat(Value: string); procedure TVpMonthView.SetDateLabelFormat(Value: string);
begin begin
if Value <> FDateLabelFormat then begin if Value <> FDateLabelFormat then begin

View File

@ -235,9 +235,9 @@ type
property Align; property Align;
property Anchors; property Anchors;
property Font; property Font;
property TabStop; property TabStop default true;
property TabOrder; property TabOrder;
property ReadOnly; property ReadOnly default false;
{$IFDEF LCL} {$IFDEF LCL}
property BorderSpacing; property BorderSpacing;
{$ENDIF} {$ENDIF}
@ -245,13 +245,13 @@ type
property AllowInplaceEditing: Boolean property AllowInplaceEditing: Boolean
read FAllowInplaceEdit write FAllowInplaceEdit default true; read FAllowInplaceEdit write FAllowInplaceEdit default true;
property DisplayOptions: TVpTaskDisplayOptions read FDisplayOptions write FDisplayOptions; property DisplayOptions: TVpTaskDisplayOptions read FDisplayOptions write FDisplayOptions;
property LineColor: TColor read FLineColor write SetLineColor; property LineColor: TColor read FLineColor write SetLineColor default DEFAULT_LINECOLOR;
property MaxVisibleTasks: Word read FMaxVisibleTasks write SetMaxVisibleTasks; property MaxVisibleTasks: Word read FMaxVisibleTasks write SetMaxVisibleTasks;
property TaskHeadAttributes: TVpTaskHeadAttr read FTaskHeadAttr write FTaskHeadAttr; property TaskHeadAttributes: TVpTaskHeadAttr read FTaskHeadAttr write FTaskHeadAttr;
property DrawingStyle: TVpDrawingStyle read FDrawingStyle write SetDrawingStyle; property DrawingStyle: TVpDrawingStyle read FDrawingStyle write SetDrawingStyle default ds3d;
property Color: TColor read FColor write SetColor; property Color: TColor read FColor write SetColor default DEFAULT_COLOR;
property ShowIcon: Boolean read FShowIcon write SetShowIcon default True; property ShowIcon: Boolean read FShowIcon write SetShowIcon default True;
property ShowResourceName: Boolean read FShowResourceName write SetShowResourceName; property ShowResourceName: Boolean read FShowResourceName write SetShowResourceName default true;
{ events } { events }
property BeforeEdit: TVpBeforeEditTask read FBeforeEdit write FBeforeEdit; property BeforeEdit: TVpBeforeEditTask read FBeforeEdit write FBeforeEdit;
property AfterEdit: TVpAfterEditTask read FAfterEdit write FAfterEdit; property AfterEdit: TVpAfterEditTask read FAfterEdit write FAfterEdit;
@ -519,8 +519,8 @@ begin
FDrawingStyle := ds3d; FDrawingStyle := ds3d;
tlPainting := false; tlPainting := false;
FShowResourceName := true; FShowResourceName := true;
FColor := clWindow; FColor := DEFAULT_COLOR;
FLineColor := clGray; FLineColor := DEFAULT_LINECOLOR;
FScrollBars := ssVertical; FScrollBars := ssVertical;
FTaskIndex := -1; FTaskIndex := -1;
FShowIcon := True; FShowIcon := True;

View File

@ -107,6 +107,7 @@ type
FDateFormat: string; FDateFormat: string;
FColor: TColor; FColor: TColor;
FBordered: Boolean; FBordered: Boolean;
function IsStoredDateFormat: Boolean;
procedure SetColor(Value: TColor); procedure SetColor(Value: TColor);
procedure SetFont(Value: TVpFont); procedure SetFont(Value: TVpFont);
procedure SetBordered(Value: Boolean); procedure SetBordered(Value: Boolean);
@ -116,10 +117,10 @@ type
destructor Destroy; override; destructor Destroy; override;
property WeekView: TVpWeekView read FWeekView; property WeekView: TVpWeekView read FWeekView;
published published
property Color: TColor read FColor write SetColor; property Color: TColor read FColor write SetColor default DEFAULT_COLOR;
property DateFormat: string read FDateFormat write SetDateFormat; property DateFormat: string read FDateFormat write SetDateFormat stored IsStoredDateFormat;
property Font: TVpFont read FFont write SetFont; property Font: TVpFont read FFont write SetFont;
property Bordered: Boolean read FBordered write SetBordered; property Bordered: Boolean read FBordered write SetBordered default true;
end; end;
{ TVpWeekView } { TVpWeekView }
@ -131,6 +132,7 @@ type
FMouseEvent: TVpEvent; FMouseEvent: TVpEvent;
FLayout: TVpWeekviewLayout; FLayout: TVpWeekviewLayout;
FOnHoliday: TVpHolidayEvent; FOnHoliday: TVpHolidayEvent;
function IsStoredDateLabelFormat: Boolean;
procedure SetActiveEvent(AValue: TVpEvent); procedure SetActiveEvent(AValue: TVpEvent);
procedure SetApplyCategoryInfos(AValue: Boolean); procedure SetApplyCategoryInfos(AValue: Boolean);
procedure SetLayout(AValue: TVpWeekviewLayout); procedure SetLayout(AValue: TVpWeekviewLayout);
@ -297,19 +299,19 @@ type
property AllowDragAndDrop: Boolean read FAllowDragAndDrop write FAllowDragAndDrop default false; property AllowDragAndDrop: Boolean read FAllowDragAndDrop write FAllowDragAndDrop default false;
property AllowInplaceEditing: Boolean read FAllowInplaceEdit write FAllowInplaceEdit default true; property AllowInplaceEditing: Boolean read FAllowInplaceEdit write FAllowInplaceEdit default true;
property ApplyCategoryInfos: Boolean read FApplyCategoryInfos write SetApplyCategoryInfos default false; property ApplyCategoryInfos: Boolean read FApplyCategoryInfos write SetApplyCategoryInfos default false;
property Color: TColor read FColor write SetColor; property Color: TColor read FColor write SetColor default DEFAULT_COLOR;
property DateLabelFormat: string read FDateLabelFormat write SetDateLabelFormat; property DateLabelFormat: string read FDateLabelFormat write SetDateLabelFormat stored IsStoredDateLabelFormat;
property DayHeadAttributes: TVpDayHeadAttr read FDayHeadAttributes write FDayHeadAttributes; property DayHeadAttributes: TVpDayHeadAttr read FDayHeadAttributes write FDayHeadAttributes;
property DragDropTransparent: Boolean read FDragDropTransparent write FDragDropTransparent default false; property DragDropTransparent: Boolean read FDragDropTransparent write FDragDropTransparent default false;
property DrawingStyle: TVpDrawingStyle read FDrawingStyle write SetDrawingStyle stored True; property DrawingStyle: TVpDrawingStyle read FDrawingStyle write SetDrawingStyle default ds3d;
property EventFont: TVpFont read FEventFont write SetEventFont; property EventFont: TVpFont read FEventFont write SetEventFont;
property HeadAttributes: TVpWvHeadAttributes read FHeadAttr write FHeadAttr; property HeadAttributes: TVpWvHeadAttributes read FHeadAttr write FHeadAttr;
property HintMode: TVpHintMode read FHintMode write FHintMode default hmPlannerHint; property HintMode: TVpHintMode read FHintMode write FHintMode default hmPlannerHint;
property LineColor: TColor read FLineColor write SetLineColor; property LineColor: TColor read FLineColor write SetLineColor default DEFAULT_LINECOLOR;
property Layout: TVpWeekviewLayout read FLayout write SetLayout default wvlVertical; property Layout: TVpWeekviewLayout read FLayout write SetLayout default wvlVertical;
property TimeFormat: TVpTimeFormat read FTimeFormat write SetTimeFormat; property TimeFormat: TVpTimeFormat read FTimeFormat write SetTimeFormat default tf12Hour;
property ShowEventTime: Boolean read FShowEventTime write SetShowEventTime; property ShowEventTime: Boolean read FShowEventTime write SetShowEventTime default true;
property WeekStartsOn: TVpDayType read FWeekStartsOn write SetWeekStartsOn; property WeekStartsOn: TVpDayType read FWeekStartsOn write SetWeekStartsOn default dtSunday;
{inherited properties} {inherited properties}
property Align; property Align;
@ -317,7 +319,7 @@ type
{$IFDEF LCL} {$IFDEF LCL}
property BorderSpacing; property BorderSpacing;
{$ENDIF} {$ENDIF}
property TabStop; property TabStop default true;
property TabOrder; property TabOrder;
{events} {events}
@ -397,7 +399,7 @@ begin
inherited; inherited;
end; end;
end; end;
{=====}
(*****************************************************************************) (*****************************************************************************)
{ TVpContactHeadAttr } { TVpContactHeadAttr }
@ -405,20 +407,21 @@ constructor TVpDayHeadAttr.Create(AOwner: TVpWeekView);
begin begin
inherited Create; inherited Create;
FWeekView := AOwner; FWeekView := AOwner;
FDateFormat := 'dddd mmmm, dd'; FDateFormat := 'ddddd';
FFont := TVpFont.Create(AOwner); FFont := TVpFont.Create(AOwner);
// FFont.Assign(FWeekView.Font); FColor := DEFAULT_COLOR;
// FFont.Size := 8;
FColor := clSilver;
FBordered := true; FBordered := true;
end; end;
{=====}
destructor TVpDayHeadAttr.Destroy; destructor TVpDayHeadAttr.Destroy;
begin begin
FFont.Free; FFont.Free;
end; end;
{=====}
function TVpDayHeadAttr.IsStoredDateFormat: Boolean;
begin
Result := FDateFormat = 'ddddd';
end;
procedure TVpDayHeadAttr.SetBordered(Value: Boolean); procedure TVpDayHeadAttr.SetBordered(Value: Boolean);
begin begin
@ -427,7 +430,6 @@ begin
WeekView.Invalidate; WeekView.Invalidate;
end; end;
end; end;
{=====}
procedure TVpDayHeadAttr.SetDateFormat(Value: string); procedure TVpDayHeadAttr.SetDateFormat(Value: string);
begin begin
@ -436,7 +438,6 @@ begin
WeekView.Invalidate; WeekView.Invalidate;
end; end;
end; end;
{=====}
procedure TVpDayHeadAttr.SetColor(Value: TColor); procedure TVpDayHeadAttr.SetColor(Value: TColor);
begin begin
@ -445,7 +446,6 @@ begin
WeekView.Invalidate; WeekView.Invalidate;
end; end;
end; end;
{=====}
procedure TVpDayHeadAttr.SetFont(Value: TVpFont); procedure TVpDayHeadAttr.SetFont(Value: TVpFont);
begin begin
@ -454,7 +454,7 @@ begin
WeekView.Invalidate; WeekView.Invalidate;
end; end;
end; end;
{=====}
(*****************************************************************************) (*****************************************************************************)
{ TVpWeekView } { TVpWeekView }
@ -492,18 +492,18 @@ begin
// DoubleBuffered := true; // DoubleBuffered := true;
{$ENDIF} {$ENDIF}
FWeekStartsOn := dtMonday; FWeekStartsOn := dtSunday;
wvClickTimer.Enabled := false; wvClickTimer.Enabled := false;
wvClickTimer.Interval := ClickDelay; wvClickTimer.Interval := ClickDelay;
wvClickTimer.OnTimer := wvEditInPlace; wvClickTimer.OnTimer := wvEditInPlace;
wvCreatingEditor := false; wvCreatingEditor := false;
FDrawingStyle := ds3d; FDrawingStyle := ds3d;
wvPainting := false; wvPainting := false;
FColor := clWindow; FColor := DEFAULT_COLOR;
FLineColor := clGray; FLineColor := DEFAULT_LINECOLOR;
wvStartDate := trunc(GetStartOfWeek(Now, FWeekStartsOn)); wvStartDate := trunc(GetStartOfWeek(Now, FWeekStartsOn));
FTimeFormat := tf12Hour; FTimeFormat := tf12Hour;
FDateLabelFormat := 'dddd, mmmm dd, yyyy'; FDateLabelFormat := 'ddddd';
FColumnWidth := 200; FColumnWidth := 200;
FAllowInplaceEdit := true; FAllowInplaceEdit := true;
@ -829,7 +829,11 @@ begin
Invalidate; Invalidate;
end; end;
end; end;
{=====}
function TVpWeekView.IsStoredDateLabelFormat: Boolean;
begin
Result := FDateLabelFormat <> 'ddddd';
end;
procedure TVpWeekView.SetDateLabelFormat(Value: string); procedure TVpWeekView.SetDateLabelFormat(Value: string);
begin begin
@ -838,7 +842,6 @@ begin
Invalidate; Invalidate;
end; end;
end; end;
{=====}
procedure TVpWeekView.SetEventFont(Value: TVpFont); procedure TVpWeekView.SetEventFont(Value: TVpFont);
begin begin