diff --git a/components/tvplanit/examples/inidatastore/unit1.lfm b/components/tvplanit/examples/inidatastore/unit1.lfm index a1d21b6f4..d7f9548e1 100644 --- a/components/tvplanit/examples/inidatastore/unit1.lfm +++ b/components/tvplanit/examples/inidatastore/unit1.lfm @@ -300,4 +300,8 @@ object Form1: TForm1 left = 140 top = 200 end + object PopupMenu1: TPopupMenu + left = 129 + top = 527 + end end diff --git a/components/tvplanit/examples/inidatastore/unit1.pas b/components/tvplanit/examples/inidatastore/unit1.pas index 9a3c074c4..5a31afd99 100644 --- a/components/tvplanit/examples/inidatastore/unit1.pas +++ b/components/tvplanit/examples/inidatastore/unit1.pas @@ -6,7 +6,7 @@ interface uses Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls, - StdCtrls, ComCtrls, VpBaseDS, VpDayView, VpWeekView, VpTaskList, + StdCtrls, ComCtrls, Menus, VpBaseDS, VpDayView, VpWeekView, VpTaskList, VpContactGrid, VpMonthView, VpResEditDlg, VpContactButtons, VpIniDs; type @@ -19,6 +19,7 @@ type PageControl1: TPageControl; Panel1: TPanel; Panel2: TPanel; + PopupMenu1: TPopupMenu; Splitter1: TSplitter; Splitter2: TSplitter; Splitter3: TSplitter; @@ -84,6 +85,5 @@ begin end; end; - end. diff --git a/components/tvplanit/source/vpdayview.pas b/components/tvplanit/source/vpdayview.pas index c80fdfb95..551b30766 100644 --- a/components/tvplanit/source/vpdayview.pas +++ b/components/tvplanit/source/vpdayview.pas @@ -1625,7 +1625,7 @@ begin OnClick(self); end else begin - if not focused then + if not Focused then SetFocus; if (x > dvRowHeadWidth - 9) and (y > dvColHeadHeight) then @@ -1638,17 +1638,14 @@ begin EditEventAtCoord(Point (x, y)); dvClickTimer.Enabled := false; - if not Assigned(PopupMenu) then - begin - if not Assigned(FActiveEvent) then - for i := 0 to FDefaultPopup.Items.Count - 1 do begin - if (FDefaultPopup.Items[i].Tag = 1) or (ReadOnly) then - FDefaultPopup.Items[i].Enabled := False; - end - else - for i := 0 to FDefaultPopup.Items.Count - 1 do - FDefaultPopup.Items[i].Enabled := True; - end; + if not Assigned(FActiveEvent) then + for i := 0 to FDefaultPopup.Items.Count - 1 do begin + if (FDefaultPopup.Items[i].Tag = 1) or (ReadOnly) then + FDefaultPopup.Items[i].Enabled := False; + end + else + for i := 0 to FDefaultPopup.Items.Count - 1 do + FDefaultPopup.Items[i].Enabled := True; end; end;