diff --git a/components/tvplanit/examples/demo/demomain.lfm b/components/tvplanit/examples/demo/demomain.lfm index 558b05aaa..f36b5f3da 100644 --- a/components/tvplanit/examples/demo/demomain.lfm +++ b/components/tvplanit/examples/demo/demomain.lfm @@ -25,9 +25,9 @@ object MainForm: TMainForm Height = 532 Top = 48 Width = 780 - ActivePage = TabSettings + ActivePage = TabEvents Align = alClient - TabIndex = 4 + TabIndex = 0 TabOrder = 0 object TabEvents: TTabSheet Caption = 'Events' @@ -52,6 +52,8 @@ object MainForm: TMainForm DataStore = VpBufDSDataStore1 ControlLink = VpControlLink1 Color = clWindow + Font.Height = -12 + ParentFont = False Align = alBottom TabStop = True TabOrder = 0 @@ -60,8 +62,10 @@ object MainForm: TMainForm DayHeadAttributes.Color = clBtnFace DayHeadAttributes.Font.Height = -13 DayNameStyle = dsShort + DayNumberFont.Height = -12 DrawingStyle = dsFlat EventDayStyle = [fsItalic] + EventFont.Height = -12 LineColor = clGray TimeFormat = tf12Hour OffDayColor = clSilver @@ -87,6 +91,8 @@ object MainForm: TMainForm DataStore = VpBufDSDataStore1 ControlLink = VpControlLink1 Color = clWindow + Font.Height = -12 + ParentFont = False ParentShowHint = False Align = alClient ReadOnly = False @@ -95,6 +101,7 @@ object MainForm: TMainForm AllDayEventAttributes.BackgroundColor = clBtnShadow AllDayEventAttributes.EventBorderColor = cl3DDkShadow AllDayEventAttributes.EventBackgroundColor = clBtnFace + AllDayEventAttributes.Font.Height = -12 ShowEventTimes = False DrawingStyle = dsFlat TimeSlotColors.Active = clWhite @@ -238,15 +245,20 @@ object MainForm: TMainForm DataStore = VpBufDSDataStore1 ControlLink = VpControlLink1 Color = clWindow + Font.Height = -12 + ParentFont = False AllDayEventAttributes.BackgroundColor = clWindow AllDayEventAttributes.EventBorderColor = clGray AllDayEventAttributes.EventBackgroundColor = clBtnFace + AllDayEventAttributes.Font.Height = -12 DateLabelFormat = 'dddd, mmmm dd, yyyy' DayHeadAttributes.Color = clBtnFace DayHeadAttributes.DateFormat = 'dddd mmmm, dd' DayHeadAttributes.Font.Height = -13 DayHeadAttributes.Bordered = True DrawingStyle = dsFlat + EventFont.Height = -12 + HeadAttributes.Font.Height = -12 HeadAttributes.Color = clBtnFace LineColor = clGray TimeFormat = tf12Hour diff --git a/components/tvplanit/source/vpbase.pas b/components/tvplanit/source/vpbase.pas index 7d921b174..6b4c1253d 100644 --- a/components/tvplanit/source/vpbase.pas +++ b/components/tvplanit/source/vpbase.pas @@ -76,7 +76,7 @@ type DOMString = WideString; { miscellaneous stuff } - TVpDrawingStyle = (dsFlat, ds3d, dsNone); + TVpDrawingStyle = (dsFlat, ds3d, dsNoBorder); // wp: rename dsNone --> dsNoBorder { event method types } TVpMouseWheelEvent = procedure(Sender: TObject; Shift: TShiftState; diff --git a/components/tvplanit/source/vpcontactgridpainter.pas b/components/tvplanit/source/vpcontactgridpainter.pas index 05a6fc0f5..15ee499c8 100644 --- a/components/tvplanit/source/vpcontactgridpainter.pas +++ b/components/tvplanit/source/vpcontactgridpainter.pas @@ -116,7 +116,7 @@ begin begin { Draw a 3d bevel } DrawBevelRect(RenderCanvas, R, BevelShadow, BevelHighlight); InflateRect(R, -1, -1); - drawBevelRect(RenderCanvas, R, BevelDarkShadow, BevelFace); + DrawBevelRect(RenderCanvas, R, BevelDarkShadow, BevelFace); end; end; end; diff --git a/components/tvplanit/source/vpdayviewpainter.pas b/components/tvplanit/source/vpdayviewpainter.pas index 2cf522490..a3ec03a88 100644 --- a/components/tvplanit/source/vpdayviewpainter.pas +++ b/components/tvplanit/source/vpdayviewpainter.pas @@ -1143,7 +1143,7 @@ begin BevelShadow ) end else - begin + if FDayView.DrawingStyle = dsFlat then begin RenderCanvas.Pen.Color := BevelShadow; TPSMoveTo(RenderCanvas, Angle, RenderIn, R.Right - 6, R.Bottom- 1); TPSLineTo(RenderCanvas, Angle, RenderIn, R.Left + 3, R.Bottom - 1); @@ -1368,7 +1368,7 @@ begin RealLeft + 2 + RealRowHeadWidth, RealBottom ); - if FDayView.DrawingStyle = dsFlat then + if FDayView.DrawingStyle <> ds3d then inc(ARect.Left); end; @@ -1616,7 +1616,7 @@ begin { Draw borders } tmpRect := Rect(RealLeft, RealTop, RealRight-1, RealBottom-1); if FDayView.DrawingStyle = dsFlat then begin - { Draw an outer and inner bevel - NO: no 3d effects in flat style! } + { Draw a simple border } DrawBevelRect(RenderCanvas, TPSRotateRectangle(Angle, RenderIn, tmpRect), BevelShadow, BevelShadow); end else if FDayView.DrawingStyle = ds3d then begin diff --git a/components/tvplanit/source/vpmonthviewpainter.pas b/components/tvplanit/source/vpmonthviewpainter.pas index 6c04fc613..c0eefafdd 100644 --- a/components/tvplanit/source/vpmonthviewpainter.pas +++ b/components/tvplanit/source/vpmonthviewpainter.pas @@ -71,7 +71,7 @@ var begin R := Rect(RealLeft, RealTop, RealRight - 1, RealBottom - 1); if FMonthView.DrawingStyle = dsFlat then begin - { draw an outer and inner bevel } + { draw a simple rectangular border } DrawBevelRect( RenderCanvas, TPSRotateRectangle(Angle, RenderIn, R), @@ -110,15 +110,20 @@ begin RenderCanvas.Brush.Color := DayHeadAttrColor; { build rect } - if FMonthView.DrawingStyle = ds3D then begin - dhRect.Left := RealLeft + 2; - dhRect.Top := RealTop + TVpMonthViewOpener(FMonthView).mvDayHeadHeight + 3; - dhRect.Right := RealRight - 3; + dhRect.Left := RealLeft; + dhRect.Top := RealTop + TVpMonthViewOpener(FMonthView).mvDayHeadHeight; + dhRect.Right := RealRight; + dhRect.Bottom := dhRect.Top + TVpMonthViewOpener(FMonthView).mvDayHeadHeight; + if FMonthView.DrawingStyle = ds3d then begin + inc(dhRect.Left, 2); + inc(dhRect.Top, 3); + dec(dhRect.Right, 3); dhRect.Bottom := dhRect.Top + TVpMonthViewOpener(FMonthView).mvDayHeadHeight; TPSFillRect(RenderCanvas, Angle, RenderIn, dhRect); R := TPSRotateRectangle(Angle, RenderIn, dhRect); DrawBevelRect(RenderCanvas, R, BevelHighlight, BevelDarkShadow); - end else begin + end else + if FMonthView.DrawingStyle = dsFlat then begin dhRect.Left := RealLeft; dhRect.Top := RealTop + TVpMonthViewOpener(FMonthView).mvDayHeadHeight; dhRect.Right := RealRight; @@ -126,6 +131,10 @@ begin TPSFillRect(RenderCanvas, Angle, RenderIn, dhRect); R := TPSRotateRectangle(Angle, RenderIn, dhRect); DrawBevelRect(RenderCanvas, R, BevelShadow, BevelShadow); + end else + begin + dhRect.Left := RealLeft; + TPSFillRect(RenderCanvas, Angle, RenderIn, dhRect); end; DayTag := Ord(FMonthView.WeekStartsOn); @@ -727,7 +736,8 @@ begin TPSFillRect(RenderCanvas, Angle, RenderIn, HeadRect); R := TPSRotateRectangle(Angle, RenderIn, HeadRect); DrawBevelRect(RenderCanvas, R, BevelHighlight, BevelDarkShadow); - end; + end else + TPSFillRect(RenderCanvas, Angle, RenderIn, HeadRect); { Position the spinner } with TVpMonthViewOpener(FMonthView) do begin @@ -739,9 +749,9 @@ begin { Acquire startdate and end date } HeadStr := FormatDateTime(FMonthView.DateLabelFormat, DisplayDate); - {$IF FPC_FULLVERSION < 30000} + {$IFDEF FPC}{$IF FPC_FULLVERSION < 30000} HeadStr := SysToUTF8(HeadStr); - {$ENDIF} + {$ENDIF}{$ENDIF} { Calculate the text rectangle } RenderCanvas.Font.Assign(FMonthView.DayHeadAttributes.Font); diff --git a/components/tvplanit/source/vpweekviewpainter.pas b/components/tvplanit/source/vpweekviewpainter.pas index 383bad02b..cedc0ad05 100644 --- a/components/tvplanit/source/vpweekviewpainter.pas +++ b/components/tvplanit/source/vpweekviewpainter.pas @@ -286,7 +286,7 @@ begin RenderCanvas.Font.Assign(FWeekView.DayHeadAttributes.Font); RenderCanvas.Brush.Color := RealDayHeadAttrColor; TPSFillRect(RenderCanvas, Angle, RenderIn, tmpRect); - if FWeekView.DayHeadAttributes.Bordered then + if FWeekView.DayHeadAttributes.Bordered and (FWeekView.DrawingStyle <> dsNoBorder) then TPSRectangle(RenderCanvas, Angle, RenderIn, tmpRect); { Fix Header String } @@ -569,6 +569,7 @@ begin HeadRect.Top ); HeadTextRect.BottomRight := HeadRect.BottomRight; + { Fix Header String } HeadStrLen := RenderCanvas.TextWidth(HeadStr); if HeadStrLen > HeadTextRect.Right - HeadTextRect.Left - TextMargin then @@ -576,6 +577,7 @@ begin HeadStr := GetDisplayString(RenderCanvas, HeadStr, 0, HeadTextRect.Right - HeadTextRect.Left - TextMargin ); end; + { position the spinner } with TVpWeekViewOpener(FWeekView) do begin wvSpinButtons.Height := Trunc(wvHeaderHeight * 0.8);