tvplanit: Fix enabled state of day view popup menu.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4855 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2016-06-28 16:50:32 +00:00
parent 7c6fd7b8e4
commit a804344102
3 changed files with 15 additions and 14 deletions

View File

@ -300,4 +300,8 @@ object Form1: TForm1
left = 140
top = 200
end
object PopupMenu1: TPopupMenu
left = 129
top = 527
end
end

View File

@ -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.

View File

@ -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;