You've already forked lazarus-ccr
tvplanit: Adjust visibility of WeekView and MonthView variables and methods. Cosmetic changes. Less hints and warnings.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8413 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -316,7 +316,7 @@ implementation
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
SysUtils, DateUtils, Dialogs,
|
SysUtils, DateUtils, Dialogs,
|
||||||
VpVCard, VpContactEditDlg, VpContactGridPainter;
|
VpContactEditDlg, VpContactGridPainter;
|
||||||
|
|
||||||
|
|
||||||
(*****************************************************************************)
|
(*****************************************************************************)
|
||||||
@ -1649,9 +1649,7 @@ end;
|
|||||||
procedure TVpContactGrid.PopupImportVCards(Sender: TObject);
|
procedure TVpContactGrid.PopupImportVCards(Sender: TObject);
|
||||||
var
|
var
|
||||||
dlg: TOpenDialog;
|
dlg: TOpenDialog;
|
||||||
i: Integer;
|
|
||||||
fn: String;
|
fn: String;
|
||||||
id: Integer;
|
|
||||||
begin
|
begin
|
||||||
if ReadOnly or (not CheckCreateResource) or
|
if ReadOnly or (not CheckCreateResource) or
|
||||||
(not Assigned(Datastore)) or (not Assigned(Datastore.Resource))
|
(not Assigned(Datastore)) or (not Assigned(Datastore.Resource))
|
||||||
|
@ -500,7 +500,7 @@ type
|
|||||||
function GetContact(Index: Integer): TVpContact;
|
function GetContact(Index: Integer): TVpContact;
|
||||||
function Last:TVpContact;
|
function Last:TVpContact;
|
||||||
function ImportVCardFile(const AFileName: String; const APreview: Boolean = false;
|
function ImportVCardFile(const AFileName: String; const APreview: Boolean = false;
|
||||||
ADefaultCategory: Integer = -1): TVpContactArr;
|
{%H-}ADefaultCategory: Integer = -1): TVpContactArr;
|
||||||
procedure ExportVCardFile(const AFileName: String; const AContacts: TVpContactArr);
|
procedure ExportVCardFile(const AFileName: String; const AContacts: TVpContactArr);
|
||||||
procedure Sort;
|
procedure Sort;
|
||||||
|
|
||||||
|
@ -32,19 +32,23 @@
|
|||||||
|
|
||||||
The rendering of Visual PlanIt components is a bit involved. The component's
|
The rendering of Visual PlanIt components is a bit involved. The component's
|
||||||
Paint method calls RenderToCanvas. The RenderToCanvas method of each of
|
Paint method calls RenderToCanvas. The RenderToCanvas method of each of
|
||||||
the visual VisualPlanIt controls is repsonsible both for drawing to the
|
the visual VisualPlanIt controls is responsible both for drawing to the
|
||||||
screen (both design and run time) as well as printing. In the case of
|
screen (both design and run time) as well as printing. In the case of
|
||||||
printing, the component needs to render itself to an arbitrary rectangle
|
printing, the component needs to render itself to an arbitrary rectangle
|
||||||
and possibly rotated (for the screen the rectangle is the ClientRect
|
and possibly rotated (for the screen the rectangle is the ClientRect
|
||||||
and the rotation angle is always zero). To achieve that goal, the
|
and the rotation angle is always zero). To achieve that goal, the
|
||||||
functions in VpCanvasUtils are used to go between the rendering of the
|
functions in VpCanvasUtils are used to go between the rendering of the
|
||||||
control and the TCanvas that it needs to render to.
|
control and the TCanvas that it needs to render to.
|
||||||
|
|
||||||
The rendering of the DayView is complex. Look at the other components
|
The rendering of the DayView is complex. Look at the other components
|
||||||
(MonthView and TaskList are probably the best places to start) before making
|
(MonthView and TaskList are probably the best places to start) before making
|
||||||
changes to the DayView rendering.
|
changes to the DayView rendering.
|
||||||
|
|
||||||
The in place editor is currently based off the TCustomEdit class. This can
|
In the current version of TvPlanIt the extremely long rendering procedure
|
||||||
|
has been split off to a separate unit and an auxiliary painter class
|
||||||
|
(TVpDayViewPaitner in unit VpDayViewPainter).
|
||||||
|
|
||||||
|
The in place editor is currently based off the TCustomEdit class. This can
|
||||||
probably be changed to use a TCustomMemo as its base class. This will
|
probably be changed to use a TCustomMemo as its base class. This will
|
||||||
provide multi-line editing capabilities.
|
provide multi-line editing capabilities.
|
||||||
}
|
}
|
||||||
@ -83,10 +87,8 @@ type
|
|||||||
Date: TDateTime;
|
Date: TDateTime;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
type
|
|
||||||
TVpLineArray = array of TVpLineRec;
|
TVpLineArray = array of TVpLineRec;
|
||||||
|
|
||||||
type
|
|
||||||
TVpLineMatrix = array of TVpLineArray;
|
TVpLineMatrix = array of TVpLineArray;
|
||||||
TVpColRectArray = array of TVpColRec;
|
TVpColRectArray = array of TVpColRec;
|
||||||
|
|
||||||
@ -114,7 +116,7 @@ type
|
|||||||
TVpDayView = class;
|
TVpDayView = class;
|
||||||
|
|
||||||
TVpDvInplaceEdit = class(TCustomEdit)
|
TVpDvInplaceEdit = class(TCustomEdit)
|
||||||
protected{private}
|
protected
|
||||||
procedure CreateParams(var Params: TCreateParams); override;
|
procedure CreateParams(var Params: TCreateParams); override;
|
||||||
procedure KeyDown(var Key: Word; Shift: TShiftState); override;
|
procedure KeyDown(var Key: Word; Shift: TShiftState); override;
|
||||||
{$IFNDEF LCL}
|
{$IFNDEF LCL}
|
||||||
@ -127,7 +129,7 @@ type
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
TVpRHAttributes = class(TPersistent)
|
TVpRHAttributes = class(TPersistent)
|
||||||
protected{ private }
|
private
|
||||||
FOwner: TVpDayView;
|
FOwner: TVpDayView;
|
||||||
FColor: TColor;
|
FColor: TColor;
|
||||||
FHourFont: TVpFont;
|
FHourFont: TVpFont;
|
||||||
@ -135,6 +137,7 @@ type
|
|||||||
procedure SetColor(const Value: TColor);
|
procedure SetColor(const Value: TColor);
|
||||||
procedure SetHourFont(Value: TVpFont);
|
procedure SetHourFont(Value: TVpFont);
|
||||||
procedure SetMinuteFont(Value: TVpFont);
|
procedure SetMinuteFont(Value: TVpFont);
|
||||||
|
protected
|
||||||
public
|
public
|
||||||
constructor Create(AOwner: TVpDayView);
|
constructor Create(AOwner: TVpDayView);
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
@ -146,12 +149,13 @@ type
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
TVpAllDayEventAttributes = class(TPersistent)
|
TVpAllDayEventAttributes = class(TPersistent)
|
||||||
protected {Private}
|
private
|
||||||
FOwner: TWinControl;
|
|
||||||
FBackgroundColor: TColor;
|
FBackgroundColor: TColor;
|
||||||
FEventBackgroundColor: TColor;
|
FEventBackgroundColor: TColor;
|
||||||
FEventBorderColor: TColor;
|
FEventBorderColor: TColor;
|
||||||
FFont: TVpFont;
|
FFont: TVpFont;
|
||||||
|
protected
|
||||||
|
FOwner: TWinControl;
|
||||||
public
|
public
|
||||||
constructor Create(AOwner: TWinControl);
|
constructor Create(AOwner: TWinControl);
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
@ -171,12 +175,13 @@ type
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
TVpCHAttributes = class(TPersistent)
|
TVpCHAttributes = class(TPersistent)
|
||||||
protected{ private }
|
private
|
||||||
FOwner: TVpDayView;
|
FOwner: TVpDayView;
|
||||||
FColor: TColor;
|
FColor: TColor;
|
||||||
FFont: TVpFont;
|
FFont: TVpFont;
|
||||||
procedure SetColor(const Value: TColor);
|
procedure SetColor(const Value: TColor);
|
||||||
procedure SetFont(Value: TVpFont);
|
procedure SetFont(Value: TVpFont);
|
||||||
|
protected
|
||||||
public
|
public
|
||||||
constructor Create(AOwner: TVpDayView);
|
constructor Create(AOwner: TVpDayView);
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
@ -187,47 +192,47 @@ type
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
TVpDayViewIconAttributes = class(TPersistent)
|
TVpDayViewIconAttributes = class(TPersistent)
|
||||||
private
|
private
|
||||||
FShowAlarmBitmap: Boolean;
|
FShowAlarmBitmap: Boolean;
|
||||||
FShowCategoryBitmap: Boolean;
|
FShowCategoryBitmap: Boolean;
|
||||||
FShowRecurringBitmap: Boolean;
|
FShowRecurringBitmap: Boolean;
|
||||||
FAlarmBitmap: TBitmap;
|
FAlarmBitmap: TBitmap;
|
||||||
FRecurringBitmap: TBitmap;
|
FRecurringBitmap: TBitmap;
|
||||||
FAlarmImageIndex: TImageIndex;
|
FAlarmImageIndex: TImageIndex;
|
||||||
FRecurringImageIndex: TImageIndex;
|
FRecurringImageIndex: TImageIndex;
|
||||||
FShowInPrint: Boolean;
|
FShowInPrint: Boolean;
|
||||||
FOwner: TVpLinkableControl;
|
FOwner: TVpLinkableControl;
|
||||||
|
|
||||||
protected
|
protected
|
||||||
procedure SetAlarmBitmap(v: TBitmap);
|
procedure SetAlarmBitmap(v: TBitmap);
|
||||||
procedure SetAlarmImageIndex(v: TImageIndex);
|
procedure SetAlarmImageIndex(v: TImageIndex);
|
||||||
procedure SetRecurringBitmap(v: TBitmap);
|
procedure SetRecurringBitmap(v: TBitmap);
|
||||||
procedure SetRecurringImageIndex(v: TImageIndex);
|
procedure SetRecurringImageIndex(v: TImageIndex);
|
||||||
procedure SetShowAlarmBitmap(const v: Boolean);
|
procedure SetShowAlarmBitmap(const v: Boolean);
|
||||||
procedure SetShowCategoryBitmap(const v: Boolean);
|
procedure SetShowCategoryBitmap(const v: Boolean);
|
||||||
procedure SetShowRecurringBitmap(const v: Boolean);
|
procedure SetShowRecurringBitmap(const v: Boolean);
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create(AOwner: TVpLinkableControl);
|
constructor Create(AOwner: TVpLinkableControl);
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
|
|
||||||
published
|
published
|
||||||
property AlarmBitmap: TBitmap
|
property AlarmBitmap: TBitmap
|
||||||
read FAlarmBitmap write SetAlarmBitmap;
|
read FAlarmBitmap write SetAlarmBitmap;
|
||||||
property AlarmImageIndex: TImageIndex
|
property AlarmImageIndex: TImageIndex
|
||||||
read FAlarmImageIndex write SetAlarmImageIndex default -1;
|
read FAlarmImageIndex write SetAlarmImageIndex default -1;
|
||||||
property RecurringBitmap: TBitmap
|
property RecurringBitmap: TBitmap
|
||||||
read FRecurringBitmap write SetRecurringBitmap;
|
read FRecurringBitmap write SetRecurringBitmap;
|
||||||
property RecurringImageIndex: TImageIndex
|
property RecurringImageIndex: TImageIndex
|
||||||
read FRecurringImageIndex write SetRecurringImageIndex default -1;
|
read FRecurringImageIndex write SetRecurringImageIndex default -1;
|
||||||
property ShowAlarmBitmap: Boolean
|
property ShowAlarmBitmap: Boolean
|
||||||
read FShowAlarmBitmap write SetShowAlarmBitmap default True;
|
read FShowAlarmBitmap write SetShowAlarmBitmap default True;
|
||||||
property ShowCategoryBitmap : Boolean
|
property ShowCategoryBitmap : Boolean
|
||||||
read FShowCategoryBitmap write SetShowCategoryBitmap default True;
|
read FShowCategoryBitmap write SetShowCategoryBitmap default True;
|
||||||
property ShowRecurringBitmap : Boolean
|
property ShowRecurringBitmap : Boolean
|
||||||
read FShowRecurringBitmap write SetShowRecurringBitmap default True;
|
read FShowRecurringBitmap write SetShowRecurringBitmap default True;
|
||||||
property ShowInPrint: Boolean
|
property ShowInPrint: Boolean
|
||||||
read FShowInPrint write FShowInPrint default True;
|
read FShowInPrint write FShowInPrint default True;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TVpDayView }
|
{ TVpDayView }
|
||||||
@ -276,7 +281,7 @@ type
|
|||||||
FTopLine: Integer;
|
FTopLine: Integer;
|
||||||
FVisibleLines: Integer;
|
FVisibleLines: Integer;
|
||||||
FWrapStyle: TVpDVWrapStyle;
|
FWrapStyle: TVpDVWrapStyle;
|
||||||
// internal variables
|
// Internal variables
|
||||||
dvClickTimer: TTimer;
|
dvClickTimer: TTimer;
|
||||||
dvClientVArea: Integer;
|
dvClientVArea: Integer;
|
||||||
dvColHeadHeight: Integer;
|
dvColHeadHeight: Integer;
|
||||||
@ -284,7 +289,6 @@ type
|
|||||||
dvDragging: Boolean;
|
dvDragging: Boolean;
|
||||||
dvDragStartTime: TDateTime;
|
dvDragStartTime: TDateTime;
|
||||||
dvEndingEditing: Boolean;
|
dvEndingEditing: Boolean;
|
||||||
dvHotPoint: TPoint;
|
|
||||||
dvInLinkHandler: Boolean;
|
dvInLinkHandler: Boolean;
|
||||||
dvLoaded: Boolean;
|
dvLoaded: Boolean;
|
||||||
dvMouseDown: Boolean;
|
dvMouseDown: Boolean;
|
||||||
@ -293,8 +297,7 @@ type
|
|||||||
dvRowHeadWidth: Integer;
|
dvRowHeadWidth: Integer;
|
||||||
dvRowHeight: Integer;
|
dvRowHeight: Integer;
|
||||||
dvTimeIncSize: double;
|
dvTimeIncSize: double;
|
||||||
dvVScrollDelta: Integer;
|
// Event variables
|
||||||
// event variables
|
|
||||||
FAfterEdit: TVpAfterEditEvent;
|
FAfterEdit: TVpAfterEditEvent;
|
||||||
FBeforeEdit: TVpBeforeEditEvent;
|
FBeforeEdit: TVpBeforeEditEvent;
|
||||||
FOnAddEvent: TVpOnAddNewEvent;
|
FOnAddEvent: TVpOnAddNewEvent;
|
||||||
@ -352,7 +355,7 @@ type
|
|||||||
dvInPlaceEditor: TVpDvInPlaceEdit;
|
dvInPlaceEditor: TVpDvInPlaceEdit;
|
||||||
dvLineMatrix: TVpLineMatrix;
|
dvLineMatrix: TVpLineMatrix;
|
||||||
|
|
||||||
{ drag-drop methods }
|
{ Drag-drop methods }
|
||||||
procedure DoStartDrag(var DragObject: TDragObject); override;
|
procedure DoStartDrag(var DragObject: TDragObject); override;
|
||||||
procedure DoEndDrag(Target: TObject; X, Y: Integer); override;
|
procedure DoEndDrag(Target: TObject; X, Y: Integer); override;
|
||||||
procedure DragOver(Source: TObject; X, Y: Integer; State: TDragState;
|
procedure DragOver(Source: TObject; X, Y: Integer; State: TDragState;
|
||||||
|
@ -20,7 +20,7 @@ type
|
|||||||
FCalendar: TVpICalendar;
|
FCalendar: TVpICalendar;
|
||||||
FChecked: Boolean;
|
FChecked: Boolean;
|
||||||
protected
|
protected
|
||||||
procedure SaveToStrings(const AList: TStrings); virtual;
|
procedure SaveToStrings(const {%H-}AList: TStrings); virtual;
|
||||||
public
|
public
|
||||||
constructor Create(ACalendar: TVpICalendar); virtual;
|
constructor Create(ACalendar: TVpICalendar); virtual;
|
||||||
function FindItem(AKey: String): TVpICalItem;
|
function FindItem(AKey: String): TVpICalItem;
|
||||||
@ -353,6 +353,7 @@ procedure TVpICalEntry.SaveToStrings(const AList: TStrings);
|
|||||||
begin
|
begin
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
{==============================================================================}
|
{==============================================================================}
|
||||||
{ TVpICalAlarm }
|
{ TVpICalAlarm }
|
||||||
{==============================================================================}
|
{==============================================================================}
|
||||||
|
@ -13,9 +13,9 @@ type
|
|||||||
{ TVpImportPreviewICalEventForm }
|
{ TVpImportPreviewICalEventForm }
|
||||||
|
|
||||||
TVpImportPreviewICalEventForm = class(TVpImportPreviewForm)
|
TVpImportPreviewICalEventForm = class(TVpImportPreviewForm)
|
||||||
procedure GridGetEditText(Sender: TObject; ACol, ARow: Integer;
|
procedure GridGetEditText(Sender: TObject; {%H-}ACol, {%H-}ARow: Integer;
|
||||||
var Value: string);
|
var Value: string);
|
||||||
procedure GridSetEditText(Sender: TObject; ACol, ARow: Integer;
|
procedure GridSetEditText(Sender: TObject; {%H-}ACol, {%H-}ARow: Integer;
|
||||||
const Value: string);
|
const Value: string);
|
||||||
private
|
private
|
||||||
FCalendar: TVpICalendar;
|
FCalendar: TVpICalendar;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
unit VpImportPreview_ICalTask;
|
unit VpImportPreview_ICalTask;
|
||||||
|
|
||||||
{$mode objfpc}{$H+}
|
{$mode objfpc}{$H+}
|
||||||
|
{$WARN 5024 off : Parameter "$1" not used}
|
||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
@ -13,9 +13,9 @@ type
|
|||||||
{ TVpImportPreviewICalTaskForm }
|
{ TVpImportPreviewICalTaskForm }
|
||||||
|
|
||||||
TVpImportPreviewICalTaskForm = class(TVpImportPreviewForm)
|
TVpImportPreviewICalTaskForm = class(TVpImportPreviewForm)
|
||||||
procedure GridGetEditText(Sender: TObject; ACol, ARow: Integer;
|
procedure GridGetEditText(Sender: TObject; {%H-}ACol, {%H-}ARow: Integer;
|
||||||
var Value: string);
|
var Value: string);
|
||||||
procedure GridSetEditText(Sender: TObject; ACol, ARow: Integer;
|
procedure GridSetEditText(Sender: TObject; {%H-}ACol, ARow: Integer;
|
||||||
const Value: string);
|
const Value: string);
|
||||||
private
|
private
|
||||||
FCalendar: TVpICalendar;
|
FCalendar: TVpICalendar;
|
||||||
@ -154,7 +154,7 @@ end;
|
|||||||
|
|
||||||
procedure TVpImportPreviewICalTaskForm.PrepareItems;
|
procedure TVpImportPreviewICalTaskForm.PrepareItems;
|
||||||
var
|
var
|
||||||
i, j: Integer;
|
i: Integer;
|
||||||
ct: TVpCategoryType;
|
ct: TVpCategoryType;
|
||||||
cat: String;
|
cat: String;
|
||||||
L: TStrings;
|
L: TStrings;
|
||||||
|
@ -6,16 +6,16 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, Forms, Controls, Graphics, Dialogs,
|
Classes, SysUtils, Forms, Controls, Graphics, Dialogs,
|
||||||
VpData, VpBaseDS, VpImportPreview, VpVCard, Grids;
|
VpBaseDS, VpImportPreview, VpVCard, Grids;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
{ TVpImportPreviewVCardForm }
|
{ TVpImportPreviewVCardForm }
|
||||||
|
|
||||||
TVpImportPreviewVCardForm = class(TVpImportPreviewForm)
|
TVpImportPreviewVCardForm = class(TVpImportPreviewForm)
|
||||||
procedure GridGetEditText(Sender: TObject; ACol, ARow: Integer;
|
procedure GridGetEditText(Sender: TObject; {%H-}ACol, {%H-}ARow: Integer;
|
||||||
var Value: string);
|
var Value: string);
|
||||||
procedure GridSetEditText(Sender: TObject; ACol, ARow: Integer;
|
procedure GridSetEditText(Sender: TObject; {%H-}ACol, {%H-}ARow: Integer;
|
||||||
const Value: string);
|
const Value: string);
|
||||||
private
|
private
|
||||||
FVCards: TVpVCards;
|
FVCards: TVpVCards;
|
||||||
|
@ -126,9 +126,10 @@ type
|
|||||||
end;
|
end;
|
||||||
*)
|
*)
|
||||||
TVpMvTodayAttr = class(TVpMonthViewAttr)
|
TVpMvTodayAttr = class(TVpMonthViewAttr)
|
||||||
protected
|
private
|
||||||
FBorderPen: TPen;
|
FBorderPen: TPen;
|
||||||
procedure SetBorderPen(Value: TPen);
|
procedure SetBorderPen(Value: TPen);
|
||||||
|
protected
|
||||||
public
|
public
|
||||||
constructor Create(AOwner: TVpMonthView);
|
constructor Create(AOwner: TVpMonthView);
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
@ -141,89 +142,87 @@ type
|
|||||||
|
|
||||||
TVpMonthView = class(TVpLinkableControl)
|
TVpMonthView = class(TVpLinkableControl)
|
||||||
private
|
private
|
||||||
FComponentHint: TTranslateString;
|
|
||||||
FDefaultPopup: TPopupMenu;
|
|
||||||
FExternalPopup: TPopupMenu;
|
|
||||||
FHintMode: TVpHintMode;
|
|
||||||
FOnHoliday: TVpHolidayEvent;
|
|
||||||
FAllowDragAndDrop: Boolean;
|
FAllowDragAndDrop: Boolean;
|
||||||
FDragDropTransparent: Boolean;
|
|
||||||
FApplyCategoryInfos: Boolean;
|
FApplyCategoryInfos: Boolean;
|
||||||
procedure SetPopupMenu(AValue: TPopupMenu);
|
|
||||||
function IsStoredDateLabelFormat: Boolean;
|
|
||||||
procedure SetApplyCategoryInfos(AValue: Boolean);
|
|
||||||
protected{ private }
|
|
||||||
FKBNavigate: Boolean;
|
|
||||||
FColumnWidth: Integer;
|
|
||||||
FColor: TColor;
|
FColor: TColor;
|
||||||
FLineColor: TColor;
|
FColumnWidth: Integer;
|
||||||
FLineCount: Integer;
|
FComponentHint: TTranslateString;
|
||||||
FVisibleLines: Integer;
|
FDate: TDateTime;
|
||||||
|
FDateLabelFormat: string;
|
||||||
|
FDayHeadAttr: TVpMonthViewAttr;
|
||||||
FDayNameStyle: TVpMVDayNameStyle;
|
FDayNameStyle: TVpMVDayNameStyle;
|
||||||
|
FDayNumberFont: TVpFont;
|
||||||
|
FDefaultPopup: TPopupMenu;
|
||||||
|
FDragDropTransparent: Boolean;
|
||||||
|
FDrawingStyle: TVpDrawingStyle;
|
||||||
|
FEventDayStyle: TFontStyles;
|
||||||
|
FEventFont: TVpFont;
|
||||||
|
FExternalPopup: TPopupMenu;
|
||||||
|
FHeadAttr: TVpMonthViewAttr;
|
||||||
|
FHintMode: TVpHintMode;
|
||||||
|
FHolidayAttr: TVpMvHolidayAttr;
|
||||||
|
FKBNavigate: Boolean;
|
||||||
|
FLineColor: TColor;
|
||||||
|
FMouseDate: TDateTime;
|
||||||
FOffDayColor: TColor;
|
FOffDayColor: TColor;
|
||||||
FOffDayFontColor: TColor;
|
FOffDayFontColor: TColor;
|
||||||
|
FRightClickChangeDate: Boolean;
|
||||||
FSelectedDayColor: TColor;
|
FSelectedDayColor: TColor;
|
||||||
FWeekStartsOn: TVpDayType;
|
|
||||||
FShowEvents: Boolean;
|
FShowEvents: Boolean;
|
||||||
FEventDayStyle: TFontStyles;
|
|
||||||
FDateLabelFormat: string;
|
|
||||||
FShowEventTime: Boolean;
|
FShowEventTime: Boolean;
|
||||||
FTopLine: Integer;
|
FTimeFormat: TVpTimeFormat;
|
||||||
FDayHeadAttr: TVpMonthViewAttr;
|
|
||||||
FHeadAttr: TVpMonthViewAttr;
|
|
||||||
FHolidayAttr: TVpMvHolidayAttr;
|
|
||||||
FTodayAttr: TVpMvTodayAttr;
|
FTodayAttr: TVpMvTodayAttr;
|
||||||
FWeekendAttr: TVpMvWeekendAttr;
|
FWeekendAttr: TVpMvWeekendAttr;
|
||||||
FDayNumberFont: TVpFont;
|
FWeekStartsOn: TVpDayType;
|
||||||
FEventFont: TVpFont;
|
|
||||||
FTimeFormat: TVpTimeFormat;
|
// Internal variables
|
||||||
FDrawingStyle: TVpDrawingStyle;
|
mvActiveEvent: TVpEvent;
|
||||||
FDate: TDateTime;
|
mvActiveEventRec: TRect;
|
||||||
FRightClickChangeDate: Boolean;
|
mvDragging: Boolean;
|
||||||
FMouseDate: TDateTime;
|
mvLoaded: Boolean;
|
||||||
|
mvMouseDown: Boolean;
|
||||||
|
mvMouseDownPoint: TPoint;
|
||||||
|
|
||||||
|
// Event variables
|
||||||
|
FOnAddEvent: TVpOnAddNewEvent;
|
||||||
|
FOnEventClick: TVpOnEventClick;
|
||||||
|
FOnEventDblClick: TVpOnEventClick;
|
||||||
|
FOnHoliday: TVpHolidayEvent;
|
||||||
|
FOnModifyEvent: TVpOnModifyEvent;
|
||||||
|
FOwnerDrawCells: TVpOwnerDrawDayEvent;
|
||||||
|
FOwnerEditEvent: TVpEditEvent;
|
||||||
|
|
||||||
|
{ property methods }
|
||||||
|
function IsStoredDateLabelFormat: Boolean;
|
||||||
|
procedure SetApplyCategoryInfos(AValue: Boolean);
|
||||||
|
procedure SetColor(Value: TColor); reintroduce;
|
||||||
|
procedure SetDate(Value: TDateTime);
|
||||||
|
procedure SetDateLabelFormat(Value: string);
|
||||||
|
procedure SetDayNameStyle(Value: TVpMVDayNameStyle);
|
||||||
|
procedure SetDayNumberFont(Value: TVpFont);
|
||||||
|
procedure SetDrawingStyle(Value: TVpDrawingStyle);
|
||||||
|
procedure SetEventDayStyle(Value: TFontStyles);
|
||||||
|
procedure SetEventFont(Value: TVpFont);
|
||||||
|
procedure SetLineColor(Value: TColor);
|
||||||
|
procedure SetOffDayColor(Value: TColor);
|
||||||
|
procedure SetOffDayFontColor(Value: TColor);
|
||||||
|
procedure SetPopupMenu(AValue: TPopupMenu);
|
||||||
|
procedure SetRightClickChangeDate(const v: Boolean);
|
||||||
|
procedure SetSelectedDayColor(Value: TColor);
|
||||||
|
procedure SetShowEvents(Value: Boolean);
|
||||||
|
procedure SetShowEventTime(Value: Boolean);
|
||||||
|
procedure SetTimeFormat(Value: TVpTimeFormat);
|
||||||
|
procedure SetWeekStartsOn(Value: TVpDayType);
|
||||||
|
|
||||||
|
protected{ private }
|
||||||
|
// Needed by the drawer
|
||||||
FPrevYearBtn: TSpeedButton;
|
FPrevYearBtn: TSpeedButton;
|
||||||
FPrevMonthBtn: TSpeedButton;
|
FPrevMonthBtn: TSpeedButton;
|
||||||
FNextMonthBtn: TSpeedButton;
|
FNextMonthBtn: TSpeedButton;
|
||||||
FNextYearBtn: TSpeedButton;
|
FNextYearBtn: TSpeedButton;
|
||||||
|
|
||||||
{ event variables }
|
|
||||||
FOnAddEvent: TVpOnAddNewEvent;
|
|
||||||
FOnModifyEvent: TVpOnModifyEvent;
|
|
||||||
FOwnerDrawCells: TVpOwnerDrawDayEvent;
|
|
||||||
FOwnerEditEvent: TVpEditEvent;
|
|
||||||
FOnEventClick: TVpOnEventClick;
|
|
||||||
FOnEventDblClick: TVpOnEventClick;
|
|
||||||
|
|
||||||
{ internal variables }
|
|
||||||
mvLoaded: Boolean;
|
|
||||||
mvDayHeadHeight: Integer;
|
mvDayHeadHeight: Integer;
|
||||||
mvEventArray: TVpEventArray;
|
mvEventArray: TVpEventArray;
|
||||||
mvMonthDayArray: TVpMonthdayArray;
|
mvMonthDayArray: TVpMonthdayArray;
|
||||||
mvActiveEvent: TVpEvent;
|
|
||||||
mvActiveEventRec: TRect;
|
|
||||||
mvDragging: Boolean;
|
|
||||||
mvMouseDown: Boolean;
|
|
||||||
mvMouseDownPoint: TPoint;
|
|
||||||
// wvHotPoint: TPoint;
|
|
||||||
|
|
||||||
{ property methods }
|
|
||||||
procedure SetDrawingStyle(Value: TVpDrawingStyle);
|
|
||||||
procedure SetColor(Value: TColor); reintroduce;
|
|
||||||
procedure SetLineColor(Value: TColor);
|
|
||||||
procedure SetOffDayColor(Value: TColor);
|
|
||||||
procedure SetOffDayFontColor(Value: TColor);
|
|
||||||
procedure SetDateLabelFormat(Value: string);
|
|
||||||
procedure SetShowEvents(Value: Boolean);
|
|
||||||
procedure SetEventDayStyle(Value: TFontStyles);
|
|
||||||
procedure SetDayNameStyle(Value: TVpMVDayNameStyle);
|
|
||||||
procedure SetDayNumberFont(Value: TVpFont);
|
|
||||||
procedure SetEventFont(Value: TVpFont);
|
|
||||||
procedure SetSelectedDayColor(Value: TColor);
|
|
||||||
procedure SetShowEventTime(Value: Boolean);
|
|
||||||
procedure SetTimeFormat(Value: TVpTimeFormat);
|
|
||||||
procedure SetDate(Value: TDateTime);
|
|
||||||
procedure SetRightClickChangeDate(const v: Boolean);
|
|
||||||
procedure SetWeekStartsOn(Value: TVpDayType);
|
|
||||||
|
|
||||||
{ internal methods }
|
{ internal methods }
|
||||||
function GetDateAtCoord(APoint: TPoint): TDateTime;
|
function GetDateAtCoord(APoint: TPoint): TDateTime;
|
||||||
@ -563,7 +562,6 @@ begin
|
|||||||
FWeekendAttr.Free;
|
FWeekendAttr.Free;
|
||||||
FDayNumberFont.Free;
|
FDayNumberFont.Free;
|
||||||
FEventFont.Free;
|
FEventFont.Free;
|
||||||
// FDefaultPopup.Free;
|
|
||||||
inherited;
|
inherited;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -650,7 +648,6 @@ begin
|
|||||||
// mvInLinkHandler := false;
|
// mvInLinkHandler := false;
|
||||||
// end;
|
// end;
|
||||||
end;
|
end;
|
||||||
{=====}
|
|
||||||
|
|
||||||
procedure TVpMonthView.mvHookUp;
|
procedure TVpMonthView.mvHookUp;
|
||||||
var
|
var
|
||||||
@ -678,7 +675,6 @@ begin
|
|||||||
mvLoaded := true;
|
mvLoaded := true;
|
||||||
mvPopulate;
|
mvPopulate;
|
||||||
end;
|
end;
|
||||||
{=====}
|
|
||||||
|
|
||||||
function TVpMonthView.GetControlType: TVpItemType;
|
function TVpMonthView.GetControlType: TVpItemType;
|
||||||
begin
|
begin
|
||||||
@ -719,7 +715,6 @@ begin
|
|||||||
if DataStore <> nil then
|
if DataStore <> nil then
|
||||||
DataStore.Date := FDate;
|
DataStore.Date := FDate;
|
||||||
end;
|
end;
|
||||||
{=====}
|
|
||||||
|
|
||||||
procedure TVpMonthView.mvSpawnEventEditDialog(IsNewEvent: Boolean);
|
procedure TVpMonthView.mvSpawnEventEditDialog(IsNewEvent: Boolean);
|
||||||
var
|
var
|
||||||
@ -924,7 +919,6 @@ begin
|
|||||||
{ force a repaint on resize }
|
{ force a repaint on resize }
|
||||||
Invalidate;
|
Invalidate;
|
||||||
end;
|
end;
|
||||||
{=====}
|
|
||||||
|
|
||||||
procedure TVpMonthView.CreateParams(var Params: TCreateParams);
|
procedure TVpMonthView.CreateParams(var Params: TCreateParams);
|
||||||
begin
|
begin
|
||||||
@ -937,7 +931,6 @@ begin
|
|||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
{=====}
|
|
||||||
|
|
||||||
procedure TVpMonthView.CreateWnd;
|
procedure TVpMonthView.CreateWnd;
|
||||||
begin
|
begin
|
||||||
@ -947,7 +940,6 @@ begin
|
|||||||
FNextMonthBtn.Parent := self;
|
FNextMonthBtn.Parent := self;
|
||||||
FNextYearBtn.Parent := self;
|
FNextYearBtn.Parent := self;
|
||||||
end;
|
end;
|
||||||
{=====}
|
|
||||||
|
|
||||||
procedure TVpMonthView.DoEndDrag(Target: TObject; X, Y: Integer);
|
procedure TVpMonthView.DoEndDrag(Target: TObject; X, Y: Integer);
|
||||||
begin
|
begin
|
||||||
@ -1035,7 +1027,6 @@ begin
|
|||||||
Accept := true;
|
Accept := true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
{$IFNDEF LCL}
|
{$IFNDEF LCL}
|
||||||
procedure TVpMonthView.WMLButtonDown(var Msg: TWMLButtonDown);
|
procedure TVpMonthView.WMLButtonDown(var Msg: TWMLButtonDown);
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
@ -1056,7 +1047,6 @@ begin
|
|||||||
FOnEventClick(self, mvActiveEvent);
|
FOnEventClick(self, mvActiveEvent);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
{=====}
|
|
||||||
|
|
||||||
{$IFNDEF LCL}
|
{$IFNDEF LCL}
|
||||||
procedure TVpMonthView.WMLButtonDblClick(var Msg: TWMLButtonDblClk);
|
procedure TVpMonthView.WMLButtonDblClick(var Msg: TWMLButtonDblClk);
|
||||||
@ -1105,7 +1095,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
{=====}
|
|
||||||
|
|
||||||
{$IFNDEF LCL}
|
{$IFNDEF LCL}
|
||||||
procedure TVpMonthView.WMSetFocus(var Msg: TWMSetFocus);
|
procedure TVpMonthView.WMSetFocus(var Msg: TWMSetFocus);
|
||||||
@ -1116,7 +1105,6 @@ begin
|
|||||||
Unused(Msg);
|
Unused(Msg);
|
||||||
// if active event is nil then set active event to the first diaplsyed one.
|
// if active event is nil then set active event to the first diaplsyed one.
|
||||||
end;
|
end;
|
||||||
{=====}
|
|
||||||
|
|
||||||
{$IFNDEF LCL}
|
{$IFNDEF LCL}
|
||||||
procedure TVpMonthView.CMWantSpecialKey(var Msg: TCMWantSpecialKey);
|
procedure TVpMonthView.CMWantSpecialKey(var Msg: TCMWantSpecialKey);
|
||||||
@ -1125,7 +1113,6 @@ begin
|
|||||||
Msg.Result := 1;
|
Msg.Result := 1;
|
||||||
end;
|
end;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
{=====}
|
|
||||||
|
|
||||||
{$IFNDEF LCL}
|
{$IFNDEF LCL}
|
||||||
procedure TVpMonthView.WMRButtonDown(var Msg: TWMRButtonDown);
|
procedure TVpMonthView.WMRButtonDown(var Msg: TWMRButtonDown);
|
||||||
@ -1141,7 +1128,9 @@ begin
|
|||||||
mvSetDateByCoord (Point (Msg.XPos, Msg.YPos));
|
mvSetDateByCoord (Point (Msg.XPos, Msg.YPos));
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
{=====}
|
|
||||||
|
|
||||||
|
{ Hint support }
|
||||||
|
|
||||||
procedure TVpMonthView.ShowHintWindow(APoint: TPoint; ADate: TDateTime);
|
procedure TVpMonthView.ShowHintWindow(APoint: TPoint; ADate: TDateTime);
|
||||||
var
|
var
|
||||||
@ -1390,8 +1379,6 @@ begin
|
|||||||
Result := 0;
|
Result := 0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{=====}
|
|
||||||
|
|
||||||
procedure TVpMonthView.KeyDown(var Key: Word; Shift: TShiftState);
|
procedure TVpMonthView.KeyDown(var Key: Word; Shift: TShiftState);
|
||||||
var
|
var
|
||||||
M, D, Y: Word;
|
M, D, Y: Word;
|
||||||
@ -1594,7 +1581,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
{$IF VP_LCL_SCALING = 2}
|
{$IF VP_LCL_SCALING = 2}
|
||||||
procedure TVpMonthView.ScaleFontsPPI(const AToPPI: Integer;
|
procedure TVpMonthView.ScaleFontsPPI(const AToPPI: Integer;
|
||||||
const AProportion: Double);
|
const AProportion: Double);
|
||||||
|
@ -310,7 +310,7 @@ begin
|
|||||||
fs := FormatSettings;
|
fs := FormatSettings;
|
||||||
fs.DateSeparator := '-';
|
fs.DateSeparator := '-';
|
||||||
fs.ShortDateFormat := 'yyyy/mm/dd';
|
fs.ShortDateFormat := 'yyyy/mm/dd';
|
||||||
if TryStrToDate(item.Value, dt) then
|
if TryStrToDate(item.Value, dt, fs) then
|
||||||
begin
|
begin
|
||||||
if (item.Key = 'BDAY') then
|
if (item.Key = 'BDAY') then
|
||||||
FBirthday := dt
|
FBirthday := dt
|
||||||
@ -397,8 +397,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TVpVCard.SaveToStrings(AList: TStrings);
|
procedure TVpVCard.SaveToStrings(AList: TStrings);
|
||||||
var
|
|
||||||
s: String;
|
|
||||||
begin
|
begin
|
||||||
AList.Add('BEGIN:VCARD');
|
AList.Add('BEGIN:VCARD');
|
||||||
AList.Add('VERSION:3.0');
|
AList.Add('VERSION:3.0');
|
||||||
|
@ -77,7 +77,7 @@ type
|
|||||||
TVpWeekView = class;
|
TVpWeekView = class;
|
||||||
|
|
||||||
TVpWvInPlaceEdit = class(TCustomEdit)
|
TVpWvInPlaceEdit = class(TCustomEdit)
|
||||||
protected{private}
|
protected
|
||||||
procedure CreateParams(var Params: TCreateParams); override;
|
procedure CreateParams(var Params: TCreateParams); override;
|
||||||
procedure KeyDown(var Key: Word; Shift: TShiftState); override;
|
procedure KeyDown(var Key: Word; Shift: TShiftState); override;
|
||||||
public
|
public
|
||||||
@ -85,12 +85,13 @@ type
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
TVpWvHeadAttributes = class(TPersistent)
|
TVpWvHeadAttributes = class(TPersistent)
|
||||||
protected{ private }
|
private
|
||||||
FOwner: TVpWeekView;
|
FOwner: TVpWeekView;
|
||||||
FColor: TColor;
|
FColor: TColor;
|
||||||
FFont: TVpFont;
|
FFont: TVpFont;
|
||||||
procedure SetColor(const Value: TColor);
|
procedure SetColor(const Value: TColor);
|
||||||
procedure SetFont(Value: TVpFont);
|
procedure SetFont(Value: TVpFont);
|
||||||
|
protected
|
||||||
public
|
public
|
||||||
constructor Create(AOwner: TVpWeekView);
|
constructor Create(AOwner: TVpWeekView);
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
@ -101,7 +102,7 @@ type
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
TVpDayHeadAttr = class(TPersistent)
|
TVpDayHeadAttr = class(TPersistent)
|
||||||
protected{private}
|
private
|
||||||
FWeekView: TVpWeekView;
|
FWeekView: TVpWeekView;
|
||||||
FFont: TVpFont;
|
FFont: TVpFont;
|
||||||
FDateFormat: string;
|
FDateFormat: string;
|
||||||
@ -112,96 +113,134 @@ type
|
|||||||
procedure SetFont(Value: TVpFont);
|
procedure SetFont(Value: TVpFont);
|
||||||
procedure SetBordered(Value: Boolean);
|
procedure SetBordered(Value: Boolean);
|
||||||
procedure SetDateFormat(Value: string);
|
procedure SetDateFormat(Value: string);
|
||||||
|
protected
|
||||||
public
|
public
|
||||||
constructor Create(AOwner: TVpWeekView);
|
constructor Create(AOwner: TVpWeekView);
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
property WeekView: TVpWeekView read FWeekView;
|
property WeekView: TVpWeekView read FWeekView;
|
||||||
published
|
published
|
||||||
|
property Bordered: Boolean read FBordered write SetBordered default true;
|
||||||
property Color: TColor read FColor write SetColor default DEFAULT_COLOR;
|
property Color: TColor read FColor write SetColor default DEFAULT_COLOR;
|
||||||
property DateFormat: string read FDateFormat write SetDateFormat stored IsStoredDateFormat;
|
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 default true;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TVpWeekView }
|
{ TVpWeekView }
|
||||||
|
|
||||||
TVpWeekView = class(TVpLinkableControl)
|
TVpWeekView = class(TVpLinkableControl)
|
||||||
private
|
private
|
||||||
FComponentHint: TTranslateString;
|
|
||||||
FDefaultPopup: TPopupMenu;
|
|
||||||
FExternalPopup: TPopupMenu;
|
|
||||||
FHintMode: TVpHintMode;
|
|
||||||
FMouseEvent: TVpEvent;
|
|
||||||
FLayout: TVpWeekviewLayout;
|
|
||||||
FOnHoliday: TVpHolidayEvent;
|
|
||||||
function IsStoredDateLabelFormat: Boolean;
|
|
||||||
procedure SetActiveEvent(AValue: TVpEvent);
|
|
||||||
procedure SetApplyCategoryInfos(AValue: Boolean);
|
|
||||||
procedure SetLayout(AValue: TVpWeekviewLayout);
|
|
||||||
procedure SetPopupMenu(AValue: TPopupMenu);
|
|
||||||
protected{ private }
|
|
||||||
FActiveDate: TDateTime;
|
FActiveDate: TDateTime;
|
||||||
FColumnWidth: Integer;
|
|
||||||
FColor: TColor;
|
|
||||||
FDateLabelFormat: string;
|
|
||||||
FDayHeadAttributes: TVpDayHeadAttr;
|
|
||||||
FDrawingStyle: TVpDrawingStyle;
|
|
||||||
FActiveEvent: TVpEvent;
|
FActiveEvent: TVpEvent;
|
||||||
FHeadAttr: TVpWvHeadAttributes;
|
|
||||||
FEventFont: TVpFont; // was: TFont
|
|
||||||
FLineColor: TColor;
|
|
||||||
FLineCount: Integer;
|
|
||||||
FTimeFormat: TVpTimeFormat;
|
|
||||||
FShowEventTime: Boolean;
|
|
||||||
FVisibleLines: Integer;
|
|
||||||
FWeekStartsOn: TVpDayType;
|
|
||||||
FAllDayEventAttr: TVpAllDayEventAttributes;
|
FAllDayEventAttr: TVpAllDayEventAttributes;
|
||||||
FAllowInplaceEdit: Boolean;
|
FAllowInplaceEdit: Boolean;
|
||||||
FAllowDragAndDrop: Boolean;
|
FAllowDragAndDrop: Boolean;
|
||||||
FApplyCategoryInfos: Boolean;
|
FApplyCategoryInfos: Boolean;
|
||||||
|
FColor: TColor;
|
||||||
|
FColumnWidth: Integer;
|
||||||
|
FComponentHint: TTranslateString;
|
||||||
|
FDateLabelFormat: string;
|
||||||
|
FDayHeadAttributes: TVpDayHeadAttr;
|
||||||
|
FDefaultPopup: TPopupMenu;
|
||||||
FDragDropTransparent: Boolean;
|
FDragDropTransparent: Boolean;
|
||||||
|
FDrawingStyle: TVpDrawingStyle;
|
||||||
|
FEventFont: TVpFont; // was: TFont
|
||||||
|
FExternalPopup: TPopupMenu;
|
||||||
|
FHeadAttr: TVpWvHeadAttributes;
|
||||||
|
FHintMode: TVpHintMode;
|
||||||
|
FLineColor: TColor;
|
||||||
|
FMouseEvent: TVpEvent;
|
||||||
|
FLayout: TVpWeekviewLayout;
|
||||||
|
FShowEventTime: Boolean;
|
||||||
|
FTimeFormat: TVpTimeFormat;
|
||||||
|
FVisibleLines: Integer;
|
||||||
|
FWeekStartsOn: TVpDayType;
|
||||||
|
|
||||||
|
// Internal variables
|
||||||
|
wvClickTimer: TTimer;
|
||||||
|
wvCreatingEditor: Boolean;
|
||||||
|
wvDragging: Boolean;
|
||||||
|
wvHotPoint: TPoint;
|
||||||
|
wvInLinkHandler: Boolean;
|
||||||
|
wvInPlaceEditor: TVpWvInPlaceEdit;
|
||||||
|
wvLoaded: Boolean;
|
||||||
|
wvMouseDown: Boolean;
|
||||||
|
wvMouseDownPoint: TPoint;
|
||||||
|
wvPainting: Boolean;
|
||||||
|
|
||||||
|
// Event variables
|
||||||
|
FAfterEdit: TVpAfterEditEvent;
|
||||||
|
FBeforeEdit: TVpBeforeEditEvent;
|
||||||
|
FOnAddEvent: TVpOnAddNewEvent;
|
||||||
|
FOnDeletingEvent: TVpOnDeletingEvent;
|
||||||
|
FOnHoliday: TVpHolidayEvent;
|
||||||
|
FOnModifyEvent: TVpOnModifyEvent;
|
||||||
|
FOwnerEditEvent: TVpEditEvent;
|
||||||
|
|
||||||
|
// Property getter and setter methods
|
||||||
|
function IsStoredDateLabelFormat: Boolean;
|
||||||
|
procedure SetActiveDate(Value: TDateTime);
|
||||||
|
procedure SetActiveEvent(AValue: TVpEvent);
|
||||||
|
procedure SetApplyCategoryInfos(AValue: Boolean);
|
||||||
|
procedure SetColor(Value: TColor); reintroduce;
|
||||||
|
procedure SetDateLabelFormat(Value: string);
|
||||||
|
procedure SetDrawingStyle(Value: TVpDrawingStyle);
|
||||||
|
procedure SetEventFont(Value: TVpFont);
|
||||||
|
procedure SetLayout(AValue: TVpWeekviewLayout);
|
||||||
|
procedure SetLineColor(Value: TColor);
|
||||||
|
procedure SetPopupMenu(AValue: TPopupMenu);
|
||||||
|
procedure SetShowEventTime(Value: Boolean);
|
||||||
|
procedure SetTimeFormat(Value: TVpTimeFormat);
|
||||||
|
procedure SetWeekStartsOn(Value: TVpDayType);
|
||||||
|
|
||||||
|
protected
|
||||||
|
// Needed by the drawer
|
||||||
FPrevWeekBtn: TSpeedButton;
|
FPrevWeekBtn: TSpeedButton;
|
||||||
FPrevMonthBtn: TSpeedButton;
|
FPrevMonthBtn: TSpeedButton;
|
||||||
FNextMonthBtn: TSpeedButton;
|
FNextMonthBtn: TSpeedButton;
|
||||||
FNextWeekBtn: TSpeedButton;
|
FNextWeekBtn: TSpeedButton;
|
||||||
|
|
||||||
{ event variables }
|
|
||||||
FBeforeEdit: TVpBeforeEditEvent;
|
|
||||||
FAfterEdit: TVpAfterEditEvent;
|
|
||||||
FOwnerEditEvent: TVpEditEvent;
|
|
||||||
FOnAddEvent: TVpOnAddNewEvent;
|
|
||||||
FOnModifyEvent: TVpOnModifyEvent;
|
|
||||||
FOnDeletingEvent: TVpOnDeletingEvent;
|
|
||||||
{ internal variables }
|
{ internal variables }
|
||||||
wvInLinkHandler: Boolean;
|
|
||||||
wvClickTimer: TTimer;
|
|
||||||
wvLoaded: Boolean;
|
|
||||||
wvRowHeight: Integer;
|
|
||||||
// wvDayHeadHeight: Integer;
|
|
||||||
wvHeaderHeight: Integer;
|
|
||||||
wvStartDate: TDateTime;
|
|
||||||
wvEventList: TList;
|
|
||||||
wvEventArray: TVpEventArray;
|
|
||||||
wvWeekdayArray: TVpWeekdayArray;
|
|
||||||
wvActiveEventRec: TRect;
|
wvActiveEventRec: TRect;
|
||||||
wvInPlaceEditor: TVpWvInPlaceEdit;
|
wvEventArray: TVpEventArray;
|
||||||
wvCreatingEditor: Boolean;
|
wvEventList: TList;
|
||||||
wvPainting: Boolean;
|
wvHeaderHeight: Integer;
|
||||||
wvDragging: Boolean;
|
wvRowHeight: Integer;
|
||||||
wvMouseDown: Boolean;
|
wvStartDate: TDateTime;
|
||||||
wvMouseDownPoint: TPoint;
|
wvWeekdayArray: TVpWeekdayArray;
|
||||||
wvHotPoint: TPoint;
|
|
||||||
|
|
||||||
{ property methods }
|
{ internal methods }
|
||||||
procedure SetDrawingStyle(Value: TVpDrawingStyle);
|
procedure SpinButtonClick(Sender: TObject);
|
||||||
procedure SetColor(Value: TColor); reintroduce;
|
procedure wvEditInPlace(Sender: TObject);
|
||||||
procedure SetLineColor(Value: TColor);
|
procedure wvHookUp;
|
||||||
procedure SetDateLabelFormat(Value: string);
|
procedure wvPopulate;
|
||||||
procedure SetEventFont(Value: TVpFont);
|
|
||||||
procedure SetShowEventTime(Value: Boolean);
|
{ inherited standard methods }
|
||||||
procedure SetTimeFormat(Value: TVpTimeFormat);
|
procedure CreateParams(var Params: TCreateParams); override;
|
||||||
procedure SetActiveDate(Value: TDateTime);
|
procedure CreateWnd; override;
|
||||||
procedure SetWeekStartsOn(Value: TVpDayType);
|
procedure Loaded; override;
|
||||||
|
procedure KeyDown(var Key: Word; Shift: TShiftState); override;
|
||||||
|
procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X,Y: Integer); override;
|
||||||
|
procedure MouseEnter; override;
|
||||||
|
procedure MouseLeave; override;
|
||||||
|
procedure MouseMove(Shift: TShiftState; X, Y: Integer); override;
|
||||||
|
procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X,Y: Integer); override;
|
||||||
|
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
|
||||||
|
procedure Paint; override;
|
||||||
|
|
||||||
|
{ event related methods }
|
||||||
|
procedure EditEvent;
|
||||||
|
procedure EndEdit(Sender: TObject);
|
||||||
|
function EventAtCoord(Pt: TPoint): Boolean;
|
||||||
|
function GetEventAtCoord(Pt: TPoint): TVpEvent;
|
||||||
|
function GetEventRect(AEvent: TVpEvent): TRect;
|
||||||
|
procedure wvSetDateByCoord(Point: TPoint);
|
||||||
|
procedure wvSpawnEventEditDialog(IsNewEvent: Boolean);
|
||||||
|
|
||||||
|
{ drag and drop }
|
||||||
|
procedure DoEndDrag(Target: TObject; X, Y: Integer); override;
|
||||||
|
procedure DoStartDrag(var DragObject: TDragObject); override;
|
||||||
|
procedure DragOver(Source: TObject; X, Y: Integer; State: TDragState;
|
||||||
|
var Accept: Boolean); override;
|
||||||
|
|
||||||
{ Popup }
|
{ Popup }
|
||||||
function GetPopupMenu: TPopupMenu; override;
|
function GetPopupMenu: TPopupMenu; override;
|
||||||
@ -221,40 +260,6 @@ type
|
|||||||
procedure PopupCustomDate(Sender: TObject);
|
procedure PopupCustomDate(Sender: TObject);
|
||||||
procedure PopupPickResourceGroupEvent(Sender: TObject);
|
procedure PopupPickResourceGroupEvent(Sender: TObject);
|
||||||
|
|
||||||
{ internal methods }
|
|
||||||
procedure SpinButtonClick(Sender: TObject);
|
|
||||||
procedure wvEditInPlace(Sender: TObject);
|
|
||||||
procedure wvHookUp;
|
|
||||||
procedure wvPopulate;
|
|
||||||
|
|
||||||
{ event related methods }
|
|
||||||
procedure EditEvent;
|
|
||||||
procedure EndEdit(Sender: TObject);
|
|
||||||
function EventAtCoord(Pt: TPoint): Boolean;
|
|
||||||
function GetEventAtCoord(Pt: TPoint): TVpEvent;
|
|
||||||
function GetEventRect(AEvent: TVpEvent): TRect;
|
|
||||||
procedure wvSetDateByCoord(Point: TPoint);
|
|
||||||
procedure wvSpawnEventEditDialog(IsNewEvent: Boolean);
|
|
||||||
|
|
||||||
{ inherited standard methods }
|
|
||||||
procedure CreateParams(var Params: TCreateParams); override;
|
|
||||||
procedure CreateWnd; override;
|
|
||||||
procedure Loaded; override;
|
|
||||||
procedure KeyDown(var Key: Word; Shift: TShiftState); override;
|
|
||||||
procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X,Y: Integer); override;
|
|
||||||
procedure MouseEnter; override;
|
|
||||||
procedure MouseLeave; override;
|
|
||||||
procedure MouseMove(Shift: TShiftState; X, Y: Integer); override;
|
|
||||||
procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X,Y: Integer); override;
|
|
||||||
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
|
|
||||||
procedure Paint; override;
|
|
||||||
|
|
||||||
{ drag and drop }
|
|
||||||
procedure DoEndDrag(Target: TObject; X, Y: Integer); override;
|
|
||||||
procedure DoStartDrag(var DragObject: TDragObject); override;
|
|
||||||
procedure DragOver(Source: TObject; X, Y: Integer; State: TDragState;
|
|
||||||
var Accept: Boolean); override;
|
|
||||||
|
|
||||||
{ hints }
|
{ hints }
|
||||||
procedure ShowHintWindow(APoint: TPoint; AEvent: TVpEvent);
|
procedure ShowHintWindow(APoint: TPoint; AEvent: TVpEvent);
|
||||||
procedure HideHintWindow;
|
procedure HideHintWindow;
|
||||||
@ -355,6 +360,7 @@ uses
|
|||||||
SysUtils, StrUtils, LazUTF8, Dialogs,
|
SysUtils, StrUtils, LazUTF8, Dialogs,
|
||||||
VpEvntEditDlg, VpWeekViewPainter;
|
VpEvntEditDlg, VpWeekViewPainter;
|
||||||
|
|
||||||
|
|
||||||
(*****************************************************************************)
|
(*****************************************************************************)
|
||||||
{ TVpTGInPlaceEdit }
|
{ TVpTGInPlaceEdit }
|
||||||
(*****************************************************************************)
|
(*****************************************************************************)
|
||||||
@ -368,14 +374,12 @@ begin
|
|||||||
// DoubleBuffered := False;
|
// DoubleBuffered := False;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
{=====}
|
|
||||||
|
|
||||||
procedure TVpWvInPlaceEdit.CreateParams(var Params: TCreateParams);
|
procedure TVpWvInPlaceEdit.CreateParams(var Params: TCreateParams);
|
||||||
begin
|
begin
|
||||||
inherited CreateParams(Params);
|
inherited CreateParams(Params);
|
||||||
// Params.Style := Params.Style or ES_MULTILINE;
|
// Params.Style := Params.Style or ES_MULTILINE;
|
||||||
end;
|
end;
|
||||||
{=====}
|
|
||||||
|
|
||||||
procedure TVpWvInPlaceEdit.KeyDown(var Key: Word; Shift: TShiftState);
|
procedure TVpWvInPlaceEdit.KeyDown(var Key: Word; Shift: TShiftState);
|
||||||
var
|
var
|
||||||
@ -417,6 +421,8 @@ end;
|
|||||||
|
|
||||||
(*****************************************************************************)
|
(*****************************************************************************)
|
||||||
{ TVpContactHeadAttr }
|
{ TVpContactHeadAttr }
|
||||||
|
(*****************************************************************************)
|
||||||
|
|
||||||
constructor TVpDayHeadAttr.Create(AOwner: TVpWeekView);
|
constructor TVpDayHeadAttr.Create(AOwner: TVpWeekView);
|
||||||
begin
|
begin
|
||||||
inherited Create;
|
inherited Create;
|
||||||
@ -470,8 +476,41 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
(*****************************************************************************)
|
||||||
|
{ TVpWvHeadAttributes }
|
||||||
|
(*****************************************************************************)
|
||||||
|
|
||||||
|
constructor TVpWvHeadAttributes.Create(AOwner: TVpWeekView);
|
||||||
|
begin
|
||||||
|
inherited Create;
|
||||||
|
FOwner := AOwner;
|
||||||
|
FColor := clBtnFace;
|
||||||
|
FFont := TVpFont.Create(AOwner);
|
||||||
|
end;
|
||||||
|
|
||||||
|
destructor TVpWvHeadAttributes.Destroy;
|
||||||
|
begin
|
||||||
|
FFont.Free;
|
||||||
|
inherited;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TVpWvHeadAttributes.SetColor(const Value: TColor);
|
||||||
|
begin
|
||||||
|
if FColor <> Value then begin
|
||||||
|
FColor := Value;
|
||||||
|
FOwner.Invalidate;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TVpWvHeadAttributes.SetFont(Value: TVpFont);
|
||||||
|
begin
|
||||||
|
FFont.Assign(Value);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
(*****************************************************************************)
|
(*****************************************************************************)
|
||||||
{ TVpWeekView }
|
{ TVpWeekView }
|
||||||
|
(*****************************************************************************)
|
||||||
|
|
||||||
constructor TVpWeekView.Create(AOwner: TComponent);
|
constructor TVpWeekView.Create(AOwner: TComponent);
|
||||||
begin
|
begin
|
||||||
@ -543,7 +582,6 @@ begin
|
|||||||
FAllowInplaceEdit := true;
|
FAllowInplaceEdit := true;
|
||||||
|
|
||||||
{ set up fonts and colors }
|
{ set up fonts and colors }
|
||||||
// FDayHeadAttributes.Font.Name := 'Tahoma';
|
|
||||||
FDayHeadAttributes.Font.Size := 10;
|
FDayHeadAttributes.Font.Size := 10;
|
||||||
FDayHeadAttributes.Font.Style := [];
|
FDayHeadAttributes.Font.Style := [];
|
||||||
FDayHeadAttributes.Color := clBtnFace;
|
FDayHeadAttributes.Color := clBtnFace;
|
||||||
@ -757,7 +795,6 @@ procedure TVpWeekView.PaintToCanvas(ACanvas: TCanvas; ARect: TRect;
|
|||||||
begin
|
begin
|
||||||
RenderToCanvas(ACanvas, ARect, Angle, 1, ADate, -1, -1, gr30Min, True);
|
RenderToCanvas(ACanvas, ARect, Angle, 1, ADate, -1, -1, gr30Min, True);
|
||||||
end;
|
end;
|
||||||
{=====}
|
|
||||||
|
|
||||||
procedure TVpWeekView.RenderToCanvas(RenderCanvas: TCanvas; RenderIn: TRect;
|
procedure TVpWeekView.RenderToCanvas(RenderCanvas: TCanvas; RenderIn: TRect;
|
||||||
Angle: TVpRotationAngle; Scale: Extended; RenderDate: TDateTime;
|
Angle: TVpRotationAngle; Scale: Extended; RenderDate: TDateTime;
|
||||||
@ -1346,7 +1383,6 @@ begin
|
|||||||
if (Datastore <> nil) and (Datastore.Resource <> nil) then
|
if (Datastore <> nil) and (Datastore.Resource <> nil) then
|
||||||
AddResourceGroupMenu(FDefaultPopup.Items, Datastore.Resource, PopupPickResourceGroupEvent);
|
AddResourceGroupMenu(FDefaultPopup.Items, Datastore.Resource, PopupPickResourceGroupEvent);
|
||||||
end;
|
end;
|
||||||
{=====}
|
|
||||||
|
|
||||||
procedure TVpWeekView.PopupAddEvent(Sender: TObject);
|
procedure TVpWeekView.PopupAddEvent(Sender: TObject);
|
||||||
var
|
var
|
||||||
@ -1439,7 +1475,6 @@ begin
|
|||||||
if ActiveEvent <> nil then
|
if ActiveEvent <> nil then
|
||||||
wvSpawnEventEditDialog(IsNewEvent);
|
wvSpawnEventEditDialog(IsNewEvent);
|
||||||
end;
|
end;
|
||||||
{=====}
|
|
||||||
|
|
||||||
procedure TVpWeekView.PopupToday(Sender: TObject);
|
procedure TVpWeekView.PopupToday(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
@ -1533,7 +1568,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
Invalidate;
|
Invalidate;
|
||||||
end;
|
end;
|
||||||
{=====}
|
|
||||||
|
|
||||||
{$IFNDEF LCL}
|
{$IFNDEF LCL}
|
||||||
procedure TVpWeekView.CMWantSpecialKey(var Msg: TCMWantSpecialKey);
|
procedure TVpWeekView.CMWantSpecialKey(var Msg: TCMWantSpecialKey);
|
||||||
@ -1542,7 +1576,6 @@ begin
|
|||||||
Msg.Result := 1;
|
Msg.Result := 1;
|
||||||
end;
|
end;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
{=====}
|
|
||||||
|
|
||||||
procedure TVpWeekView.wvSetDateByCoord(Point: TPoint);
|
procedure TVpWeekView.wvSetDateByCoord(Point: TPoint);
|
||||||
var
|
var
|
||||||
@ -1556,7 +1589,6 @@ begin
|
|||||||
Exit;
|
Exit;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
{=====}
|
|
||||||
|
|
||||||
function TVpWeekView.EventAtCoord(Pt: TPoint): Boolean;
|
function TVpWeekView.EventAtCoord(Pt: TPoint): Boolean;
|
||||||
var
|
var
|
||||||
@ -1617,8 +1649,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{=====}
|
|
||||||
|
|
||||||
{ This is the timer event which spawns an in-place editor.
|
{ This is the timer event which spawns an in-place editor.
|
||||||
If the event is double-clicked before this timer fires, then the event is
|
If the event is double-clicked before this timer fires, then the event is
|
||||||
edited in a dialog based editor. }
|
edited in a dialog based editor. }
|
||||||
@ -1627,7 +1657,6 @@ begin
|
|||||||
wvClickTimer.Enabled := false;
|
wvClickTimer.Enabled := false;
|
||||||
EditEvent;
|
EditEvent;
|
||||||
end;
|
end;
|
||||||
{=====}
|
|
||||||
|
|
||||||
procedure TVpWeekView.EditEvent;
|
procedure TVpWeekView.EditEvent;
|
||||||
var
|
var
|
||||||
@ -1670,7 +1699,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
{=====}
|
|
||||||
|
|
||||||
procedure TVpWeekView.KeyDown(var Key: Word; Shift: TShiftState);
|
procedure TVpWeekView.KeyDown(var Key: Word; Shift: TShiftState);
|
||||||
var
|
var
|
||||||
@ -1760,7 +1788,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
{=====}
|
|
||||||
|
|
||||||
procedure TVpWeekView.EndEdit(Sender: TObject);
|
procedure TVpWeekView.EndEdit(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
@ -1919,37 +1946,5 @@ begin
|
|||||||
FExternalPopup := nil;
|
FExternalPopup := nil;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TVpWvHeadAttributes }
|
|
||||||
|
|
||||||
constructor TVpWvHeadAttributes.Create(AOwner: TVpWeekView);
|
|
||||||
begin
|
|
||||||
inherited Create;
|
|
||||||
FOwner := AOwner;
|
|
||||||
FColor := clBtnFace;
|
|
||||||
FFont := TVpFont.Create(AOwner);
|
|
||||||
end;
|
|
||||||
{=====}
|
|
||||||
|
|
||||||
destructor TVpWvHeadAttributes.Destroy;
|
|
||||||
begin
|
|
||||||
FFont.Free;
|
|
||||||
inherited;
|
|
||||||
end;
|
|
||||||
{=====}
|
|
||||||
|
|
||||||
procedure TVpWvHeadAttributes.SetColor(const Value: TColor);
|
|
||||||
begin
|
|
||||||
if FColor <> Value then begin
|
|
||||||
FColor := Value;
|
|
||||||
FOwner.Invalidate;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
{=====}
|
|
||||||
|
|
||||||
procedure TVpWvHeadAttributes.SetFont(Value: TVpFont);
|
|
||||||
begin
|
|
||||||
FFont.Assign(Value);
|
|
||||||
end;
|
|
||||||
{=====}
|
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
Reference in New Issue
Block a user