Commit 5249b1a6 authored by Maciej Suminski's avatar Maciej Suminski
Browse files

Renamed TOOL_MOUSE_BUTTONS constants to avoid name conflict with Windows MB_RIGHT constant.

parent 853b32df
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -89,9 +89,9 @@ struct TOOL_DISPATCHER::BUTTON_STATE
TOOL_DISPATCHER::TOOL_DISPATCHER( TOOL_MANAGER* aToolMgr, PCB_BASE_FRAME* aEditFrame ) :
TOOL_DISPATCHER::TOOL_DISPATCHER( TOOL_MANAGER* aToolMgr, PCB_BASE_FRAME* aEditFrame ) :
    m_toolMgr( aToolMgr ), m_editFrame( aEditFrame )
    m_toolMgr( aToolMgr ), m_editFrame( aEditFrame )
{
{
    m_buttons.push_back( new BUTTON_STATE( MB_LEFT, wxEVT_LEFT_DOWN, wxEVT_LEFT_UP ) );
    m_buttons.push_back( new BUTTON_STATE( BUT_LEFT, wxEVT_LEFT_DOWN, wxEVT_LEFT_UP ) );
    m_buttons.push_back( new BUTTON_STATE( MB_RIGHT, wxEVT_RIGHT_DOWN, wxEVT_RIGHT_UP ) );
    m_buttons.push_back( new BUTTON_STATE( BUT_RIGHT, wxEVT_RIGHT_DOWN, wxEVT_RIGHT_UP ) );
    m_buttons.push_back( new BUTTON_STATE( MB_MIDDLE, wxEVT_MIDDLE_DOWN, wxEVT_MIDDLE_UP ) );
    m_buttons.push_back( new BUTTON_STATE( BUT_MIDDLE, wxEVT_MIDDLE_DOWN, wxEVT_MIDDLE_UP ) );


    ResetState();
    ResetState();
}
}
+4 −4
Original line number Original line Diff line number Diff line
@@ -98,10 +98,10 @@ const std::string TOOL_EVENT::Format() const


    const FlagString buttons[] =
    const FlagString buttons[] =
    {
    {
        { MB_NONE,   "none"   },
        { BUT_NONE,   "none"   },
        { MB_LEFT,   "left"   },
        { BUT_LEFT,   "left"   },
        { MB_RIGHT,  "right"  },
        { BUT_RIGHT,  "right"  },
        { MB_MIDDLE, "middle" },
        { BUT_MIDDLE, "middle" },
        { 0,         ""       }
        { 0,         ""       }
    };
    };


+1 −1
Original line number Original line Diff line number Diff line
@@ -433,7 +433,7 @@ bool TOOL_MANAGER::ProcessEvent( TOOL_EVENT& aEvent )
        // or immediately (CMENU_NOW) mode. The latter is used for clarification lists.
        // or immediately (CMENU_NOW) mode. The latter is used for clarification lists.
        if( st->contextMenuTrigger != CMENU_OFF )
        if( st->contextMenuTrigger != CMENU_OFF )
        {
        {
            if( st->contextMenuTrigger == CMENU_BUTTON && !aEvent.IsClick( MB_RIGHT ) )
            if( st->contextMenuTrigger == CMENU_BUTTON && !aEvent.IsClick( BUT_RIGHT ) )
                break;
                break;


            st->pendingWait = true;
            st->pendingWait = true;
+10 −10
Original line number Original line Diff line number Diff line
@@ -93,12 +93,12 @@ enum TOOL_ACTIONS


enum TOOL_MOUSE_BUTTONS
enum TOOL_MOUSE_BUTTONS
{
{
    MB_NONE         = 0x0,
    BUT_NONE         = 0x0,
    MB_LEFT         = 0x1,
    BUT_LEFT         = 0x1,
    MB_RIGHT        = 0x2,
    BUT_RIGHT        = 0x2,
    MB_MIDDLE       = 0x4,
    BUT_MIDDLE       = 0x4,
    MB_BUTTON_MASK  = MB_LEFT | MB_RIGHT | MB_MIDDLE,
    BUT_BUTTON_MASK  = BUT_LEFT | BUT_RIGHT | BUT_MIDDLE,
    MB_ANY          = 0xffffffff
    BUT_ANY          = 0xffffffff
};
};


enum TOOL_MODIFIERS
enum TOOL_MODIFIERS
@@ -158,7 +158,7 @@ public:
    {
    {
        if( aCategory == TC_MOUSE )
        if( aCategory == TC_MOUSE )
        {
        {
            m_mouseButtons = aExtraParam & MB_BUTTON_MASK;
            m_mouseButtons = aExtraParam & BUT_BUTTON_MASK;
        }
        }
        else if( aCategory == TC_KEYBOARD )
        else if( aCategory == TC_KEYBOARD )
        {
        {
@@ -227,18 +227,18 @@ public:
        return m_mouseButtons;
        return m_mouseButtons;
    }
    }


    bool IsClick( int aButtonMask = MB_ANY ) const
    bool IsClick( int aButtonMask = BUT_ANY ) const
    {
    {
        return ( m_actions == TA_MOUSE_CLICK )
        return ( m_actions == TA_MOUSE_CLICK )
               && ( ( m_mouseButtons & aButtonMask ) == aButtonMask );
               && ( ( m_mouseButtons & aButtonMask ) == aButtonMask );
    }
    }


    bool IsDrag( int aButtonMask = MB_ANY ) const
    bool IsDrag( int aButtonMask = BUT_ANY ) const
    {
    {
        return ( m_actions == TA_MOUSE_DRAG ) && ( ( m_mouseButtons & aButtonMask ) == aButtonMask );
        return ( m_actions == TA_MOUSE_DRAG ) && ( ( m_mouseButtons & aButtonMask ) == aButtonMask );
    }
    }


    bool IsMouseUp( int aButtonMask = MB_ANY ) const
    bool IsMouseUp( int aButtonMask = BUT_ANY ) const
    {
    {
        return ( m_actions == TA_MOUSE_UP ) && ( ( m_mouseButtons & aButtonMask ) == aButtonMask );
        return ( m_actions == TA_MOUSE_UP ) && ( ( m_mouseButtons & aButtonMask ) == aButtonMask );
    }
    }
+4 −4
Original line number Original line Diff line number Diff line
@@ -111,10 +111,10 @@ protected:
    const TOOL_EVENT evCommand( int aCommandId = -1 );
    const TOOL_EVENT evCommand( int aCommandId = -1 );
    const TOOL_EVENT evCommand( std::string aCommandStr = "" );
    const TOOL_EVENT evCommand( std::string aCommandStr = "" );
    const TOOL_EVENT evMotion();
    const TOOL_EVENT evMotion();
    const TOOL_EVENT evClick( int aButton = MB_ANY );
    const TOOL_EVENT evClick( int aButton = BUT_ANY );
    const TOOL_EVENT evDrag( int aButton = MB_ANY );
    const TOOL_EVENT evDrag( int aButton = BUT_ANY );
    const TOOL_EVENT evButtonUp( int aButton = MB_ANY );
    const TOOL_EVENT evButtonUp( int aButton = BUT_ANY );
    const TOOL_EVENT evButtonDown(int aButton = MB_ANY );
    const TOOL_EVENT evButtonDown(int aButton = BUT_ANY );


private:
private:
    void goInternal( TOOL_STATE_FUNC& aState, const TOOL_EVENT_LIST& aConditions );
    void goInternal( TOOL_STATE_FUNC& aState, const TOOL_EVENT_LIST& aConditions );
Loading