Commit 282995ea authored by Maciej Suminski's avatar Maciej Suminski

Fixed disambiguation menu issue.

parent 402f3c6f
......@@ -37,7 +37,7 @@ public:
CMEventHandler( CONTEXT_MENU* aMenu ):
m_menu(aMenu) {};
void onEvent( wxEvent & aEvent )
void onEvent( wxEvent& aEvent )
{
TOOL_EVENT evt;
wxEventType type = aEvent.GetEventType();
......
......@@ -61,7 +61,7 @@ void TOOL_INTERACTIVE::Reset()
}
void TOOL_INTERACTIVE::SetContextMenu( CONTEXT_MENU *aMenu, TOOL_ContextMenuTrigger aTrigger )
void TOOL_INTERACTIVE::SetContextMenu( CONTEXT_MENU* aMenu, TOOL_ContextMenuTrigger aTrigger )
{
aMenu->setTool( this );
m_toolMgr->ScheduleContextMenu( this, aMenu, aTrigger );
......
......@@ -68,7 +68,7 @@ TOOL_MANAGER::TOOL_MANAGER()
{
}
void TOOL_MANAGER::RegisterTool ( TOOL_BASE *aTool )
void TOOL_MANAGER::RegisterTool( TOOL_BASE* aTool )
{
ToolState* st = new ToolState;
......
......@@ -40,7 +40,6 @@ class CONTEXT_MENU
{
public:
CONTEXT_MENU();
~CONTEXT_MENU();
......
......@@ -156,7 +156,7 @@ class TOOL_MANAGER
TOOL_ContextMenuTrigger aTrigger );
private:
void dispatchInternal ( TOOL_EVENT& aEvent );
void dispatchInternal( TOOL_EVENT& aEvent );
struct ToolState;
typedef std::pair<TOOL_EVENT_LIST, TOOL_STATE_FUNC> Transition;
......
......@@ -216,11 +216,11 @@ void SELECTION_TOOL::selectMultiple()
BOARD_ITEM* SELECTION_TOOL::disambiguationMenu( GENERAL_COLLECTOR *aCollector )
{
CONTEXT_MENU cmenu;
OPT_TOOL_EVENT evt;
BOARD_ITEM *current = NULL;
cmenu.SetTitle( _( "Clarify selection" ) );
m_menu.reset( new CONTEXT_MENU() );
m_menu->SetTitle( _( "Clarify selection" ) );
int limit = std::min( 10, aCollector->GetCount() );
......@@ -229,10 +229,10 @@ BOARD_ITEM* SELECTION_TOOL::disambiguationMenu( GENERAL_COLLECTOR *aCollector )
wxString text;
BOARD_ITEM *item = ( *aCollector )[i];
text = item->GetSelectMenuText();
cmenu.Add( text, i );
m_menu->Add( text, i );
}
SetContextMenu( &cmenu, CMENU_NOW );
SetContextMenu( m_menu.get(), CMENU_NOW );
while( evt = Wait() )
{
......
......@@ -26,6 +26,7 @@
#define __SELECTION_TOOL_H
#include <set>
#include <boost/shared_ptr.hpp>
#include <math/vector2d.h>
#include <tool/tool_interactive.h>
......@@ -66,6 +67,7 @@ private:
std::set<BOARD_ITEM*> m_selectedItems;
SELECTION_AREA* m_selArea;
boost::shared_ptr<CONTEXT_MENU> m_menu;
};
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment