From 0ca1fb03e625fff2927d2537d6866da1d9b60a49 Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Fri, 17 Jun 2016 22:41:57 +0000 Subject: [PATCH] tvplanit: Fix context menu of weekview git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4766 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/tvplanit/source/vpweekview.pas | 34 ++++++++++------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/components/tvplanit/source/vpweekview.pas b/components/tvplanit/source/vpweekview.pas index 01b10d345..ea83767b0 100644 --- a/components/tvplanit/source/vpweekview.pas +++ b/components/tvplanit/source/vpweekview.pas @@ -1457,28 +1457,24 @@ procedure TVpWeekView.WMRButtonDown(var Msg : TWMRButtonDown); procedure TVpWeekView.WMRButtonDown(var Msg : TLMRButtonDown); {$ENDIF} var - ClientOrigin : TPoint; - i : Integer; - + i: Integer; begin inherited; - if not Assigned (PopupMenu) then begin -// if not focused then -// SetFocus; - { The mouse click landed inside the client area } - wvSetDateByCoord(Point(Msg.XPos, Msg.YPos)); - EventAtCoord (Point (Msg.XPos, Msg.YPos)); - wvClickTimer.Enabled := false; - ClientOrigin := GetClientOrigin; + if not Assigned(PopupMenu) then + exit; - if not Assigned (ActiveEvent) 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; + { The mouse click landed inside the client area } + wvSetDateByCoord(Point(Msg.XPos, Msg.YPos)); + EventAtCoord(Point(Msg.XPos, Msg.YPos)); + wvClickTimer.Enabled := false; + + if not Assigned(ActiveEvent) then begin + for i := 0 to FDefaultPopup.Items.Count - 1 do + if (FDefaultPopup.Items[i].Tag = 1) or (ReadOnly) then + FDefaultPopup.Items[i].Enabled := False; + end else begin + for i := 0 to FDefaultPopup.Items.Count - 1 do + FDefaultPopup.Items[i].Enabled := True; end; end; {=====}