Fix position of popup menus in wxGenericListCtrl
The position was off by the header height due to a missing translation between wxGenericListCtrl and wxListMainWindow, in which the menu is actually shown, coordinates. Closes #18133.
This commit is contained in:
@@ -5467,6 +5467,12 @@ wxColour wxGenericListCtrl::GetForegroundColour() const
|
|||||||
bool wxGenericListCtrl::DoPopupMenu( wxMenu *menu, int x, int y )
|
bool wxGenericListCtrl::DoPopupMenu( wxMenu *menu, int x, int y )
|
||||||
{
|
{
|
||||||
#if wxUSE_MENUS
|
#if wxUSE_MENUS
|
||||||
|
// Coordinates here are given in this control coordinates system, but
|
||||||
|
// PopupMenu() wants them in the coordinates system of the window it's
|
||||||
|
// called on, so transform them.
|
||||||
|
ClientToScreen(&x, &y);
|
||||||
|
m_mainWin->ScreenToClient(&x, &y);
|
||||||
|
|
||||||
return m_mainWin->PopupMenu( menu, x, y );
|
return m_mainWin->PopupMenu( menu, x, y );
|
||||||
#else
|
#else
|
||||||
return false;
|
return false;
|
||||||
|
Reference in New Issue
Block a user