Remove Context Menu in Empty Space of Hierarchy Navigator
Previously, a single RMB-click at empty space had no effect, while a double-click opened the context menu. As per the @sethhillbrand suggestion, instead of fixing this, no context menus should appear in empty space, as it is not necessary. To address this, the wxEVT_RIGHT_UP event binding has been removed by unbinding it from both the constructor and destructor. Additionally, the onRightClick(wxMouseEvent& aEvent) method has been removed, as it is linked to wxEVT_RIGHT_UP and is no longer necessary. Fixes #17962
This commit is contained in:
@@ -108,7 +108,6 @@ HIERARCHY_PANE::HIERARCHY_PANE( SCH_EDIT_FRAME* aParent ) :
|
||||
Bind( wxEVT_TREE_ITEM_RIGHT_CLICK, &HIERARCHY_PANE::onTreeItemRightClick, this );
|
||||
Bind( wxEVT_CHAR_HOOK, &HIERARCHY_PANE::onCharHook, this );
|
||||
m_tree->Bind( wxEVT_TREE_END_LABEL_EDIT, &HIERARCHY_PANE::onTreeEditFinished, this );
|
||||
m_tree->Bind( wxEVT_RIGHT_UP, &HIERARCHY_PANE::onRightClick, this );
|
||||
m_events_bound = true;
|
||||
}
|
||||
|
||||
@@ -120,7 +119,6 @@ HIERARCHY_PANE::~HIERARCHY_PANE()
|
||||
Unbind( wxEVT_TREE_ITEM_RIGHT_CLICK, &HIERARCHY_PANE::onTreeItemRightClick, this );
|
||||
Unbind( wxEVT_CHAR_HOOK, &HIERARCHY_PANE::onCharHook, this );
|
||||
m_tree->Unbind( wxEVT_TREE_END_LABEL_EDIT, &HIERARCHY_PANE::onTreeEditFinished, this );
|
||||
m_tree->Unbind( wxEVT_RIGHT_UP, &HIERARCHY_PANE::onRightClick, this );
|
||||
}
|
||||
|
||||
|
||||
@@ -373,12 +371,6 @@ void HIERARCHY_PANE::onTreeItemRightClick( wxTreeEvent& aEvent )
|
||||
}
|
||||
|
||||
|
||||
void HIERARCHY_PANE::onRightClick( wxMouseEvent& aEvent )
|
||||
{
|
||||
onRightClick( wxTreeItemId() );
|
||||
}
|
||||
|
||||
|
||||
void HIERARCHY_PANE::onRightClick( wxTreeItemId aItem )
|
||||
{
|
||||
wxMenu ctxMenu;
|
||||
|
||||
@@ -116,7 +116,6 @@ private:
|
||||
void onSelectSheetPath( wxTreeEvent& aEvent );
|
||||
|
||||
void onTreeItemRightClick( wxTreeEvent& aEvent );
|
||||
void onRightClick( wxMouseEvent& aEvent );
|
||||
void onRightClick( wxTreeItemId aItem );
|
||||
void onCharHook( wxKeyEvent& aKeyStroke );
|
||||
void onTreeRightClick( wxTreeEvent& event );
|
||||
|
||||
Reference in New Issue
Block a user