diff --git a/components/tvplanit/source/vpdayview.pas b/components/tvplanit/source/vpdayview.pas index f5e5f8641..4cf5ef691 100644 --- a/components/tvplanit/source/vpdayview.pas +++ b/components/tvplanit/source/vpdayview.pas @@ -234,127 +234,123 @@ type TVpDayView = class(TVpLinkableControl) private - FComponentHint: TTranslateString; - FDefaultPopup: TPopupMenu; - FExternalPopup: TPopupMenu; - FHintMode: TVpHintMode; - FMouseEvent: TVpEvent; - FOnHoliday: TVpHolidayEvent; - function IsStoredDateLabelFormat: Boolean; - procedure SetPopupMenu(AValue: TPopupMenu); - - protected{ private } - FGranularity: TVpGranularity; - FColumnWidth: Integer; - FColor: TColor; - FLineColor: TColor; - FDefTopHour: TVpHours; - FTopHour: TVpHours; - FDateLabelFormat: string; - FShowResourceName: Boolean; - FTopLine: Integer; - FActiveRow: Integer; FActiveCol: Integer; FActiveEvent: TVpEvent; - FGutterWidth: Integer; - FLineCount: Integer; - FVisibleLines: Integer; - FTimeFormat: TVpTimeFormat; - FDrawingStyle: TVpDrawingStyle; - FTimeSlotColors: TVpTimeSlotColor; - FRowHeadAttr: TVpRHAttributes; - FHeadAttr: TVpCHAttributes; + FActiveRow: Integer; FAllDayEventAttr: TVpAllDayEventAttributes; - FDisplayDate: TDateTime; - FScrollBars: TScrollStyle; - FIconAttributes: TVpDayViewIconAttributes; - FWrapStyle: TVpDVWrapStyle; - FDotDotDotColor: TColor; - FShowEventTimes: Boolean; - FAllowInplaceEdit: Boolean; - FDragDropTransparent: Boolean; FAllowDragAndDrop: Boolean; - FNumDays: Integer; - FIncludeWeekends: Boolean; - FRowLinesStep: Integer; - FShowNavButtons: Boolean; - FFixedDate: Boolean; + FAllowInplaceEdit: Boolean; + FColor: TColor; + FColumnWidth: Integer; + FComponentHint: TTranslateString; FCustomRowHeight: Integer; + FDateLabelFormat: string; + FDefaultPopup: TPopupMenu; + FDefTopHour: TVpHours; + FDisplayDate: TDateTime; + FDotDotDotColor: TColor; + FDragDropTransparent: Boolean; + FDrawingStyle: TVpDrawingStyle; + FExternalPopup: TPopupMenu; + FFixedDate: Boolean; + FGranularity: TVpGranularity; + FGutterWidth: Integer; + FHeadAttr: TVpCHAttributes; + FHintMode: TVpHintMode; + FIconAttributes: TVpDayViewIconAttributes; + FIncludeWeekends: Boolean; + FLineColor: TColor; + FLineCount: Integer; + FMouseEvent: TVpEvent; + FNumDays: Integer; + FRowHeadAttr: TVpRHAttributes; + FRowLinesStep: Integer; + FScrollBars: TScrollStyle; + FShowEventTimes: Boolean; + FShowNavButtons: Boolean; + FShowResourceName: Boolean; FSimpleRowTime: Boolean; - { event variables } - FOwnerDrawRowHead: TVpOwnerDrawRowEvent; - FOwnerDrawCells: TVpOwnerDrawRowEvent; - FOwnerDrawColHead: TVpOwnerDrawEvent; - FBeforeEdit: TVpBeforeEditEvent; - FAfterEdit: TVpAfterEditEvent; - FOwnerEditEvent: TVpEditEvent; - FOnDrawIcons: TVpOnDVDrawIcons; - FOnBeforeDrawEvent: TVpOnDVBeforeDrawEvent; - FOnAfterDrawEvent: TVpOnDVAfterDrawEvent; - FOnAddEvent: TVpOnAddNewEvent; - FOnModifyEvent: TVpOnModifyEvent; - FOnDeletingEvent: TVpOnDeletingEvent; - { internal variables } + FTimeFormat: TVpTimeFormat; + FTimeSlotColors: TVpTimeSlotColor; + FTopHour: TVpHours; + FTopLine: Integer; + FVisibleLines: Integer; + FWrapStyle: TVpDVWrapStyle; + // internal variables dvClickTimer: TTimer; - dvLoaded: Boolean; - dvInLinkHandler: Boolean; - dvRowHeight: Integer; - dvColHeadHeight: Integer; - dvRowHeadWidth: Integer; dvClientVArea: Integer; - dvMouseDownPoint: TPoint; - dvMouseDown: Boolean; - dvEndingEditing: Boolean; + dvColHeadHeight: Integer; + dvCreatingEditor: Boolean; dvDragging: Boolean; dvDragStartTime: TDateTime; + dvEndingEditing: Boolean; + dvHotPoint: TPoint; + dvInLinkHandler: Boolean; + dvLoaded: Boolean; + dvMouseDown: Boolean; + dvMouseDownPoint: TPoint; + dvPainting: Boolean; + dvRowHeadWidth: Integer; + dvRowHeight: Integer; + dvTimeIncSize: double; + dvVScrollDelta: Integer; + // event variables + FAfterEdit: TVpAfterEditEvent; + FBeforeEdit: TVpBeforeEditEvent; + FOnAddEvent: TVpOnAddNewEvent; + FOnAfterDrawEvent: TVpOnDVAfterDrawEvent; + FOnBeforeDrawEvent: TVpOnDVBeforeDrawEvent; + FOnDeletingEvent: TVpOnDeletingEvent; + FOnDrawIcons: TVpOnDVDrawIcons; + FOnHoliday: TVpHolidayEvent; + FOnModifyEvent: TVpOnModifyEvent; + FOwnerDrawCells: TVpOwnerDrawRowEvent; + FOwnerDrawColHead: TVpOwnerDrawEvent; + FOwnerDrawRowHead: TVpOwnerDrawRowEvent; + FOwnerEditEvent: TVpEditEvent; + // Property methods + function GetLastVisibleDate: TDateTime; + function IsStoredDateLabelFormat: Boolean; + procedure SetActiveCol(Value: Integer); + procedure SetActiveRow(Value: Integer); + procedure SetColor(Value: TColor); reintroduce; + procedure SetCustomRowHeight(Value: Integer); + procedure SetDateLabelFormat(Value: string); + procedure SetDefTopHour(Value: TVpHours); + procedure SetDisplayDate(Value: TDateTime); + procedure SetDotDotDotColor(const v: TColor); + procedure SetDrawingStyle(Value: TVpDrawingStyle); + procedure SetGranularity(Value: TVpGranularity); + procedure SetGutterWidth(Value: Integer); + procedure SetIncludeWeekends(Value: Boolean); + procedure SetLineColor(Value: TColor); + procedure SetNumDays(Value: Integer); + procedure SetPopupMenu(AValue: TPopupMenu); + procedure SetRowLinesStep(Value: Integer); + procedure SetShowEventTimes(Value: Boolean); + procedure SetShowNavButtons(Value: Boolean); + procedure SetShowResourceName(Value: Boolean); + procedure SetSimpleRowTime(Value: Boolean); + procedure SetTimeFormat(Value: TVpTimeFormat); + procedure SetTopHour(Value: TVpHours); + procedure SetTopLine(Value: Integer); + procedure SetVScrollPos; + procedure SetWrapStyle(const v: TVpDVWrapStyle); - { Nav Buttons } + protected + // Needed by the DayViewPainter dvDayUpBtn: TSpeedButton; dvDayDownBtn: TSpeedButton; dvTodayBtn: TSpeedButton; dvWeekUpBtn: TSpeedButton; dvWeekDownBtn: TSpeedButton; - dvLineMatrix: TVpLineMatrix; - dvColRectArray: TVpColRectArray; - dvEventArray: TVpEventArray; dvActiveEventRec: TRect; dvActiveIconRec: TRect; + dvColRectArray: TVpColRectArray; + dvEventArray: TVpEventArray; dvInPlaceEditor: TVpDvInPlaceEdit; - dvCreatingEditor: Boolean; - { the granularity based time increment for each row } - dvTimeIncSize: double; - dvPainting: Boolean; - dvVScrollDelta: Integer; - dvHotPoint: TPoint; - - { property methods } - function GetLastVisibleDate: TDateTime; - function GetRealNumDays(WorkDate: TDateTime) : Integer; - procedure SetDrawingStyle(Value: TVpDrawingStyle); - procedure SetColor(Value: TColor); reintroduce; - procedure SetLineColor(Value: TColor); - procedure SetTopHour(Value: TVpHours); - procedure SetTopLine(Value: Integer); - procedure SetDateLabelFormat(Value: string); - procedure SetGutterWidth(Value: Integer); - procedure SetDefTopHour(Value: TVpHours); - procedure SetGranularity(Value: TVpGranularity); - procedure SetTimeFormat(Value: TVpTimeFormat); - procedure SetNumDays(Value: Integer); - procedure SetIncludeWeekends(Value: Boolean); - procedure SetDisplayDate(Value: TDateTime); - procedure SetVScrollPos; - procedure SetCustomRowHeight(Value: Integer); - procedure SetRowLinesStep(Value: Integer); - procedure SetShowNavButtons(Value: Boolean); - procedure SetShowResourceName(Value: Boolean); - procedure SetSimpleRowTime(Value: Boolean); - procedure SetActiveRow(Value: Integer); - procedure SetActiveCol(Value: Integer); - procedure SetWrapStyle(const v: TVpDVWrapStyle); - procedure SetDotDotDotColor(const v: TColor); - procedure SetShowEventTimes(Value: Boolean); + dvLineMatrix: TVpLineMatrix; { drag-drop methods } procedure DoStartDrag(var DragObject: TDragObject); override; @@ -392,8 +388,6 @@ type procedure InitializeDefaultPopup; { internal methods } - procedure CreateParams(var Params: TCreateParams); override; - procedure CreateWnd; override; function dvCalcRowHeight(Scale: Extended; UseGran: TVpGranularity): Integer; function dvCalcVisibleLines(RenderHeight, ColHeadHeight, ARowHeight: Integer; Scale: Extended; StartLine, StopLine: Integer): Integer; @@ -411,10 +405,13 @@ type procedure EndEdit(Sender: TObject); function GetEventAtCoord(APoint: TPoint): TVpEvent; function GetEventRect(AEvent: TVpEvent): TRect; + function GetRealNumDays(WorkDate: TDateTime): Integer; procedure SetActiveEventByCoord(APoint: TPoint); procedure SetTimeIntervals(UseGran: TVpGranularity); { inherited methods } + procedure CreateParams(var Params: TCreateParams); override; + procedure CreateWnd; override; procedure KeyDown(var Key: Word; Shift: TShiftState); override; procedure Loaded; override; procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X,Y: Integer); override; @@ -556,6 +553,7 @@ uses SysUtils, StrUtils, Math, Dialogs, VpEvntEditDlg, VpDayViewPainter; + (*****************************************************************************) { TVpTGInPlaceEdit } @@ -566,14 +564,12 @@ begin BorderStyle := bsNone; // DoubleBuffered := False; end; -{=====} procedure TVpDvInPlaceEdit.CreateParams(var Params: TCreateParams); begin inherited CreateParams(Params); Params.Style := Params.Style{$IFNDEF LCL} or ES_MULTILINE{$ENDIF}; end; -{=====} procedure TVpDvInPlaceEdit.KeyDown(var Key: Word; Shift: TShiftState); // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -615,7 +611,6 @@ begin inherited; end; end; -{=====} {$IFNDEF LCL} procedure TVpDvInPlaceEdit.WMKillFocus(var Msg: TWMKillFocus); @@ -626,9 +621,9 @@ begin Unused(Msg); TVpDayView(Owner).EndEdit(self); end; -{=====} +(*****************************************************************************) { TVpAllDayEventAttributes } constructor TVpAllDayEventAttributes.Create(AOwner: TWinControl); @@ -639,28 +634,24 @@ begin FEventBackgroundColor := clBtnFace; FEventBorderColor := cl3dDkShadow; end; -{=====} destructor TVpAllDayEventAttributes.Destroy; begin inherited; FFont.Free; end; -{=====} procedure TVpAllDayEventAttributes.SetBackGroundColor(Value: TColor); begin FBackgroundColor := Value; FOwner.Invalidate; end; -{=====} procedure TVpAllDayEventAttributes.SetEventBackgroundColor(Value: TColor); begin FEventBackgroundColor := Value; FOwner.Invalidate; end; -{=====} procedure TVpAllDayEventAttributes.SetEventBorderColor(Value: TColor); begin @@ -673,7 +664,7 @@ begin FFont.Assign(Value); FFont.Owner := FOwner; end; -{=====} + (*****************************************************************************) { TVpDayViewIconAttributes } @@ -760,6 +751,7 @@ begin end; end; + (*****************************************************************************) { TVpDayView } @@ -903,7 +895,6 @@ begin dvHookUp; end; -{=====} destructor TVpDayView.Destroy; begin @@ -1032,8 +1023,6 @@ begin TVpMenuItem(item).Translate; end; -{=====} - procedure TVpDayView.DeleteActiveEvent(Verify: Boolean); var DoIt: Boolean; @@ -1065,7 +1054,6 @@ begin end; end; end; -{=====} procedure TVpDayView.Invalidate; begin @@ -1094,7 +1082,6 @@ begin dvInLinkHandler := false; end; end; -{=====} procedure TVpDayView.dvHookUp; var @@ -1111,7 +1098,9 @@ begin end; end; + { Hint support } + procedure TVpDayView.ShowHintWindow(APoint: TPoint; AEvent: TVpEvent); var txt: String; @@ -1521,7 +1510,6 @@ begin dvLoaded := true; dvPopulate; end; -{=====} procedure TVpDayView.Paint; begin @@ -1529,14 +1517,12 @@ begin TopLine, -1, FGranularity, False); SetVScrollPos; end; -{=====} procedure TVpDayView.dvPopulate; begin if DataStore <> nil then DataStore.Date := FDisplayDate; end; -{=====} procedure TVpDayView.dvNavButtonsClick(Sender: TObject); begin @@ -1552,7 +1538,6 @@ begin else if Sender = dvWeekDownBtn then Date := Date - 7; end; -{=====} function TVpDayView.dvCalcVisibleLines(RenderHeight, ColHeadHeight, ARowHeight: Integer; Scale: Extended; StartLine, StopLine: Integer): Integer; @@ -1586,7 +1571,6 @@ begin } FVisibleLines := Result; end; -{=====} procedure TVpDayView.SetColor(Value: TColor); begin @@ -1595,7 +1579,6 @@ begin Invalidate; end; end; -{=====} function TVpDayView.dvCalcColHeadHeight(Scale: Extended): Integer; var @@ -1618,7 +1601,6 @@ begin dvColHeadHeight := Result; end; -{=====} procedure TVpDayView.DoStartDrag(var DragObject: TDragObject); {$IFDEF LCL} @@ -1656,7 +1638,6 @@ begin DragObject.Free;//EndDrag(false); {$ENDIF} end; -{=====} procedure TVpDayView.DoEndDrag(Target: TObject; X, Y: Integer); begin @@ -1668,7 +1649,6 @@ begin {$ENDIF} // not needed for LCL: we use DragObjectEx !! end; -{=====} procedure TVpDayView.DragOver(Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean); @@ -1687,7 +1667,6 @@ begin end else Accept := false; end; -{=====} procedure TVpDayView.DragDrop(Source: TObject; X, Y: Integer); var @@ -1760,13 +1739,11 @@ begin dvClientVArea := Result * MinutesInDay div GranularityMinutes[UseGran]; dvRowHeight := Result; end; -{=====} function TVpDayView.GetLastVisibleDate: TDateTime; begin Result := Date + GetRealNumDays(Date); end; -{=====} function TVpDayView.GetRealNumDays(WorkDate: TDateTime) : Integer; var @@ -1784,7 +1761,6 @@ begin end else Result := FNumDays; end; -{=====} procedure TVpDayView.SetDrawingStyle(Value: TVpDrawingStyle); begin @@ -1793,7 +1769,6 @@ begin Repaint; end; end; -{=====} procedure TVpDayView.SetLineColor(Value: TColor); begin @@ -1802,7 +1777,6 @@ begin Repaint; end; end; -{=====} procedure TVpDayView.SetTopHour(Value: TVpHours); begin @@ -1811,7 +1785,6 @@ begin TopLine := HourToLine(FTopHour, FGranularity); end; end; -{=====} procedure TVpDayView.SetTopLine(Value: Integer); begin @@ -1854,7 +1827,6 @@ begin Invalidate; end; end; -{=====} procedure TVpDayView.SetDefTopHour(Value: TVpHours); begin @@ -1864,7 +1836,6 @@ begin TopHour := Value; end; end; -{=====} procedure TVpDayView.SetTimeIntervals(UseGran: TVpGranularity); var @@ -1903,7 +1874,6 @@ begin FTopLine := 0; Invalidate; end; -{=====} procedure TVpDayView.SetTimeFormat(Value: TVpTimeFormat); begin @@ -1912,7 +1882,6 @@ begin Invalidate; end; end; -{=====} procedure TVpDayView.SetDisplayDate(Value: TDateTime); begin @@ -1927,7 +1896,6 @@ begin ControlLink.Notify(self, neDateChange, Date); end; end; -{=====} {$IFNDEF LCL} procedure TVpDayView.WMSize(var Msg: TWMSize); @@ -1949,12 +1917,10 @@ begin else Invalidate; end; -{=====} procedure TVpDayView.CreateParams(var Params: TCreateParams); begin inherited CreateParams(Params); - with Params do begin Style := Style or WS_TABSTOP; @@ -1965,7 +1931,6 @@ begin {$ENDIF} end; end; -{=====} procedure TVpDayView.CreateWnd; begin @@ -1973,7 +1938,6 @@ begin PostMessage (Handle, Vp_DayViewInit, 0, 0); end; - procedure TVpDayView.MouseEnter; begin FMouseEvent := nil; @@ -2082,8 +2046,6 @@ begin end; end; -{=====} - {$IFNDEF LCL} procedure TVpDayView.WMLButtonDblClk(var Msg: TWMLButtonDblClk); {$ELSE} @@ -2125,7 +2087,6 @@ begin end; end; end; -{=====} {$IFDEF LCL} function TVpDayView.DoMouseWheel(Shift: TShiftState; WheelDelta: Integer; @@ -2183,7 +2144,6 @@ begin if FActiveEvent <> nil then dvSpawnEventEditDialog(IsNewEvent); end; -{=====} procedure TVpDayView.dvSpawnEventEditDialog(IsNewEvent: Boolean); var @@ -2229,7 +2189,6 @@ begin end; Invalidate; end; -{=====} {$IFNDEF LCL} procedure TVpDayView.WMSetFocus(var Msg: TWMSetFocus); @@ -2240,7 +2199,6 @@ begin Unused(Msg); if ActiveRow = -1 then ActiveRow := TopLine; end; -{=====} {$IFNDEF LCL} procedure TVpDayView.WMEraseBackground(var Msg: TWMERASEBKGND); @@ -2250,7 +2208,6 @@ procedure TVpDayView.WMEraseBackground(var Msg: TLMERASEBKGND); begin Msg.Result := 1; end; -{=====} {$IFNDEF LCL} procedure TVpDayView.CMWantSpecialKey(var Msg: TCMWantSpecialKey); @@ -2259,7 +2216,6 @@ begin Msg.Result := 1; end; {$ENDIF} -{=====} procedure TVpDayView.SetActiveEventByCoord(APoint: TPoint); var @@ -2303,19 +2259,18 @@ begin end; end; end; -{=====} function TVpDayView.GetEventAtCoord(APoint: TPoint): TVpEvent; var I: Integer; begin - result := nil; + Result := nil; for I := 0 to pred(Length(dvEventArray)) do begin if dvEventArray[I].Event = nil then Exit; if PointInRect(APoint, dvEventArray[I].Rec) then begin - result := TVpEvent(dvEventArray[I].Event); + Result := TVpEvent(dvEventArray[I].Event); Exit; end; end; @@ -2340,7 +2295,6 @@ begin dvClickTimer.Enabled := false; EditEvent; end; -{=====} procedure TVpDayView.EditEvent; var @@ -2498,7 +2452,6 @@ begin end; end; end; -{=====} {$IFNDEF LCL} procedure TVpDayView.WMVScroll(var Msg: TWMVScroll); @@ -2520,13 +2473,11 @@ begin SB_THUMBPOSITION, SB_THUMBTRACK : TopLine := Msg.Pos; end; end; -{=====} procedure TVpDayView.dvScrollVertical(Lines: Integer); begin TopLine := TopLine + Lines; end; -{=====} procedure TVpDayView.SetVScrollPos; var @@ -2551,7 +2502,6 @@ begin end; SetScrollInfo(Handle, SB_VERT, SI, True); end; -{=====} procedure TVpDayView.SetCustomRowHeight(Value: Integer); begin @@ -2615,7 +2565,6 @@ begin Invalidate; end; end; -{=====} procedure TVpDayView.SetActiveRow(Value: Integer); var @@ -2644,7 +2593,6 @@ begin Invalidate; end; end; -{=====} procedure TVpDayView.SetActiveCol(Value: Integer); begin @@ -2658,7 +2606,7 @@ begin Invalidate; end; end; -{=====} + procedure TVpDayView.SetDotDotDotColor(const v: TColor); begin if v <> FDotDotDotColor then begin @@ -2666,7 +2614,6 @@ begin Invalidate; end; end; -{=====} procedure TVpDayView.SetShowEventTimes(Value: Boolean); begin @@ -2675,7 +2622,6 @@ begin Invalidate; end end; -{=====} procedure TVpDayView.SetWrapStyle(const v: TVpDVWrapStyle); begin @@ -2701,8 +2647,6 @@ begin FComponentHint := Hint; end; -{=====} - procedure TVpDayView.dvSetActiveRowByCoord(Pnt: TPoint; Sloppy: Boolean); var I : Integer; @@ -2724,7 +2668,6 @@ begin end; end; end; -{=====} procedure TVpDayView.dvSetActiveColByCoord(Pnt: TPoint); var @@ -2738,7 +2681,6 @@ begin end; end; end; -{=====} function TVpDayView.GetControlType : TVpItemType; begin @@ -2828,6 +2770,7 @@ begin end; {$ENDIF} + (*****************************************************************************) { TVpCHAttributes } @@ -2837,14 +2780,12 @@ begin FOwner := AOwner; FFont := TVpFont.Create(AOwner); end; -{=====} destructor TVpCHAttributes.Destroy; begin FFont.Free; inherited; end; -{=====} procedure TVpCHAttributes.SetColor(const Value: TColor); begin @@ -2853,13 +2794,12 @@ begin FOwner.Invalidate; end; end; -{=====} procedure TVpCHAttributes.SetFont(Value: TVpFont); begin FFont.Assign(Value); end; -{=====} + (*****************************************************************************) { TVpRHAttributes } @@ -2875,7 +2815,6 @@ begin FMinuteFont.Name := 'Tahoma'; {$ENDIF} end; -{=====} destructor TVpRHAttributes.Destroy; begin @@ -2883,7 +2822,6 @@ begin FMinuteFont.Free; inherited; end; -{=====} procedure TVpRHAttributes.SetColor(const Value: TColor); begin @@ -2892,7 +2830,6 @@ begin FOwner.Invalidate; end; end; -{=====} procedure TVpRHAttributes.SetHourFont(Value: TVpFont); begin @@ -2901,7 +2838,6 @@ begin FOwner.Invalidate; end; end; -{=====} procedure TVpRHAttributes.SetMinuteFont(Value: TVpFont); begin diff --git a/components/tvplanit/source/vpdayviewpainter.pas b/components/tvplanit/source/vpdayviewpainter.pas index 22316680a..46580fdd1 100644 --- a/components/tvplanit/source/vpdayviewpainter.pas +++ b/components/tvplanit/source/vpdayviewpainter.pas @@ -1160,14 +1160,14 @@ var begin { size and place the Today button first. } with TVpDayViewOpener(FDayView) do begin - dvDayUpBtn.Visible := FShowNavButtons; - dvDayDownBtn.Visible := FShowNavButtons; - dvTodayBtn.Visible := FShowNavButtons; - dvWeekUpBtn.Visible := FShowNavButtons; - dvWeekDownBtn.Visible := FShowNavButtons; + dvDayUpBtn.Visible := ShowNavButtons; + dvDayDownBtn.Visible := ShowNavButtons; + dvTodayBtn.Visible := ShowNavButtons; + dvWeekUpBtn.Visible := ShowNavButtons; + dvWeekDownBtn.Visible := ShowNavButtons; { In order to hide the nav btns in designmode move them out of their parent } - if (csDesigning in ComponentState) and not FShowNavButtons then begin + if (csDesigning in ComponentState) and not ShowNavButtons then begin dvTodayBtn.Left := -Width; dvWeekDownBtn.Left := -Width; dvWeekUpBtn.Left := -Width;