Try to fix

bug #1850003 "DB treeview context menu opens only on first monitor" and
bug #1846610 "Database View/List Popup Menu position issue"
Although I can't test the solution completely as I'm lacking a second monitor (like the reporter of the first bug), it seems correct that TPopupMenu.Popup() needs the clientorigin added to the mousepoint which is only a relative position to the underlying TWinControl.
@see TMDIChild.btnDataClick()
This commit is contained in:
Ansgar Becker
2007-12-16 22:29:46 +00:00
parent bb76a60abb
commit 2b4c477e3e

View File

@@ -1520,7 +1520,7 @@ procedure TMDIChild.DBtreeContextPopup(Sender: TObject; MousePos: TPoint;
begin
debug('context menu; storing right click item so it won''t get lost');
DBRightClickSelectedItem := DBtree.Selected;
popupTreeView.Popup(MousePos.X, MousePos.Y);
popupTreeView.Popup(DBtree.ClientOrigin.X + MousePos.X, DBtree.ClientOrigin.Y + MousePos.Y);
PostMessage(MainForm.Handle, WM_CLEAR_RIGHTCLICK_POINTER, 0, 0);
end;