diff --git a/components/tvplanit/examples/datastores/ini/unit1.lfm b/components/tvplanit/examples/datastores/ini/unit1.lfm index ba4abf2ff..0a85cb542 100644 --- a/components/tvplanit/examples/datastores/ini/unit1.lfm +++ b/components/tvplanit/examples/datastores/ini/unit1.lfm @@ -7,7 +7,6 @@ object Form1: TForm1 ClientHeight = 686 ClientWidth = 980 OnCreate = FormCreate - LCLVersion = '2.3.0.0' object Panel1: TPanel Left = 0 Height = 33 @@ -95,10 +94,7 @@ object Form1: TForm1 Width = 301 DataStore = VpIniDatastore1 ControlLink = VpControlLink1 - Color = clWindow Align = alLeft - ReadOnly = False - TabStop = True TabOrder = 0 AllDayEventAttributes.BackgroundColor = clBtnShadow AllDayEventAttributes.EventBorderColor = cl3DDkShadow @@ -117,13 +113,6 @@ object Form1: TForm1 RowHeadAttributes.HourFont.Height = -24 RowHeadAttributes.MinuteFont.Height = -12 RowHeadAttributes.Color = clBtnFace - ShowResourceName = True - LineColor = clGray - GutterWidth = 7 - DateLabelFormat = 'dddd, mmmm dd, yyyy' - Granularity = gr30Min - DefaultTopHour = h_07 - TimeFormat = tf12Hour end object Panel2: TPanel Left = 306 @@ -143,24 +132,16 @@ object Form1: TForm1 Width = 386 DataStore = VpIniDatastore1 ControlLink = VpControlLink1 - Color = clWindow AllDayEventAttributes.BackgroundColor = clWindow AllDayEventAttributes.EventBorderColor = clGray AllDayEventAttributes.EventBackgroundColor = clBtnFace - DateLabelFormat = 'dddd, mmmm dd, yyyy' DayHeadAttributes.Color = clBtnFace - DayHeadAttributes.DateFormat = 'dddd mmmm, dd' DayHeadAttributes.Font.Height = -13 DayHeadAttributes.Font.Name = 'Tahoma' - DayHeadAttributes.Bordered = True DrawingStyle = dsFlat HeadAttributes.Color = clBtnFace - LineColor = clGray - TimeFormat = tf12Hour - ShowEventTime = True WeekStartsOn = dtMonday Align = alClient - TabStop = True TabOrder = 0 end object VpMonthView1: TVpMonthView @@ -170,28 +151,17 @@ object Form1: TForm1 Width = 386 DataStore = VpIniDatastore1 ControlLink = VpControlLink1 - Color = clWindow Align = alBottom - TabStop = True TabOrder = 1 - DateLabelFormat = 'mmmm yyyy' DayHeadAttributes.Font.Height = -13 DayHeadAttributes.Font.Name = 'Tahoma' DayHeadAttributes.Color = clBtnFace - DayNameStyle = dsShort DrawingStyle = dsFlat - EventDayStyle = [] HeadAttributes.Color = clBtnFace - KBNavigation = True OffDayColor = clSilver - SelectedDayColor = clRed - ShowEvents = True - ShowEventTime = False - TimeFormat = tf12Hour TodayAttributes.Color = clSilver TodayAttributes.BorderPen.Color = clRed TodayAttributes.BorderPen.Width = 3 - WeekStartsOn = dtSunday end object Splitter2: TSplitter Cursor = crVSplit @@ -210,11 +180,8 @@ object Form1: TForm1 Width = 275 DataStore = VpIniDatastore1 ControlLink = VpControlLink1 - Color = clWindow Align = alClient - TabStop = True TabOrder = 2 - ReadOnly = False DisplayOptions.CheckBGColor = clWindow DisplayOptions.CheckColor = cl3DDkShadow DisplayOptions.CheckStyle = csCheck @@ -225,11 +192,9 @@ object Form1: TForm1 DisplayOptions.OverdueColor = clRed DisplayOptions.NormalColor = clBlack DisplayOptions.CompletedColor = clGray - LineColor = clGray MaxVisibleTasks = 250 TaskHeadAttributes.Color = clSilver DrawingStyle = dsFlat - ShowResourceName = True end object Splitter1: TSplitter Left = 692 @@ -264,13 +229,8 @@ object Form1: TForm1 Width = 932 DataStore = VpIniDatastore1 ControlLink = VpControlLink1 - Color = clWindow Align = alClient - TabStop = True TabOrder = 1 - AllowInPlaceEditing = True - BarWidth = 3 - BarColor = clSilver ColumnWidth = 200 ContactHeadAttributes.Color = clSilver ContactHeadAttributes.Bordered = True @@ -323,8 +283,6 @@ object Form1: TForm1 CategoryColorMap.Category9.Description = 'Category 9' HiddenCategories.BackgroundColor = clSilver HiddenCategories.Color = clGray - EnableEventTimer = True - PlayEventSounds = True AutoConnect = True FileName = 'data.ini' Left = 136 diff --git a/components/tvplanit/examples/datastores/ini/unit1.pas b/components/tvplanit/examples/datastores/ini/unit1.pas index 1cad4c8ef..29fb26ffe 100644 --- a/components/tvplanit/examples/datastores/ini/unit1.pas +++ b/components/tvplanit/examples/datastores/ini/unit1.pas @@ -100,7 +100,8 @@ begin if datastore.Resources.Count > 0 then begin lastRes := datastore.Resources.Items[datastore.Resources.Count-1]; - datastore.ResourceID := lastRes.ResourceID; + datastore.Resource := lastRes; +// datastore.ResourceID := lastRes.ResourceID; end; end; diff --git a/components/tvplanit/source/vpcalendar.pas b/components/tvplanit/source/vpcalendar.pas index 9794c53ad..f7c66036f 100644 --- a/components/tvplanit/source/vpcalendar.pas +++ b/components/tvplanit/source/vpcalendar.pas @@ -278,13 +278,14 @@ type {$IFDEF LCL} property BorderSpacing; {$ENDIF} - property BorderStyle: TBorderStyle read FBorderStyle write SetBorderStyle; + property BorderStyle: TBorderStyle read FBorderStyle write SetBorderStyle default bsNone; property Color; property Colors: TVpCalColors read FColors write FColors; 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 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 WantDblClicks: Boolean read FWantDblClicks write SetWantDblClicks; property WeekStarts: TVpDayType read FWeekStarts write SetWeekStarts; diff --git a/components/tvplanit/source/vpconst.pas b/components/tvplanit/source/vpconst.pas index 057d61715..691edc983 100644 --- a/components/tvplanit/source/vpconst.pas +++ b/components/tvplanit/source/vpconst.pas @@ -44,7 +44,7 @@ uses {$ELSE} Windows, {$ENDIF} - Forms, StdCtrls; + Graphics, Forms, StdCtrls; const BuildTime = {$I %DATE%} + {$I %TIME}; //'09/13/2002 09:25 AM'; @@ -258,6 +258,9 @@ const CONDITIONAL_INCLUDE = 0; CONDITIONAL_IGNORE = 1; + + DEFAULT_COLOR = clWindow; + DEFAULT_LINECOLOR = clSilver; { Version numbers } VpXSLImplementation = 0.0; diff --git a/components/tvplanit/source/vpcontactgrid.pas b/components/tvplanit/source/vpcontactgrid.pas index 45172ea1c..63da828ac 100644 --- a/components/tvplanit/source/vpcontactgrid.pas +++ b/components/tvplanit/source/vpcontactgrid.pas @@ -265,18 +265,22 @@ type {$IFDEF LCL} property BorderSpacing; {$ENDIF} - property TabStop; + property TabStop default true; property TabOrder; property AllowInPlaceEditing: Boolean - read FAllowInPlaceEdit write FAllowInPlaceEdit; - property BarWidth: Integer read GetBarWidth write SetBarWidth; - property BarColor: TColor read FBarColor write SetBarColor; - property Color: TColor read FColor write SetColor; - property ColumnWidth: Integer read FColumnWidth write SetColumnWidth; + read FAllowInPlaceEdit write FAllowInPlaceEdit default true; + property BarWidth: Integer + read GetBarWidth write SetBarWidth default 3; + property BarColor: TColor + 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 read FContactHeadAttr write FContactHeadAttr; property DrawingStyle: TVpDrawingStyle - read FDrawingStyle write SetDrawingStyle; + read FDrawingStyle write SetDrawingStyle default ds3d; property HintMode: TVpHintMode read FHintMode write FHintMode default hmPlannerHint; property PrintNumColumns: Integer @@ -467,8 +471,8 @@ begin cgCreatingEditor := false; FDrawingStyle := ds3d; cgPainting := false; - FColor := clWindow; - FBarColor := clSilver; + FColor := DEFAULT_COLOR; + FBarColor := DEFAULT_LINECOLOR; BarWidth := 3; FColumnWidth := 145; FContactIndex := -1; diff --git a/components/tvplanit/source/vpdayview.pas b/components/tvplanit/source/vpdayview.pas index 60be48b36..1d77d497b 100644 --- a/components/tvplanit/source/vpdayview.pas +++ b/components/tvplanit/source/vpdayview.pas @@ -238,6 +238,7 @@ type FHintMode: TVpHintMode; FMouseEvent: TVpEvent; FOnHoliday: TVpHolidayEvent; + function IsStoredDateLabelFormat: Boolean; protected{ private } FGranularity: TVpGranularity; @@ -487,8 +488,8 @@ type property BorderSpacing; {$ENDIF} property Constraints; - property ReadOnly; - property TabStop; + property ReadOnly default false; + property TabStop default true; property TabOrder; property Font; property AllDayEventAttributes: TVpAllDayEventAttributes read FAllDayEventAttr write FAllDayEventAttr; @@ -497,22 +498,22 @@ type property DotDotDotColor: TColor read FDotDotDotColor write SetDotDotDotColor default clBlack; property ShowEventTimes: Boolean read FShowEventTimes write SetShowEventTimes default true; 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 HeadAttributes: TVpCHAttributes read FHeadAttr write FHeadAttr; property RowHeadAttributes: TVpRHAttributes read FRowHeadAttr write FRowHeadAttr; 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 OwnerDrawColHeader: TVpOwnerDrawEvent read FOwnerDrawColHead write FOwnerDrawColHead; property OwnerDrawCells: TVpOwnerDrawRowEvent read FOwnerDrawCells write FOwnerDrawCells; - property ShowResourceName: Boolean read FShowResourceName write SetShowResourceName; - property LineColor: TColor read FLineColor write SetLineColor; - property GutterWidth: Integer read FGutterWidth write SetGutterWidth; - property DateLabelFormat: string read FDateLabelFormat write SetDateLabelFormat; - Property Granularity: TVpGranularity read FGranularity write SetGranularity; - property DefaultTopHour: TVpHours read FDefTopHour write SetDefTopHour; - property TimeFormat: TVpTimeFormat read FTimeFormat write SetTimeFormat; + property ShowResourceName: Boolean read FShowResourceName write SetShowResourceName default true; + property LineColor: TColor read FLineColor write SetLineColor default DEFAULT_LINECOLOR; + property GutterWidth: Integer read FGutterWidth write SetGutterWidth default 7; + property DateLabelFormat: string read FDateLabelFormat write SetDateLabelFormat stored IsStoredDateLabelFormat; + Property Granularity: TVpGranularity read FGranularity write SetGranularity default gr30Min; + property DefaultTopHour: TVpHours read FDefTopHour write SetDefTopHour default h_07; + property TimeFormat: TVpTimeFormat read FTimeFormat write SetTimeFormat default tf12Hour; property IncludeWeekends: Boolean read FIncludeWeekends write SetIncludeWeekends default True; property NumDays: Integer read FNumDays write SetNumDays default 1; property WrapStyle: TVpDVWrapStyle read FWrapStyle Write SetWrapStyle default wsIconFlow; @@ -830,8 +831,8 @@ begin dvPainting := false; FShowNavButtons := true; FShowResourceName := true; - FColor := clWindow; - FLineColor := clGray; + FColor := DEFAULT_COLOR; + FLineColor := DEFAULT_LINECOLOR; Granularity := gr30min; FDefTopHour := h_07; FDisplayDate := Now; @@ -1829,7 +1830,11 @@ begin SetVScrollPos; end; end; -{=====} + +function TVpDayView.IsStoredDateLabelFormat: Boolean; +begin + Result := FDateLabeLFormat <> 'dddddd'; +end; procedure TVpDayView.SetDateLabelFormat(Value: string); begin @@ -1838,7 +1843,6 @@ begin Invalidate; end; end; -{=====} procedure TVpDayView.SetGutterWidth(Value: Integer); begin diff --git a/components/tvplanit/source/vpmonthview.pas b/components/tvplanit/source/vpmonthview.pas index d74614457..079394cf6 100644 --- a/components/tvplanit/source/vpmonthview.pas +++ b/components/tvplanit/source/vpmonthview.pas @@ -147,6 +147,7 @@ type FAllowDragAndDrop: Boolean; FDragDropTransparent: Boolean; FApplyCategoryInfos: Boolean; + function IsStoredDateLabelFormat: Boolean; procedure SetApplyCategoryInfos(AValue: Boolean); protected{ private } FKBNavigate: Boolean; @@ -313,37 +314,37 @@ type {$IFDEF LCL} property BorderSpacing; {$ENDIF} - property TabStop; + property TabStop default true; property TabOrder; property AllowDragAndDrop: Boolean read FAllowDragAndDrop write FAllowDragAndDrop default false; property ApplyCategoryInfos: Boolean read FApplyCategoryInfos write SetApplyCategoryInfos default false; - property Color: TColor read FColor write SetColor; - property DateLabelFormat: string read FDateLabelFormat write SetDateLabelFormat; + property Color: TColor read FColor write SetColor default DEFAULT_COLOR; + property DateLabelFormat: string read FDateLabelFormat write SetDateLabelFormat stored IsStoredDateLabelFormat; 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 DragDropTransparent: Boolean read FDragDropTransparent write FDragDropTransparent default false; - property DrawingStyle: TVpDrawingStyle read FDrawingStyle write SetDrawingStyle stored True; - property EventDayStyle: TFontStyles read FEventDayStyle write SetEventDayStyle; + property DrawingStyle: TVpDrawingStyle read FDrawingStyle write SetDrawingStyle default ds3d; + property EventDayStyle: TFontStyles read FEventDayStyle write SetEventDayStyle default []; property EventFont: TVpFont read FEventFont write SetEventFont; // property HeadAttributes: TVpMvHeadAttr read FHeadAttr write FHeadAttr; property HeadAttributes: TVpMonthViewAttr read FHeadAttr write FHeadAttr; property HolidayAttributes: TVpMvHolidayAttr read FHolidayAttr write FHolidayAttr; property HintMode: TVpHintMode read FHintMode write FHintMode default hmPlannerHint; - property KBNavigation: Boolean read FKBNavigate write FKBNavigate; - property LineColor: TColor read FLineColor write SetLineColor default clGray; + property KBNavigation: Boolean read FKBNavigate write FKBNavigate default true; + property LineColor: TColor read FLineColor write SetLineColor default DEFAULT_LINECOLOR; property OffDayColor: TColor read FOffDayColor write SetOffDayColor default OFF_COLOR; property OffDayFontColor: TColor read FOffDayFontColor write SetOffDayFontColor default clGray; property OwnerDrawCells: TVpOwnerDrawDayEvent read FOwnerDrawCells write FOwnerDrawCells; property RightClickChangeDate: Boolean read FRightClickChangeDate write SetRightClickChangeDate default vpDefWVRClickChangeDate; - property SelectedDayColor: TColor read FSelectedDayColor write SetSelectedDayColor; - property ShowEvents: Boolean read FShowEvents write SetShowEvents; - property ShowEventTime: Boolean read FShowEventTime write SetShowEventTime; - property TimeFormat: TVpTimeFormat read FTimeFormat write SetTimeFormat; + property SelectedDayColor: TColor read FSelectedDayColor write SetSelectedDayColor default clRed; + property ShowEvents: Boolean read FShowEvents write SetShowEvents default true; + property ShowEventTime: Boolean read FShowEventTime write SetShowEventTime default false; + property TimeFormat: TVpTimeFormat read FTimeFormat write SetTimeFormat default tf12Hour; property TodayAttributes: TVpMvTodayAttr read FTodayAttr write FTodayAttr; property WeekendAttributes: TVpMvWeekendAttr read FWeekendAttr write FWeekendAttr; - property WeekStartsOn: TVpDayType read FWeekStartsOn write SetWeekStartsOn; + property WeekStartsOn: TVpDayType read FWeekStartsOn write SetWeekStartsOn default dtSunday; {events} property OnAddEvent: TVpOnAddNewEvent read FOnAddEvent write FOnAddEvent; property OnEventClick: TVpOnEventClick read FOnEventClick write FOnEventClick; @@ -489,8 +490,8 @@ begin FSelectedDayColor := clRed; FDrawingStyle := ds3d; // mvPainting := false; - FColor := clWindow; - FLineColor := clGray; + FColor := DEFAULT_COLOR; + FLineColor := DEFAULT_LINECOLOR; FDate := Trunc(Now); FTimeFormat := tf12Hour; FDateLabelFormat := 'mmmm yyyy'; @@ -816,6 +817,11 @@ begin Invalidate; end; +function TVpMonthView.IsStoredDateLabelFormat: Boolean; +begin + Result := FDateLabelFormat <> 'mmmm yyyy'; +end; + procedure TVpMonthView.SetDateLabelFormat(Value: string); begin if Value <> FDateLabelFormat then begin diff --git a/components/tvplanit/source/vptasklist.pas b/components/tvplanit/source/vptasklist.pas index 5873f92e3..bd835606a 100644 --- a/components/tvplanit/source/vptasklist.pas +++ b/components/tvplanit/source/vptasklist.pas @@ -235,9 +235,9 @@ type property Align; property Anchors; property Font; - property TabStop; + property TabStop default true; property TabOrder; - property ReadOnly; + property ReadOnly default false; {$IFDEF LCL} property BorderSpacing; {$ENDIF} @@ -245,13 +245,13 @@ type property AllowInplaceEditing: Boolean read FAllowInplaceEdit write FAllowInplaceEdit default true; 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 TaskHeadAttributes: TVpTaskHeadAttr read FTaskHeadAttr write FTaskHeadAttr; - property DrawingStyle: TVpDrawingStyle read FDrawingStyle write SetDrawingStyle; - property Color: TColor read FColor write SetColor; + property DrawingStyle: TVpDrawingStyle read FDrawingStyle write SetDrawingStyle default ds3d; + property Color: TColor read FColor write SetColor default DEFAULT_COLOR; 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 } property BeforeEdit: TVpBeforeEditTask read FBeforeEdit write FBeforeEdit; property AfterEdit: TVpAfterEditTask read FAfterEdit write FAfterEdit; @@ -519,8 +519,8 @@ begin FDrawingStyle := ds3d; tlPainting := false; FShowResourceName := true; - FColor := clWindow; - FLineColor := clGray; + FColor := DEFAULT_COLOR; + FLineColor := DEFAULT_LINECOLOR; FScrollBars := ssVertical; FTaskIndex := -1; FShowIcon := True; diff --git a/components/tvplanit/source/vpweekview.pas b/components/tvplanit/source/vpweekview.pas index 087c337a5..5b375e865 100644 --- a/components/tvplanit/source/vpweekview.pas +++ b/components/tvplanit/source/vpweekview.pas @@ -107,6 +107,7 @@ type FDateFormat: string; FColor: TColor; FBordered: Boolean; + function IsStoredDateFormat: Boolean; procedure SetColor(Value: TColor); procedure SetFont(Value: TVpFont); procedure SetBordered(Value: Boolean); @@ -116,10 +117,10 @@ type destructor Destroy; override; property WeekView: TVpWeekView read FWeekView; published - property Color: TColor read FColor write SetColor; - property DateFormat: string read FDateFormat write SetDateFormat; + property Color: TColor read FColor write SetColor default DEFAULT_COLOR; + property DateFormat: string read FDateFormat write SetDateFormat stored IsStoredDateFormat; property Font: TVpFont read FFont write SetFont; - property Bordered: Boolean read FBordered write SetBordered; + property Bordered: Boolean read FBordered write SetBordered default true; end; { TVpWeekView } @@ -131,6 +132,7 @@ type FMouseEvent: TVpEvent; FLayout: TVpWeekviewLayout; FOnHoliday: TVpHolidayEvent; + function IsStoredDateLabelFormat: Boolean; procedure SetActiveEvent(AValue: TVpEvent); procedure SetApplyCategoryInfos(AValue: Boolean); procedure SetLayout(AValue: TVpWeekviewLayout); @@ -297,19 +299,19 @@ type property AllowDragAndDrop: Boolean read FAllowDragAndDrop write FAllowDragAndDrop default false; property AllowInplaceEditing: Boolean read FAllowInplaceEdit write FAllowInplaceEdit default true; property ApplyCategoryInfos: Boolean read FApplyCategoryInfos write SetApplyCategoryInfos default false; - property Color: TColor read FColor write SetColor; - property DateLabelFormat: string read FDateLabelFormat write SetDateLabelFormat; + property Color: TColor read FColor write SetColor default DEFAULT_COLOR; + property DateLabelFormat: string read FDateLabelFormat write SetDateLabelFormat stored IsStoredDateLabelFormat; property DayHeadAttributes: TVpDayHeadAttr read FDayHeadAttributes write FDayHeadAttributes; 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 HeadAttributes: TVpWvHeadAttributes read FHeadAttr write FHeadAttr; 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 TimeFormat: TVpTimeFormat read FTimeFormat write SetTimeFormat; - property ShowEventTime: Boolean read FShowEventTime write SetShowEventTime; - property WeekStartsOn: TVpDayType read FWeekStartsOn write SetWeekStartsOn; + property TimeFormat: TVpTimeFormat read FTimeFormat write SetTimeFormat default tf12Hour; + property ShowEventTime: Boolean read FShowEventTime write SetShowEventTime default true; + property WeekStartsOn: TVpDayType read FWeekStartsOn write SetWeekStartsOn default dtSunday; {inherited properties} property Align; @@ -317,7 +319,7 @@ type {$IFDEF LCL} property BorderSpacing; {$ENDIF} - property TabStop; + property TabStop default true; property TabOrder; {events} @@ -397,7 +399,7 @@ begin inherited; end; end; -{=====} + (*****************************************************************************) { TVpContactHeadAttr } @@ -405,20 +407,21 @@ constructor TVpDayHeadAttr.Create(AOwner: TVpWeekView); begin inherited Create; FWeekView := AOwner; - FDateFormat := 'dddd mmmm, dd'; + FDateFormat := 'ddddd'; FFont := TVpFont.Create(AOwner); -// FFont.Assign(FWeekView.Font); -// FFont.Size := 8; - FColor := clSilver; + FColor := DEFAULT_COLOR; FBordered := true; end; -{=====} destructor TVpDayHeadAttr.Destroy; begin FFont.Free; end; -{=====} + +function TVpDayHeadAttr.IsStoredDateFormat: Boolean; +begin + Result := FDateFormat = 'ddddd'; +end; procedure TVpDayHeadAttr.SetBordered(Value: Boolean); begin @@ -427,7 +430,6 @@ begin WeekView.Invalidate; end; end; -{=====} procedure TVpDayHeadAttr.SetDateFormat(Value: string); begin @@ -436,7 +438,6 @@ begin WeekView.Invalidate; end; end; -{=====} procedure TVpDayHeadAttr.SetColor(Value: TColor); begin @@ -445,7 +446,6 @@ begin WeekView.Invalidate; end; end; -{=====} procedure TVpDayHeadAttr.SetFont(Value: TVpFont); begin @@ -454,7 +454,7 @@ begin WeekView.Invalidate; end; end; -{=====} + (*****************************************************************************) { TVpWeekView } @@ -492,18 +492,18 @@ begin // DoubleBuffered := true; {$ENDIF} - FWeekStartsOn := dtMonday; + FWeekStartsOn := dtSunday; wvClickTimer.Enabled := false; wvClickTimer.Interval := ClickDelay; wvClickTimer.OnTimer := wvEditInPlace; wvCreatingEditor := false; FDrawingStyle := ds3d; wvPainting := false; - FColor := clWindow; - FLineColor := clGray; + FColor := DEFAULT_COLOR; + FLineColor := DEFAULT_LINECOLOR; wvStartDate := trunc(GetStartOfWeek(Now, FWeekStartsOn)); FTimeFormat := tf12Hour; - FDateLabelFormat := 'dddd, mmmm dd, yyyy'; + FDateLabelFormat := 'ddddd'; FColumnWidth := 200; FAllowInplaceEdit := true; @@ -829,7 +829,11 @@ begin Invalidate; end; end; -{=====} + +function TVpWeekView.IsStoredDateLabelFormat: Boolean; +begin + Result := FDateLabelFormat <> 'ddddd'; +end; procedure TVpWeekView.SetDateLabelFormat(Value: string); begin @@ -838,7 +842,6 @@ begin Invalidate; end; end; -{=====} procedure TVpWeekView.SetEventFont(Value: TVpFont); begin