Commit 155a9dbe authored by jean-pierre charras's avatar jean-pierre charras
Browse files

All: fix a minor bur annoying issue: incorrect cursor shape after a block...

All: fix a minor bur annoying issue: incorrect cursor shape after a block command (mainly when a tool is selected)
parent dc24d6fc
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -305,5 +305,5 @@ void AbortBlockCurrentCommand( EDA_DRAW_PANEL* Panel, wxDC* DC )

    screen->m_BlockLocate.m_Command = BLOCK_IDLE;
    Panel->GetParent()->DisplayToolMsg( wxEmptyString );
    Panel->SetCursor( Panel->GetDefaultCursor() );
    Panel->SetCursor( Panel->GetCurrentCursor() );
}
+1 −1
Original line number Diff line number Diff line
@@ -440,7 +440,7 @@ void EDA_DRAW_FRAME::SetToolID( int aId, int aCursor, const wxString& aToolMsg )

    // Change DrawPanel cursor if requested.
    if( DrawPanel && aCursor >= 0 )
        DrawPanel->SetCursor( aCursor );
        DrawPanel->SetCurrentCursor( aCursor );

    DisplayToolMsg( aToolMsg );

+12 −13
Original line number Diff line number Diff line
/*****************/
/* drawpanel.cpp */
/*****************/
/**
 * @file drawpanel.cpp
 */

#include "fctsys.h"
#include "appl_wxstruct.h"
@@ -84,10 +84,10 @@ EDA_DRAW_PANEL::EDA_DRAW_PANEL( EDA_DRAW_FRAME* parent, int id,
    m_Block_Enable       = false;

#ifdef __WXMAC__
    m_defaultCursor = m_cursor = wxCURSOR_CROSS;
    m_defaultCursor = m_currentCursor = wxCURSOR_CROSS;
    m_showCrossHair = false;
#else
    m_defaultCursor = m_cursor = wxCURSOR_ARROW;
    m_defaultCursor = m_currentCursor = wxCURSOR_ARROW;
    m_showCrossHair = true;
#endif

@@ -1017,7 +1017,7 @@ void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event )
                    else
                    {
                        m_AutoPAN_Request = true;
                        SetCursor( m_cursor = wxCURSOR_SIZING );
                        SetCursor( wxCURSOR_SIZING );
                    }
                }
            }
@@ -1045,14 +1045,13 @@ void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event )
                    m_AutoPAN_Request = false;
                }

                SetCursor( m_cursor = m_defaultCursor );
                SetCursor( m_currentCursor );
           }
            else if( screen->m_BlockLocate.m_State == STATE_BLOCK_END )
            {
                m_AutoPAN_Request = false;
                GetParent()->HandleBlockEnd( &DC );
                SetCursor( m_cursor = m_defaultCursor );

                SetCursor( m_currentCursor );
                if( screen->m_BlockLocate.m_State == STATE_BLOCK_MOVE )
                {
                    m_AutoPAN_Request = true;
@@ -1106,9 +1105,9 @@ void EDA_DRAW_PANEL::OnKeyEvent( wxKeyEvent& event )
        m_AbortRequest = true;

        if( IsMouseCaptured() )
            EndMouseCapture( -1, m_defaultCursor );
            EndMouseCapture( );
        else
            EndMouseCapture( ID_NO_TOOL_SELECTED, m_cursor, wxEmptyString );
            EndMouseCapture( ID_NO_TOOL_SELECTED, m_defaultCursor, wxEmptyString );

        break;
    }
+2 −2
Original line number Diff line number Diff line
@@ -183,7 +183,7 @@ void SCH_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
    }

    DrawPanel->SetMouseCapture( NULL, NULL );
    SetToolID( GetToolId(), DrawPanel->GetDefaultCursor(), wxEmptyString );
    SetToolID( GetToolId(), DrawPanel->GetCurrentCursor(), wxEmptyString );
    DrawPanel->Refresh();
}

@@ -317,7 +317,7 @@ bool SCH_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
        block->m_Command = BLOCK_IDLE;
        GetScreen()->SetCurItem( NULL );
        DrawPanel->SetMouseCapture( NULL, NULL );
        SetToolID( GetToolId(), DrawPanel->GetDefaultCursor(), wxEmptyString );
        SetToolID( GetToolId(), DrawPanel->GetCurrentCursor(), wxEmptyString );
    }

    if( zoom_command )
+4 −2
Original line number Diff line number Diff line
@@ -136,7 +136,8 @@ void WinEDA_GerberFrame::HandleBlockPlace( wxDC* DC )
        break;
    }

    DrawPanel->SetMouseCapture( NULL, NULL );
    DrawPanel->EndMouseCapture( );
    DrawPanel->SetCursor( DrawPanel->GetCurrentCursor() );
    GetScreen()->SetModify();
    GetScreen()->ClearBlockCommand();

@@ -211,7 +212,8 @@ bool WinEDA_GerberFrame::HandleBlockEnd( wxDC* DC )
    if( ! nextcmd )
    {
        GetScreen()->ClearBlockCommand();
        DrawPanel->SetMouseCapture( NULL, NULL );
        DrawPanel->EndMouseCapture( );
        DrawPanel->SetCursor( DrawPanel->GetCurrentCursor() );
        DisplayToolMsg( wxEmptyString );
    }

Loading