tvplanit: Add WeekStartsOn property to TVpGanttView.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8493 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2022-09-19 21:42:45 +00:00
parent b864dfc278
commit c1d3789b4f

View File

@ -18,7 +18,7 @@ type
TVpGanttSpecialDayMode = (sdmColumn, sdmHeader); TVpGanttSpecialDayMode = (sdmColumn, sdmHeader);
const const
DEFAULT_GANTTVIEWOPTIONS = [ DEFAULT_GANTTVIEW_OPTIONS = [
gvoActiveDate, gvoHorizGrid, gvoVertGrid, gvoWeekends, gvoHolidays gvoActiveDate, gvoHorizGrid, gvoVertGrid, gvoWeekends, gvoHolidays
]; ];
@ -134,6 +134,7 @@ type
FOptions: TVpGanttViewOptions; FOptions: TVpGanttViewOptions;
FSpecialDayMode: TVpGanttSpecialDayMode; FSpecialDayMode: TVpGanttSpecialDayMode;
FTimeFormat: TVpTimeFormat; FTimeFormat: TVpTimeFormat;
FWeekStartsOn: TVpDayType;
FOnAddEvent: TVpOnAddNewEvent; FOnAddEvent: TVpOnAddNewEvent;
FOnDeletingEvent: TVpOnDeletingEvent; FOnDeletingEvent: TVpOnDeletingEvent;
@ -168,6 +169,7 @@ type
procedure SetTextMargin(AValue: Integer); procedure SetTextMargin(AValue: Integer);
procedure SetTopRow(AValue: Integer); procedure SetTopRow(AValue: Integer);
procedure SetWeekendColor(AValue: TColor); procedure SetWeekendColor(AValue: TColor);
procedure SetWeekStartsOn(Value: TVpDayType);
protected protected
// Needed by the painter // Needed by the painter
@ -317,13 +319,14 @@ type
property LineColor: TColor read FLineColor write SetLineColor default DEFAULT_LINECOLOR; property LineColor: TColor read FLineColor write SetLineColor default DEFAULT_LINECOLOR;
property MonthFormat: String index 1 read GetDateFormat write SetDateFormat stored IsStoredDateFormat; property MonthFormat: String index 1 read GetDateFormat write SetDateFormat stored IsStoredDateFormat;
property MonthFormat_short: String index 2 read GetDateFormat write SetDateFormat stored IsStoredDateFormat; property MonthFormat_short: String index 2 read GetDateFormat write SetDateFormat stored IsStoredDateFormat;
property Options: TVpGanttViewOptions read FOptions write SetOptions default DEFAULT_GANTTVIEWOPTIONS; property Options: TVpGanttViewOptions read FOptions write SetOptions default DEFAULT_GANTTVIEW_OPTIONS;
property PopupMenu: TPopupMenu read GetPopupMenu write SetPopupMenu; property PopupMenu: TPopupMenu read GetPopupMenu write SetPopupMenu;
property RowHeaderAttributes: TVpGanttRowHeaderAttributes read FRowHeaderAttributes write FRowHeaderAttributes; property RowHeaderAttributes: TVpGanttRowHeaderAttributes read FRowHeaderAttributes write FRowHeaderAttributes;
property SpecialDayMode: TVpGanttSpecialDayMode read FSpecialDayMode write SetSpecialDayMode default sdmColumn; property SpecialDayMode: TVpGanttSpecialDayMode read FSpecialDayMode write SetSpecialDayMode default sdmColumn;
property TextMargin: Integer read FTextMargin write SetTextMargin default 2; property TextMargin: Integer read FTextMargin write SetTextMargin default 2;
property TimeFormat: TVpTimeFormat read FTimeFormat write FTimeFormat default tf12Hour; property TimeFormat: TVpTimeFormat read FTimeFormat write FTimeFormat default tf12Hour;
property WeekendColor: TColor read FWeekendColor write SetWeekendColor default WEEKEND_COLOR; property WeekendColor: TColor read FWeekendColor write SetWeekendColor default WEEKEND_COLOR;
property WeekStartsOn: TVpDayType read FWeekStartsOn write SetWeekStartsOn default dtSunday;
// inherited events // inherited events
property OnClick; property OnClick;
// new events // new events
@ -467,9 +470,9 @@ begin
FDateFormat[1] := DEFAULT_MONTHFORMAT; FDateFormat[1] := DEFAULT_MONTHFORMAT;
FDateFormat[2] := DEFAULT_MONTHFORMAT_SHORT; FDateFormat[2] := DEFAULT_MONTHFORMAT_SHORT;
FDrawingStyle := ds3d; FDrawingStyle := ds3d;
FOptions := DEFAULT_GANTTVIEW_OPTIONS;
FScrollBars := ssBoth; FScrollBars := ssBoth;
FWeekStartsOn := dtSunday;
FOptions := DEFAULT_GANTTVIEWOPTIONS;
// Popup menu // Popup menu
FDefaultPopup := TPopupMenu.Create(Self); FDefaultPopup := TPopupMenu.Create(Self);
@ -1710,6 +1713,14 @@ begin
end; end;
end; end;
procedure TVpGanttView.SetWeekStartsOn(Value: TVpDayType);
begin
if FWeekStartsOn <> Value then begin
FWeekStartsOn := Value;
Invalidate;
end;
end;
procedure TVpGanttView.SpawnEventEditDialog(IsNewEvent: Boolean); procedure TVpGanttView.SpawnEventEditDialog(IsNewEvent: Boolean);
var var
AllowIt: Boolean; AllowIt: Boolean;