You've already forked lazarus-ccr
tvplanit: Make default popup menus of DayView/WeekView/MonthView/TaskList/ContactGrid accessible to the user.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8393 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -111,9 +111,12 @@ type
|
|||||||
TVpContactGrid = class(TVpLinkableControl)
|
TVpContactGrid = class(TVpLinkableControl)
|
||||||
private
|
private
|
||||||
FComponentHint: TTranslateString;
|
FComponentHint: TTranslateString;
|
||||||
|
FDefaultPopup: TPopupMenu;
|
||||||
|
FExternalPopup: TPopupMenu;
|
||||||
FHintMode: TVpHintMode;
|
FHintMode: TVpHintMode;
|
||||||
FPendingDatastore: TVpCustomDatastore;
|
FPendingDatastore: TVpCustomDatastore;
|
||||||
procedure InternalSetDatastore(const Value: TVpCustomDatastore);
|
procedure InternalSetDatastore(const Value: TVpCustomDatastore);
|
||||||
|
procedure SetPopupMenu(AValue: TPopupMenu);
|
||||||
protected{ private }
|
protected{ private }
|
||||||
FColumnWidth : Integer;
|
FColumnWidth : Integer;
|
||||||
FColor : TColor;
|
FColor : TColor;
|
||||||
@ -126,7 +129,6 @@ type
|
|||||||
FContactIndex : Integer;
|
FContactIndex : Integer;
|
||||||
FPrintNumColumns : Integer;
|
FPrintNumColumns : Integer;
|
||||||
FActiveContact : TVpContact;
|
FActiveContact : TVpContact;
|
||||||
FDefaultPopup : TPopupMenu;
|
|
||||||
FSortBy : TVpContactSort;
|
FSortBy : TVpContactSort;
|
||||||
{ contact variables }
|
{ contact variables }
|
||||||
FOwnerDrawContact : TVpOwnerDrawContactEvent;
|
FOwnerDrawContact : TVpOwnerDrawContactEvent;
|
||||||
@ -196,6 +198,7 @@ type
|
|||||||
procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X,Y: Integer); override;
|
procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X,Y: Integer); override;
|
||||||
procedure MouseMove(Shift: TShiftState; X, Y: Integer); override;
|
procedure MouseMove(Shift: TShiftState; X, Y: Integer); override;
|
||||||
procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;
|
procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;
|
||||||
|
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
|
||||||
procedure ScrollIntoView;
|
procedure ScrollIntoView;
|
||||||
procedure PopupAddContact(Sender: TObject);
|
procedure PopupAddContact(Sender: TObject);
|
||||||
procedure PopupAddVCards(Sender: TObject);
|
procedure PopupAddVCards(Sender: TObject);
|
||||||
@ -203,6 +206,7 @@ type
|
|||||||
procedure PopupEditContact(Sender: TObject);
|
procedure PopupEditContact(Sender: TObject);
|
||||||
procedure EditContact;
|
procedure EditContact;
|
||||||
procedure EndEdit(Sender: TObject);
|
procedure EndEdit(Sender: TObject);
|
||||||
|
function GetPopupMenu: TPopupMenu; override;
|
||||||
procedure InitializeDefaultPopup;
|
procedure InitializeDefaultPopup;
|
||||||
|
|
||||||
{ message handlers }
|
{ message handlers }
|
||||||
@ -264,10 +268,12 @@ type
|
|||||||
property Align;
|
property Align;
|
||||||
property Anchors;
|
property Anchors;
|
||||||
{$IFDEF LCL}
|
{$IFDEF LCL}
|
||||||
property BorderSpacing;
|
property BorderSpacing;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
property PopupMenu: TPopupMenu read GetPopupMenu write SetPopupMenu;
|
||||||
property TabStop default true;
|
property TabStop default true;
|
||||||
property TabOrder;
|
property TabOrder;
|
||||||
|
|
||||||
property AllowInPlaceEditing: Boolean
|
property AllowInPlaceEditing: Boolean
|
||||||
read FAllowInPlaceEdit write FAllowInPlaceEdit default true;
|
read FAllowInPlaceEdit write FAllowInPlaceEdit default true;
|
||||||
property BarWidth: Integer
|
property BarWidth: Integer
|
||||||
@ -500,8 +506,9 @@ begin
|
|||||||
Width := 225;
|
Width := 225;
|
||||||
|
|
||||||
FDefaultPopup := TPopupMenu.Create(Self);
|
FDefaultPopup := TPopupMenu.Create(Self);
|
||||||
Self.PopupMenu := FDefaultPopup;
|
FDefaultPopup.Name := 'default';
|
||||||
InitializeDefaultPopup;
|
InitializeDefaultPopup;
|
||||||
|
Self.PopupMenu := FDefaultPopup;
|
||||||
|
|
||||||
LoadLanguage;
|
LoadLanguage;
|
||||||
|
|
||||||
@ -1256,6 +1263,13 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TVpContactGrid.Notification(AComponent: TComponent; Operation: TOperation);
|
||||||
|
begin
|
||||||
|
inherited;
|
||||||
|
if (Operation = opRemove) and (AComponent = FExternalPopup) then
|
||||||
|
FExternalPopup := nil;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TVpContactGrid.cgSpawnContactEditDialog(IsNewContact: Boolean);
|
procedure TVpContactGrid.cgSpawnContactEditDialog(IsNewContact: Boolean);
|
||||||
var
|
var
|
||||||
AllowIt: Boolean;
|
AllowIt: Boolean;
|
||||||
@ -1498,7 +1512,22 @@ begin
|
|||||||
end;
|
end;
|
||||||
Invalidate;
|
Invalidate;
|
||||||
end;
|
end;
|
||||||
{=====}
|
|
||||||
|
function TVpContactGrid.GetPopupMenu: TPopupMenu;
|
||||||
|
begin
|
||||||
|
if FExternalPopup = nil then
|
||||||
|
Result := FDefaultPopup
|
||||||
|
else
|
||||||
|
Result := FExternalPopup;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TVpContactGrid.SetPopupMenu(AValue: TPopupMenu);
|
||||||
|
begin
|
||||||
|
if (AValue = nil) or (AValue = FDefaultPopup) then
|
||||||
|
FExternalPopup := nil
|
||||||
|
else
|
||||||
|
FExternalPopup := AValue;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TVpContactGrid.InitializeDefaultPopup;
|
procedure TVpContactGrid.InitializeDefaultPopup;
|
||||||
var
|
var
|
||||||
|
@ -235,10 +235,13 @@ type
|
|||||||
TVpDayView = class(TVpLinkableControl)
|
TVpDayView = class(TVpLinkableControl)
|
||||||
private
|
private
|
||||||
FComponentHint: TTranslateString;
|
FComponentHint: TTranslateString;
|
||||||
|
FDefaultPopup: TPopupMenu;
|
||||||
|
FExternalPopup: TPopupMenu;
|
||||||
FHintMode: TVpHintMode;
|
FHintMode: TVpHintMode;
|
||||||
FMouseEvent: TVpEvent;
|
FMouseEvent: TVpEvent;
|
||||||
FOnHoliday: TVpHolidayEvent;
|
FOnHoliday: TVpHolidayEvent;
|
||||||
function IsStoredDateLabelFormat: Boolean;
|
function IsStoredDateLabelFormat: Boolean;
|
||||||
|
procedure SetPopupMenu(AValue: TPopupMenu);
|
||||||
|
|
||||||
protected{ private }
|
protected{ private }
|
||||||
FGranularity: TVpGranularity;
|
FGranularity: TVpGranularity;
|
||||||
@ -254,7 +257,6 @@ type
|
|||||||
FActiveCol: Integer;
|
FActiveCol: Integer;
|
||||||
FActiveEvent: TVpEvent;
|
FActiveEvent: TVpEvent;
|
||||||
FGutterWidth: Integer;
|
FGutterWidth: Integer;
|
||||||
FDefaultPopup: TPopupMenu;
|
|
||||||
FLineCount: Integer;
|
FLineCount: Integer;
|
||||||
FVisibleLines: Integer;
|
FVisibleLines: Integer;
|
||||||
FTimeFormat: TVpTimeFormat;
|
FTimeFormat: TVpTimeFormat;
|
||||||
@ -367,6 +369,7 @@ type
|
|||||||
procedure SetHintMode(const AValue: TVpHintMode);
|
procedure SetHintMode(const AValue: TVpHintMode);
|
||||||
|
|
||||||
{ Popup }
|
{ Popup }
|
||||||
|
function GetPopupMenu: TPopupMenu; override;
|
||||||
procedure PopupAddEvent(Sender: TObject);
|
procedure PopupAddEvent(Sender: TObject);
|
||||||
procedure PopupAddFromICalFile(Sender: TObject);
|
procedure PopupAddFromICalFile(Sender: TObject);
|
||||||
procedure PopupDeleteEvent(Sender: TObject);
|
procedure PopupDeleteEvent(Sender: TObject);
|
||||||
@ -418,6 +421,7 @@ type
|
|||||||
procedure MouseLeave; override;
|
procedure MouseLeave; override;
|
||||||
procedure MouseMove(Shift: TShiftState; X,Y: Integer); override;
|
procedure MouseMove(Shift: TShiftState; X,Y: Integer); override;
|
||||||
procedure MouseUp(Button: TMouseButton; 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;
|
procedure Paint; override;
|
||||||
|
|
||||||
{ message handlers }
|
{ message handlers }
|
||||||
@ -491,6 +495,7 @@ type
|
|||||||
property BorderSpacing;
|
property BorderSpacing;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
property Constraints;
|
property Constraints;
|
||||||
|
property PopupMenu: TPopupMenu read GetPopupMenu write SetPopupMenu;
|
||||||
property ReadOnly default false;
|
property ReadOnly default false;
|
||||||
property TabStop default true;
|
property TabStop default true;
|
||||||
property TabOrder;
|
property TabOrder;
|
||||||
@ -888,8 +893,9 @@ begin
|
|||||||
|
|
||||||
// popup menu
|
// popup menu
|
||||||
FDefaultPopup := TPopupMenu.Create(Self);
|
FDefaultPopup := TPopupMenu.Create(Self);
|
||||||
Self.PopupMenu := FDefaultPopup;
|
FDefaultPopup.Name := 'default';
|
||||||
InitializeDefaultPopup;
|
InitializeDefaultPopup;
|
||||||
|
Self.PopupMenu := FDefaultPopup;
|
||||||
|
|
||||||
LoadLanguage;
|
LoadLanguage;
|
||||||
|
|
||||||
@ -1136,6 +1142,22 @@ end;
|
|||||||
|
|
||||||
{ Popup menu }
|
{ Popup menu }
|
||||||
|
|
||||||
|
function TVpDayView.GetPopupMenu: TPopupMenu;
|
||||||
|
begin
|
||||||
|
if FExternalPopup = nil then
|
||||||
|
Result := FDefaultPopup
|
||||||
|
else
|
||||||
|
Result := FExternalPopup;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TVpDayView.SetPopupMenu(AValue: TPopupMenu);
|
||||||
|
begin
|
||||||
|
if (AValue = nil) or (AValue = FDefaultPopup) then
|
||||||
|
FExternalPopup := nil
|
||||||
|
else
|
||||||
|
FExternalPopup := AValue;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TVpDayView.InitializeDefaultPopup;
|
procedure TVpDayView.InitializeDefaultPopup;
|
||||||
var
|
var
|
||||||
NewItem: TVpMenuItem;
|
NewItem: TVpMenuItem;
|
||||||
@ -2115,6 +2137,13 @@ begin
|
|||||||
end;
|
end;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
|
procedure TVpDayView.Notification(AComponent: TComponent; Operation: TOperation);
|
||||||
|
begin
|
||||||
|
inherited;
|
||||||
|
if (Operation = opRemove) and (AComponent = FExternalPopup) then
|
||||||
|
FExternalPopup := nil;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TVpDayView.EditSelectedEvent(IsNewEvent: Boolean = false);
|
procedure TVpDayView.EditSelectedEvent(IsNewEvent: Boolean = false);
|
||||||
begin
|
begin
|
||||||
if ReadOnly then
|
if ReadOnly then
|
||||||
|
@ -142,11 +142,14 @@ type
|
|||||||
TVpMonthView = class(TVpLinkableControl)
|
TVpMonthView = class(TVpLinkableControl)
|
||||||
private
|
private
|
||||||
FComponentHint: TTranslateString;
|
FComponentHint: TTranslateString;
|
||||||
|
FDefaultPopup: TPopupMenu;
|
||||||
|
FExternalPopup: TPopupMenu;
|
||||||
FHintMode: TVpHintMode;
|
FHintMode: TVpHintMode;
|
||||||
FOnHoliday: TVpHolidayEvent;
|
FOnHoliday: TVpHolidayEvent;
|
||||||
FAllowDragAndDrop: Boolean;
|
FAllowDragAndDrop: Boolean;
|
||||||
FDragDropTransparent: Boolean;
|
FDragDropTransparent: Boolean;
|
||||||
FApplyCategoryInfos: Boolean;
|
FApplyCategoryInfos: Boolean;
|
||||||
|
procedure SetPopupMenu(AValue: TPopupMenu);
|
||||||
function IsStoredDateLabelFormat: Boolean;
|
function IsStoredDateLabelFormat: Boolean;
|
||||||
procedure SetApplyCategoryInfos(AValue: Boolean);
|
procedure SetApplyCategoryInfos(AValue: Boolean);
|
||||||
protected{ private }
|
protected{ private }
|
||||||
@ -176,7 +179,6 @@ type
|
|||||||
FTimeFormat: TVpTimeFormat;
|
FTimeFormat: TVpTimeFormat;
|
||||||
FDrawingStyle: TVpDrawingStyle;
|
FDrawingStyle: TVpDrawingStyle;
|
||||||
FDate: TDateTime;
|
FDate: TDateTime;
|
||||||
FDefaultPopup: TPopupMenu;
|
|
||||||
FRightClickChangeDate: Boolean;
|
FRightClickChangeDate: Boolean;
|
||||||
FMouseDate: TDateTime;
|
FMouseDate: TDateTime;
|
||||||
FPrevYearBtn: TSpeedButton;
|
FPrevYearBtn: TSpeedButton;
|
||||||
@ -243,6 +245,7 @@ type
|
|||||||
procedure MouseLeave; override;
|
procedure MouseLeave; override;
|
||||||
procedure MouseMove(Shift: TShiftState; X,Y: Integer); override;
|
procedure MouseMove(Shift: TShiftState; X,Y: Integer); override;
|
||||||
procedure MouseUp(Button: TMouseButton; 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;
|
procedure Paint; override;
|
||||||
|
|
||||||
{ drag and drop }
|
{ drag and drop }
|
||||||
@ -274,6 +277,7 @@ type
|
|||||||
procedure SetHint(const AValue: TTranslateString); override;
|
procedure SetHint(const AValue: TTranslateString); override;
|
||||||
|
|
||||||
{ Popup menu }
|
{ Popup menu }
|
||||||
|
function GetPopupMenu: TPopupMenu; override;
|
||||||
procedure InitializeDefaultPopup;
|
procedure InitializeDefaultPopup;
|
||||||
procedure PopupToday(Sender: TObject);
|
procedure PopupToday(Sender: TObject);
|
||||||
procedure PopupNextMonth(Sender: TObject);
|
procedure PopupNextMonth(Sender: TObject);
|
||||||
@ -316,6 +320,7 @@ type
|
|||||||
{$IFDEF LCL}
|
{$IFDEF LCL}
|
||||||
property BorderSpacing;
|
property BorderSpacing;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
property PopupMenu: TPopupMenu read GetPopupMenu write SetPopupMenu;
|
||||||
property TabStop default true;
|
property TabStop default true;
|
||||||
property TabOrder;
|
property TabOrder;
|
||||||
property AllowDragAndDrop: Boolean read FAllowDragAndDrop write FAllowDragAndDrop default false;
|
property AllowDragAndDrop: Boolean read FAllowDragAndDrop write FAllowDragAndDrop default false;
|
||||||
@ -486,13 +491,6 @@ begin
|
|||||||
FNextYearUpBtn.Glyph.LoadFromResourceName(HINSTANCE, 'VPRIGHTARROWS');
|
FNextYearUpBtn.Glyph.LoadFromResourceName(HINSTANCE, 'VPRIGHTARROWS');
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
{
|
|
||||||
FHeadAttr := TVpMvHeadAttr.Create(self);
|
|
||||||
FDayHeadAttr := TVpDayHeadAttr.Create(self);
|
|
||||||
FTodayAttr := TVpMvTodayAttr.Create(self);
|
|
||||||
FHolidayAttr := TvpMvHolidayAttr.Create(self);
|
|
||||||
}
|
|
||||||
|
|
||||||
{ Set styles and initialize internal variables }
|
{ Set styles and initialize internal variables }
|
||||||
{$IFDEF VERSION4}
|
{$IFDEF VERSION4}
|
||||||
// DoubleBuffered := true;
|
// DoubleBuffered := true;
|
||||||
@ -522,9 +520,6 @@ begin
|
|||||||
// mvVisibleEvents := 0;
|
// mvVisibleEvents := 0;
|
||||||
|
|
||||||
{ set up fonts and colors }
|
{ set up fonts and colors }
|
||||||
// FDayHeadAttributes.Font.Name := 'Tahoma'; wp: better use defaults
|
|
||||||
// FDayHeadAttributes.Font.Size := 10;
|
|
||||||
// FDayHeadAttributes.Font.Style := [];
|
|
||||||
FDayHeadAttr.Color := clBtnFace;
|
FDayHeadAttr.Color := clBtnFace;
|
||||||
|
|
||||||
{ Assign default font to DayNumberFont and EventFont }
|
{ Assign default font to DayNumberFont and EventFont }
|
||||||
@ -548,14 +543,16 @@ begin
|
|||||||
Height := 225;
|
Height := 225;
|
||||||
Width := 300;
|
Width := 300;
|
||||||
|
|
||||||
|
{ Popup menu }
|
||||||
FDefaultPopup := TPopupMenu.Create(Self);
|
FDefaultPopup := TPopupMenu.Create(Self);
|
||||||
Self.PopupMenu := FDefaultPopup;
|
FDefaultPopup.Name := 'default';
|
||||||
InitializeDefaultPopup;
|
InitializeDefaultPopup;
|
||||||
|
Self.PopupMenu := FDefaultPopup;
|
||||||
|
|
||||||
LoadLanguage;
|
LoadLanguage;
|
||||||
|
|
||||||
mvHookUp;
|
mvHookUp;
|
||||||
end;
|
end;
|
||||||
{=====}
|
|
||||||
|
|
||||||
destructor TVpMonthView.Destroy;
|
destructor TVpMonthView.Destroy;
|
||||||
begin
|
begin
|
||||||
@ -1225,9 +1222,28 @@ begin
|
|||||||
FComponentHint := AValue;
|
FComponentHint := AValue;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
{ PopupMenu }
|
||||||
|
|
||||||
|
function TVpMonthView.GetPopupMenu: TPopupMenu;
|
||||||
|
begin
|
||||||
|
if FExternalPopup = nil then
|
||||||
|
Result := FDefaultPopup
|
||||||
|
else
|
||||||
|
Result := FExternalPopup;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TVpMonthView.SetPopupMenu(AValue: TPopupMenu);
|
||||||
|
begin
|
||||||
|
if (AValue = nil) or (AValue = FDefaultPopup) then
|
||||||
|
FExternalPopup := nil
|
||||||
|
else
|
||||||
|
FExternalPopup := AValue;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TVpMonthView.InitializeDefaultPopup;
|
procedure TVpMonthView.InitializeDefaultPopup;
|
||||||
var
|
var
|
||||||
NewItem : TVpMenuItem;
|
NewItem: TVpMenuItem;
|
||||||
begin
|
begin
|
||||||
FDefaultPopup.Items.Clear;
|
FDefaultPopup.Items.Clear;
|
||||||
|
|
||||||
@ -1557,6 +1573,13 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TVpMonthView.Notification(AComponent: TComponent; Operation: TOperation);
|
||||||
|
begin
|
||||||
|
inherited;
|
||||||
|
if (Operation = opRemove) and (AComponent = FExternalPopup) then
|
||||||
|
FExternalPopup := nil;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TVpMonthView.SetRightClickChangeDate(const v: Boolean);
|
procedure TVpMonthView.SetRightClickChangeDate(const v: Boolean);
|
||||||
begin
|
begin
|
||||||
if v <> FRightClickChangeDate then
|
if v <> FRightClickChangeDate then
|
||||||
|
@ -123,6 +123,10 @@ type
|
|||||||
|
|
||||||
{ Task List }
|
{ Task List }
|
||||||
TVpTaskList = class(TVpLinkableControl)
|
TVpTaskList = class(TVpLinkableControl)
|
||||||
|
private
|
||||||
|
FDefaultPopup: TPopupMenu;
|
||||||
|
FExternalPopup: TPopupMenu;
|
||||||
|
procedure SetPopupMenu(AValue: TPopupMenu);
|
||||||
protected{ private }
|
protected{ private }
|
||||||
FColor: TColor;
|
FColor: TColor;
|
||||||
FCaption: string;
|
FCaption: string;
|
||||||
@ -136,7 +140,6 @@ type
|
|||||||
FMaxVisibleTasks: Word;
|
FMaxVisibleTasks: Word;
|
||||||
FDrawingStyle: TVpDrawingStyle;
|
FDrawingStyle: TVpDrawingStyle;
|
||||||
FTaskID: Integer;
|
FTaskID: Integer;
|
||||||
FDefaultPopup: TPopupMenu;
|
|
||||||
FShowIcon: Boolean;
|
FShowIcon: Boolean;
|
||||||
FAllowInplaceEdit: Boolean;
|
FAllowInplaceEdit: Boolean;
|
||||||
{ task variables }
|
{ task variables }
|
||||||
@ -170,6 +173,7 @@ type
|
|||||||
procedure SetShowIcon(const v: Boolean);
|
procedure SetShowIcon(const v: Boolean);
|
||||||
procedure SetShowResourceName(Value: Boolean);
|
procedure SetShowResourceName(Value: Boolean);
|
||||||
{ internal methods }
|
{ internal methods }
|
||||||
|
function GetPopupMenu: TPopupMenu; override;
|
||||||
procedure InitializeDefaultPopup;
|
procedure InitializeDefaultPopup;
|
||||||
procedure PopupAddTask(Sender: TObject);
|
procedure PopupAddTask(Sender: TObject);
|
||||||
procedure PopupAddFromICalFile(Sender: TObject);
|
procedure PopupAddFromICalFile(Sender: TObject);
|
||||||
@ -181,6 +185,7 @@ type
|
|||||||
procedure tlHookUp;
|
procedure tlHookUp;
|
||||||
procedure Paint; override;
|
procedure Paint; override;
|
||||||
procedure Loaded; override;
|
procedure Loaded; override;
|
||||||
|
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
|
||||||
procedure tlSpawnTaskEditDialog(IsNewTask: Boolean);
|
procedure tlSpawnTaskEditDialog(IsNewTask: Boolean);
|
||||||
procedure tlSetActiveTaskByCoord(Pnt: TPoint);
|
procedure tlSetActiveTaskByCoord(Pnt: TPoint);
|
||||||
function tlVisibleTaskToTaskIndex(const VisTaskIndex: Integer) : Integer;
|
function tlVisibleTaskToTaskIndex(const VisTaskIndex: Integer) : Integer;
|
||||||
@ -236,9 +241,10 @@ type
|
|||||||
property Align;
|
property Align;
|
||||||
property Anchors;
|
property Anchors;
|
||||||
property Font;
|
property Font;
|
||||||
|
property PopupMenu: TPopupMenu read GetPopupMenu write SetPopupMenu;
|
||||||
|
property ReadOnly default false;
|
||||||
property TabStop default true;
|
property TabStop default true;
|
||||||
property TabOrder;
|
property TabOrder;
|
||||||
property ReadOnly default false;
|
|
||||||
{$IFDEF LCL}
|
{$IFDEF LCL}
|
||||||
property BorderSpacing;
|
property BorderSpacing;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
@ -530,8 +536,9 @@ begin
|
|||||||
Width := 169;
|
Width := 169;
|
||||||
|
|
||||||
FDefaultPopup := TPopupMenu.Create(Self);
|
FDefaultPopup := TPopupMenu.Create(Self);
|
||||||
Self.PopupMenu := FDefaultPopup;
|
FDefaultPopup.Name := 'default';
|
||||||
InitializeDefaultPopup;
|
InitializeDefaultPopup;
|
||||||
|
Self.PopupMenu := FDefaultPopup;
|
||||||
|
|
||||||
LoadLanguage;
|
LoadLanguage;
|
||||||
|
|
||||||
@ -612,6 +619,13 @@ begin
|
|||||||
tlLoaded := true;
|
tlLoaded := true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TVpTaskList.Notification(AComponent: TComponent; Operation: TOperation);
|
||||||
|
begin
|
||||||
|
inherited;
|
||||||
|
if (Operation = opRemove) and (AComponent = FExternalPopup) then
|
||||||
|
FExternalPopup := nil;
|
||||||
|
end;
|
||||||
|
|
||||||
function TVpTaskList.GetControlType: TVpItemType;
|
function TVpTaskList.GetControlType: TVpItemType;
|
||||||
begin
|
begin
|
||||||
Result := itTasks;
|
Result := itTasks;
|
||||||
@ -846,6 +860,22 @@ begin
|
|||||||
tlSpawnTaskEditDialog(FActiveTask = nil);
|
tlSpawnTaskEditDialog(FActiveTask = nil);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TVpTaskList.GetPopupMenu: TPopupMenu;
|
||||||
|
begin
|
||||||
|
if FExternalPopup = nil then
|
||||||
|
Result := FDefaultPopup
|
||||||
|
else
|
||||||
|
Result := FExternalPopup;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TVpTaskList.SetPopupMenu(AValue: TPopupMenu);
|
||||||
|
begin
|
||||||
|
if (AValue = nil) or (AValue = FDefaultPopup) then
|
||||||
|
FExternalPopup := nil
|
||||||
|
else
|
||||||
|
FExternalPopup := AValue;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TVpTaskList.InitializeDefaultPopup;
|
procedure TVpTaskList.InitializeDefaultPopup;
|
||||||
var
|
var
|
||||||
NewItem: TVpMenuItem;
|
NewItem: TVpMenuItem;
|
||||||
|
@ -128,6 +128,8 @@ type
|
|||||||
TVpWeekView = class(TVpLinkableControl)
|
TVpWeekView = class(TVpLinkableControl)
|
||||||
private
|
private
|
||||||
FComponentHint: TTranslateString;
|
FComponentHint: TTranslateString;
|
||||||
|
FDefaultPopup: TPopupMenu;
|
||||||
|
FExternalPopup: TPopupMenu;
|
||||||
FHintMode: TVpHintMode;
|
FHintMode: TVpHintMode;
|
||||||
FMouseEvent: TVpEvent;
|
FMouseEvent: TVpEvent;
|
||||||
FLayout: TVpWeekviewLayout;
|
FLayout: TVpWeekviewLayout;
|
||||||
@ -136,6 +138,7 @@ type
|
|||||||
procedure SetActiveEvent(AValue: TVpEvent);
|
procedure SetActiveEvent(AValue: TVpEvent);
|
||||||
procedure SetApplyCategoryInfos(AValue: Boolean);
|
procedure SetApplyCategoryInfos(AValue: Boolean);
|
||||||
procedure SetLayout(AValue: TVpWeekviewLayout);
|
procedure SetLayout(AValue: TVpWeekviewLayout);
|
||||||
|
procedure SetPopupMenu(AValue: TPopupMenu);
|
||||||
protected{ private }
|
protected{ private }
|
||||||
FActiveDate: TDateTime;
|
FActiveDate: TDateTime;
|
||||||
FColumnWidth: Integer;
|
FColumnWidth: Integer;
|
||||||
@ -152,7 +155,6 @@ type
|
|||||||
FShowEventTime: Boolean;
|
FShowEventTime: Boolean;
|
||||||
FVisibleLines: Integer;
|
FVisibleLines: Integer;
|
||||||
FWeekStartsOn: TVpDayType;
|
FWeekStartsOn: TVpDayType;
|
||||||
FDefaultPopup: TPopupMenu;
|
|
||||||
FAllDayEventAttr: TVpAllDayEventAttributes;
|
FAllDayEventAttr: TVpAllDayEventAttributes;
|
||||||
FAllowInplaceEdit: Boolean;
|
FAllowInplaceEdit: Boolean;
|
||||||
FAllowDragAndDrop: Boolean;
|
FAllowDragAndDrop: Boolean;
|
||||||
@ -202,6 +204,7 @@ type
|
|||||||
procedure SetWeekStartsOn(Value: TVpDayType);
|
procedure SetWeekStartsOn(Value: TVpDayType);
|
||||||
|
|
||||||
{ Popup }
|
{ Popup }
|
||||||
|
function GetPopupMenu: TPopupMenu; override;
|
||||||
procedure PopupAddEvent(Sender: TObject);
|
procedure PopupAddEvent(Sender: TObject);
|
||||||
procedure PopupAddFromICalFile(Sender: TObject);
|
procedure PopupAddFromICalFile(Sender: TObject);
|
||||||
procedure PopupDeleteEvent(Sender: TObject);
|
procedure PopupDeleteEvent(Sender: TObject);
|
||||||
@ -242,6 +245,7 @@ type
|
|||||||
procedure MouseLeave; override;
|
procedure MouseLeave; override;
|
||||||
procedure MouseMove(Shift: TShiftState; X, Y: Integer); override;
|
procedure MouseMove(Shift: TShiftState; X, Y: Integer); override;
|
||||||
procedure MouseUp(Button: TMouseButton; 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;
|
procedure Paint; override;
|
||||||
|
|
||||||
{ drag and drop }
|
{ drag and drop }
|
||||||
@ -325,6 +329,7 @@ type
|
|||||||
{$IFDEF LCL}
|
{$IFDEF LCL}
|
||||||
property BorderSpacing;
|
property BorderSpacing;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
property PopupMenu: TPopupMenu read GetPopupMenu write SetPopupMenu;
|
||||||
property TabStop default true;
|
property TabStop default true;
|
||||||
property TabOrder;
|
property TabOrder;
|
||||||
|
|
||||||
@ -549,9 +554,10 @@ begin
|
|||||||
Height := 225;
|
Height := 225;
|
||||||
Width := 300;
|
Width := 300;
|
||||||
|
|
||||||
FDefaultPopup := TPopupMenu.Create (Self);
|
FDefaultPopup := TPopupMenu.Create(Self);
|
||||||
Self.PopupMenu := FDefaultPopup;
|
FDefaultPopup.Name := 'default';
|
||||||
InitializeDefaultPopup;
|
InitializeDefaultPopup;
|
||||||
|
Self.PopupMenu := FDefaultPopup;
|
||||||
|
|
||||||
FAllDayEventAttr.BackgroundColor := Color;
|
FAllDayEventAttr.BackgroundColor := Color;
|
||||||
FAllDayEventAttr.EventBackgroundColor := clBtnFace;
|
FAllDayEventAttr.EventBackgroundColor := clBtnFace;
|
||||||
@ -1166,6 +1172,22 @@ end;
|
|||||||
|
|
||||||
{ Popup menu }
|
{ Popup menu }
|
||||||
|
|
||||||
|
function TVpWeekView.GetPopupMenu: TPopupMenu;
|
||||||
|
begin
|
||||||
|
if FExternalPopup = nil then
|
||||||
|
Result := FDefaultPopup
|
||||||
|
else
|
||||||
|
Result := FExternalPopup;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TVpWeekView.SetPopupMenu(AValue: TPopupMenu);
|
||||||
|
begin
|
||||||
|
if (AValue = nil) or (AValue = FDefaultPopup) then
|
||||||
|
FExternalPopup := nil
|
||||||
|
else
|
||||||
|
FExternalPopup := AValue;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TVpWeekView.InitializeDefaultPopup;
|
procedure TVpWeekView.InitializeDefaultPopup;
|
||||||
var
|
var
|
||||||
NewItem: TVpMenuItem;
|
NewItem: TVpMenuItem;
|
||||||
@ -1854,6 +1876,12 @@ begin
|
|||||||
end;
|
end;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
|
procedure TVpWeekView.Notification(AComponent: TComponent; Operation: TOperation);
|
||||||
|
begin
|
||||||
|
inherited;
|
||||||
|
if (Operation = opRemove) and (AComponent = FExternalPopup) then
|
||||||
|
FExternalPopup := nil;
|
||||||
|
end;
|
||||||
|
|
||||||
{ TVpWvHeadAttributes }
|
{ TVpWvHeadAttributes }
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user