Commit 7b8b51b2 authored by Wayne Stambaugh's avatar Wayne Stambaugh
Browse files

Draw panel object refactoring and other minor code cleaning.

* Rename all member variables and methods that reference the cross hair
  code in draw panel object from cursor to cross hair to eliminate confusion
  between the two concepts.
* Rename cursor capture call backs in draw panel object to improve code
  readability.
* Create helper class for turning off the cross hair while drawing.
* Remove redundant block clear code.
* Remove redundant mouse capture call back reset code when end capture
  call back is called.
* Remove unused function definitions in base draw frame object.
* Lots of minor coding policy and doxygen comment fixes.
parent 25fe4920
Loading
Loading
Loading
Loading
+14 −6
Original line number Diff line number Diff line
@@ -47,15 +47,15 @@ void BASE_SCREEN::InitDatas()
{
    if( m_Center )
    {
        m_Curseur.x = m_Curseur.y = 0;
        m_crossHairPosition.x = m_crossHairPosition.y = 0;
        m_DrawOrg.x = -ReturnPageSize().x / 2;
        m_DrawOrg.y = -ReturnPageSize().y / 2;
    }
    else
    {
        m_DrawOrg.x = m_DrawOrg.y = 0;
        m_Curseur.x = ReturnPageSize().x / 2;
        m_Curseur.y = ReturnPageSize().y / 2;
        m_crossHairPosition.x = ReturnPageSize().x / 2;
        m_crossHairPosition.y = ReturnPageSize().y / 2;
    }

    m_O_Curseur.x = m_O_Curseur.y = 0;
@@ -417,15 +417,15 @@ wxPoint BASE_SCREEN::GetNearestGridPosition( const wxPoint& aPosition, wxRealPoi
wxPoint BASE_SCREEN::GetCursorPosition( bool aOnGrid, wxRealPoint* aGridSize )
{
    if( aOnGrid )
        return GetNearestGridPosition( m_Curseur, aGridSize );
        return GetNearestGridPosition( m_crossHairPosition, aGridSize );

    return m_Curseur;
    return m_crossHairPosition;
}


wxPoint BASE_SCREEN::GetCrossHairScreenPosition() const
{
    wxPoint pos = m_Curseur - m_DrawOrg;
    wxPoint pos = m_crossHairPosition - m_DrawOrg;
    double scalar = GetScalingFactor();

    pos.x = wxRound( (double) pos.x * scalar );
@@ -434,6 +434,14 @@ wxPoint BASE_SCREEN::GetCrossHairScreenPosition() const
    return pos;
}

void BASE_SCREEN::SetCrossHairPosition( const wxPoint& aPosition, bool aSnapToGrid )
{
    if( aSnapToGrid )
        m_crossHairPosition = GetNearestGridPosition( aPosition );
    else
        m_crossHairPosition = aPosition;
}


/* free the undo and the redo lists
 */
+12 −14
Original line number Diff line number Diff line
@@ -124,8 +124,7 @@ void BLOCK_SELECTOR::InitData( EDA_DRAW_PANEL* aPanel, const wxPoint& startpos )
    SetOrigin( startpos );
    SetSize( wxSize( 0, 0 ) );
    m_ItemsSelection.ClearItemsList();
    aPanel->ManageCurseur = DrawAndSizingBlockOutlines;
    aPanel->ForceCloseManageCurseur = AbortBlockCurrentCommand;
    aPanel->SetMouseCapture( DrawAndSizingBlockOutlines, AbortBlockCurrentCommand );
}


@@ -164,6 +163,7 @@ void BLOCK_SELECTOR::Clear()
{
    if( m_Command != BLOCK_IDLE )
    {
        m_Flags   = 0;
        m_Command = BLOCK_IDLE;
        m_State   = STATE_NO_BLOCK;
        ClearItemsList();
@@ -216,20 +216,20 @@ bool EDA_DRAW_FRAME::HandleBlockBegin( wxDC* DC, int key, const wxPoint& startpo
        {
            DisplayError( this, wxT( "No Block to paste" ), 20 );
            GetScreen()->m_BlockLocate.m_Command = BLOCK_IDLE;
            DrawPanel->ManageCurseur = NULL;
            DrawPanel->m_mouseCaptureCallback = NULL;
            return true;
        }

        if( DrawPanel->ManageCurseur == NULL )
        if( !DrawPanel->IsMouseCaptured() )
        {
            Block->m_ItemsSelection.ClearItemsList();
            DisplayError( this,
                          wxT( "EDA_DRAW_FRAME::HandleBlockBegin() Err: ManageCurseur NULL" ) );
                          wxT( "EDA_DRAW_FRAME::HandleBlockBegin() Err: m_mouseCaptureCallback NULL" ) );
            return true;
        }

        Block->m_State = STATE_BLOCK_MOVE;
        DrawPanel->ManageCurseur( DrawPanel, DC, startpos, false );
        DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, startpos, false );
        break;

    default:
@@ -265,8 +265,8 @@ void DrawAndSizingBlockOutlines( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoin
    if( aErase )
        PtBlock->Draw( aPanel, aDC, wxPoint( 0, 0 ), g_XorMode, PtBlock->m_Color );

    PtBlock->m_BlockLastCursorPosition = aPanel->GetScreen()->m_Curseur;
    PtBlock->SetEnd( aPanel->GetScreen()->m_Curseur );
    PtBlock->m_BlockLastCursorPosition = aPanel->GetScreen()->GetCrossHairPosition();
    PtBlock->SetEnd( aPanel->GetScreen()->GetCrossHairPosition() );

    PtBlock->Draw( aPanel, aDC, wxPoint( 0, 0 ), g_XorMode, PtBlock->m_Color );

@@ -286,12 +286,11 @@ void AbortBlockCurrentCommand( EDA_DRAW_PANEL* Panel, wxDC* DC )
{
    BASE_SCREEN* screen = Panel->GetScreen();

    if( Panel->ManageCurseur )                     /* Erase current drawing
                                                    * on screen */
    if( Panel->IsMouseCaptured() )      /* Erase current drawing on screen */
    {
        Panel->ManageCurseur( Panel, DC, wxDefaultPosition, false );  /* Clear block outline. */
        Panel->ManageCurseur = NULL;
        Panel->ForceCloseManageCurseur = NULL;
        /* Clear block outline. */
        Panel->m_mouseCaptureCallback( Panel, DC, wxDefaultPosition, false );
        Panel->SetMouseCapture( NULL, NULL );
        screen->SetCurItem( NULL );

        /* Delete the picked wrapper if this is a picked list. */
@@ -301,7 +300,6 @@ void AbortBlockCurrentCommand( EDA_DRAW_PANEL* Panel, wxDC* DC )

    screen->m_BlockLocate.m_Flags = 0;
    screen->m_BlockLocate.m_State = STATE_NO_BLOCK;

    screen->m_BlockLocate.m_Command = BLOCK_ABORT;
    Panel->GetParent()->HandleBlockEnd( DC );

+1 −1
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@ void EDA_DRAW_FRAME::CopyToClipboard( wxCommandEvent& event )
        if( GetScreen()->IsBlockActive() )
            DrawPanel->SetCursor( wxCursor( DrawPanel->GetDefaultCursor() ) );

        DrawPanel->UnManageCursor();
        DrawPanel->EndMouseCapture();
    }
}

+16 −24
Original line number Diff line number Diff line
@@ -127,15 +127,6 @@ EDA_DRAW_FRAME::~EDA_DRAW_FRAME()
}


/*
 *  Display the message in the first pane of the status bar.
 */
void EDA_DRAW_FRAME::Affiche_Message( const wxString& message )
{
    SetStatusText( message, 0 );
}


void EDA_DRAW_FRAME::EraseMsgBox()
{
    if( MsgPanel )
@@ -193,8 +184,7 @@ void EDA_DRAW_FRAME::ToolOnRightClick( wxCommandEvent& event )
 * because EDA_DRAW_FRAME does not know how to print a page
 * This is the reason it is a virtual function
 */
void EDA_DRAW_FRAME::PrintPage( wxDC* aDC,int aPrintMask,
                                  bool aPrintMirrorMode, void* aData )
void EDA_DRAW_FRAME::PrintPage( wxDC* aDC,int aPrintMask, bool aPrintMirrorMode, void* aData )
{
    wxMessageBox( wxT("EDA_DRAW_FRAME::PrintPage() error") );
}
@@ -256,7 +246,7 @@ void EDA_DRAW_FRAME::OnSelectGrid( wxCommandEvent& event )
     * index returned by GetSelection().
     */
    m_LastGridSizeId = id - ID_POPUP_GRID_LEVEL_1000;
    screen->m_Curseur = DrawPanel->GetScreenCenterLogicalPosition();
    screen->SetCrossHairPosition( DrawPanel->GetScreenCenterLogicalPosition() );
    screen->SetGrid( id );
    Refresh();
}
@@ -292,9 +282,8 @@ void EDA_DRAW_FRAME::OnSelectZoom( wxCommandEvent& event )
        if( GetScreen()->GetZoom() == selectedZoom )
            return;

        GetScreen()->m_Curseur = DrawPanel->GetScreenCenterLogicalPosition();
        GetScreen()->SetZoom( selectedZoom );
        RedrawScreen( false );
        RedrawScreen( GetScreen()->GetScrollCenterPosition(), false );
    }
}

@@ -469,7 +458,7 @@ int EDA_DRAW_FRAME::ReturnBlockCommand( int key )
void EDA_DRAW_FRAME::InitBlockPasteInfos()
{
    GetScreen()->m_BlockLocate.ClearItemsList();
    DrawPanel->ManageCurseur = NULL;
    DrawPanel->m_mouseCaptureCallback = NULL;
}


@@ -484,7 +473,7 @@ bool EDA_DRAW_FRAME::HandleBlockEnd( wxDC* DC )
}


void EDA_DRAW_FRAME::AdjustScrollBars()
void EDA_DRAW_FRAME::AdjustScrollBars( const wxPoint& aCenterPosition )
{
    int     unitsX, unitsY, posX, posY;
    wxSize  drawingSize, clientSize;
@@ -537,8 +526,9 @@ void EDA_DRAW_FRAME::AdjustScrollBars()
    unitsY = wxRound( (double) drawingSize.y * scalar );

    // Calculate the position, place the cursor at the center of screen.
    posX = screen->m_Curseur.x - screen->m_DrawOrg.x;
    posY = screen->m_Curseur.y - screen->m_DrawOrg.y;
    screen->SetScrollCenterPosition( aCenterPosition );
    posX = aCenterPosition.x - screen->m_DrawOrg.x;
    posY = aCenterPosition.y - screen->m_DrawOrg.y;

    posX -= wxRound( (double) clientSize.x / 2.0 );
    posY -= wxRound( (double) clientSize.y / 2.0 );
@@ -612,6 +602,7 @@ double RoundTo0( double x, double precision )
    return (double) ix / precision;
}


/**
 * Function UpdateStatusBar
 * Displays in the bottom of the main window a stust:
@@ -639,8 +630,8 @@ void EDA_DRAW_FRAME::UpdateStatusBar()
    SetStatusText( Line, 1 );

    /* Display absolute coordinates:  */
    double dXpos = To_User_Unit( g_UserUnit, screen->m_Curseur.x, m_InternalUnits );
    double dYpos = To_User_Unit( g_UserUnit, screen->m_Curseur.y, m_InternalUnits );
    double dXpos = To_User_Unit( g_UserUnit, screen->GetCrossHairPosition().x, m_InternalUnits );
    double dYpos = To_User_Unit( g_UserUnit, screen->GetCrossHairPosition().y, m_InternalUnits );

    /*
     * Converting from inches to mm can give some coordinates due to
@@ -694,8 +685,8 @@ void EDA_DRAW_FRAME::UpdateStatusBar()
    SetStatusText( Line, 2 );

    /* Display relative coordinates:  */
    dx = screen->m_Curseur.x - screen->m_O_Curseur.x;
    dy = screen->m_Curseur.y - screen->m_O_Curseur.y;
    dx = screen->GetCrossHairPosition().x - screen->m_O_Curseur.x;
    dy = screen->GetCrossHairPosition().y - screen->m_O_Curseur.y;
    dXpos = To_User_Unit( g_UserUnit, dx, m_InternalUnits );
    dYpos = To_User_Unit( g_UserUnit, dy, m_InternalUnits );

@@ -710,6 +701,7 @@ void EDA_DRAW_FRAME::UpdateStatusBar()
    SetStatusText( Line, 3 );
}


/**
 * Load draw frame specific configuration settings.
 *
+46 −50
Original line number Diff line number Diff line
@@ -32,14 +32,6 @@
#define KICAD_TRACE_COORDS wxT( "kicad_dump_coords" )


/* Used to inhibit a response to a mouse left button release, after a
 * double click (when releasing the left button at the end of the second
 * click.  Used in eeschema to inhibit a mouse left release command when
 * switching between hierarchical sheets on a double click.
 */
static bool s_IgnoreNextLeftButtonRelease = false;


// Events used by EDA_DRAW_PANEL
BEGIN_EVENT_TABLE( EDA_DRAW_PANEL, wxScrolledWindow )
    EVT_LEAVE_WINDOW( EDA_DRAW_PANEL::OnMouseLeaving )
@@ -82,8 +74,8 @@ EDA_DRAW_PANEL::EDA_DRAW_PANEL( EDA_DRAW_FRAME* parent, int id,
    m_AutoPAN_Enable    = true;
    m_IgnoreMouseEvents = 0;

    ManageCurseur = NULL;
    ForceCloseManageCurseur = NULL;
    m_mouseCaptureCallback = NULL;
    m_endMouseCaptureCallback = NULL;

    if( wxGetApp().m_EDA_Config )
        wxGetApp().m_EDA_Config->Read( wxT( "AutoPAN" ), &m_AutoPAN_Enable, true );
@@ -124,12 +116,12 @@ BASE_SCREEN* EDA_DRAW_PANEL::GetScreen()
}


void EDA_DRAW_PANEL::DrawCursor( wxDC* aDC, int aColor )
void EDA_DRAW_PANEL::DrawCrossHair( wxDC* aDC, int aColor )
{
    if( m_cursorLevel != 0 || aDC == NULL || !m_showCrossHair )
        return;

    wxPoint Cursor = GetScreen()->m_Curseur;
    wxPoint Cursor = GetScreen()->GetCrossHairPosition();

    GRSetDrawMode( aDC, GR_XOR );

@@ -155,17 +147,17 @@ void EDA_DRAW_PANEL::DrawCursor( wxDC* aDC, int aColor )
}


void EDA_DRAW_PANEL::CursorOff( wxDC* DC )
void EDA_DRAW_PANEL::CrossHairOff( wxDC* DC )
{
    DrawCursor( DC );
    DrawCrossHair( DC );
    --m_cursorLevel;
}


void EDA_DRAW_PANEL::CursorOn( wxDC* DC )
void EDA_DRAW_PANEL::CrossHairOn( wxDC* DC )
{
    ++m_cursorLevel;
    DrawCursor( DC );
    DrawCrossHair( DC );

    if( m_cursorLevel > 0 )  // Shouldn't happen, but just in case ..
        m_cursorLevel = 0;
@@ -237,9 +229,9 @@ wxPoint EDA_DRAW_PANEL::GetScreenCenterLogicalPosition()
}


void EDA_DRAW_PANEL::MouseToCursorSchema()
void EDA_DRAW_PANEL::MoveCursorToCrossHair()
{
    MoveCursor( GetScreen()->m_Curseur );
    MoveCursor( GetScreen()->GetCrossHairPosition() );
}


@@ -260,7 +252,8 @@ void EDA_DRAW_PANEL::MoveCursor( const wxPoint& aPosition )
        GetScrollPixelsPerUnit( &xPpu, &yPpu );
        CalcUnscrolledPosition( screenPos.x, screenPos.y, &drawingPos.x, &drawingPos.y );

        wxLogDebug( wxT( "MoveCursor() initial screen position(%d, %d) " ) \
        wxLogTrace( KICAD_TRACE_COORDS,
                    wxT( "MoveCursor() initial screen position(%d, %d) " ) \
                    wxT( "rectangle(%d, %d, %d, %d) view(%d, %d)" ),
                    screenPos.x, screenPos.y, clientRect.x, clientRect.y,
                    clientRect.width, clientRect.height, x, y );
@@ -277,7 +270,8 @@ void EDA_DRAW_PANEL::MoveCursor( const wxPoint& aPosition )
        Scroll( x, y );
        CalcScrolledPosition( drawingPos.x, drawingPos.y, &screenPos.x, &screenPos.y );

        wxLogDebug( wxT( "MoveCursor() scrolled screen position(%d, %d) view(%d, %d)" ),
        wxLogTrace( KICAD_TRACE_COORDS,
                    wxT( "MoveCursor() scrolled screen position(%d, %d) view(%d, %d)" ),
                    screenPos.x, screenPos.y, x, y );
    }

@@ -567,7 +561,7 @@ void EDA_DRAW_PANEL::DrawGrid( wxDC* aDC )
    if( screenGridSize.x < MIN_GRID_SIZE || screenGridSize.y < MIN_GRID_SIZE )
        return;

    GetParent()->PutOnGrid( &org, &gridSize );
    org = screen->GetNearestGridPosition( org, &gridSize );

    // Setting the nearest grid position can select grid points outside the clip box.
    // Incrementing the start point by one grid step should prevent drawing grid points
@@ -730,7 +724,7 @@ bool EDA_DRAW_PANEL::OnRightClick( wxMouseEvent& event )
    pos = event.GetPosition();
    m_IgnoreMouseEvents = true;
    PopupMenu( &MasterMenu, pos );
    MouseToCursorSchema();
    MoveCursorToCrossHair();
    m_IgnoreMouseEvents = false;

    return true;
@@ -739,7 +733,7 @@ bool EDA_DRAW_PANEL::OnRightClick( wxMouseEvent& event )

void EDA_DRAW_PANEL::OnMouseLeaving( wxMouseEvent& event )
{
    if( ManageCurseur == NULL )          // No command in progress.
    if( m_mouseCaptureCallback == NULL )          // No command in progress.
        m_AutoPAN_Request = false;

    if( !m_AutoPAN_Enable || !m_AutoPAN_Request || m_IgnoreMouseEvents )
@@ -778,7 +772,7 @@ void EDA_DRAW_PANEL::OnMouseWheel( wxMouseEvent& event )
    }

    INSTALL_UNBUFFERED_DC( dc, this );
    GetScreen()->m_Curseur = event.GetLogicalPosition( dc );
    GetScreen()->SetCrossHairPosition( event.GetLogicalPosition( dc ) );

    wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED );
    cmd.SetEventObject( this );
@@ -810,9 +804,16 @@ void EDA_DRAW_PANEL::OnMouseWheel( wxMouseEvent& event )

void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event )
{
    /* Used to inhibit a response to a mouse left button release, after a double click
     * (when releasing the left button at the end of the second click.  Used in eeschema
     * to inhibit a mouse left release command when switching between hierarchical sheets
     * on a double click.
     */
    static bool ignoreNextLeftButtonRelease = false;
    static EDA_DRAW_PANEL* LastPanel = NULL;

    int                    localrealbutt = 0, localbutt = 0, localkey = 0;
    BASE_SCREEN*           screen = GetScreen();
    static EDA_DRAW_PANEL* LastPanel;

    if( !screen )
        return;
@@ -835,7 +836,7 @@ void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event )
        m_CanStartBlock = -1;
    }

    if( ManageCurseur == NULL )  // No command in progress
    if( !IsMouseCaptured() )          // No mouse capture in progress.
        m_AutoPAN_Request = false;

    if( GetParent()->m_FrameIsActive )
@@ -906,16 +907,16 @@ void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event )
        // inhibit a response to the mouse left button release,
        // because we have a double click, and we do not want a new
        // OnLeftClick command at end of this Double Click
        s_IgnoreNextLeftButtonRelease = true;
        ignoreNextLeftButtonRelease = true;
    }
    else if( event.LeftUp() )
    {
        // A block command is in progress: a left up is the end of block
        // or this is the end of a double click, already seen
        if( screen->m_BlockLocate.m_State==STATE_NO_BLOCK && !s_IgnoreNextLeftButtonRelease )
        if( screen->m_BlockLocate.m_State == STATE_NO_BLOCK && !ignoreNextLeftButtonRelease )
            GetParent()->OnLeftClick( &DC, screen->m_MousePosition );

        s_IgnoreNextLeftButtonRelease = false;
        ignoreNextLeftButtonRelease = false;
    }

    if( !event.LeftIsDown() )
@@ -925,7 +926,7 @@ void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event )
         * double click opens a dialog box, and the release mouse button
         * is made when the dialog box is open.
         */
        s_IgnoreNextLeftButtonRelease = false;
        ignoreNextLeftButtonRelease = false;
    }

    if( event.ButtonUp( wxMOUSE_BTN_MIDDLE ) && (screen->m_BlockLocate.m_State == STATE_NO_BLOCK) )
@@ -969,7 +970,7 @@ void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event )
         * (a filter creates a delay for the real block command start, and
         * we must remember this point)
         */
        m_CursorStartPos = screen->m_Curseur;
        m_CursorStartPos = screen->GetCrossHairPosition();
    }

    if( m_Block_Enable && !(localbutt & GR_M_DCLICK) )
@@ -985,13 +986,12 @@ void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event )
            {
                m_AutoPAN_Request = false;
                GetParent()->HandleBlockPlace( &DC );
                s_IgnoreNextLeftButtonRelease = true;
                ignoreNextLeftButtonRelease = true;
            }
        }
        else if( ( m_CanStartBlock >= 0 )
                && ( event.LeftIsDown() || event.MiddleIsDown() )
                && ManageCurseur == NULL
                && ForceCloseManageCurseur == NULL )
                && !IsMouseCaptured() )
        {
            // Mouse is dragging: if no block in progress,  start a block command.
            if( screen->m_BlockLocate.m_State == STATE_NO_BLOCK )
@@ -1041,9 +1041,9 @@ void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event )

            if( (screen->m_BlockLocate.m_State != STATE_NO_BLOCK) && BlockIsSmall )
            {
                if( ForceCloseManageCurseur )
                if( m_endMouseCaptureCallback )
                {
                    ForceCloseManageCurseur( this, &DC );
                    m_endMouseCaptureCallback( this, &DC );
                    m_AutoPAN_Request = false;
                }

@@ -1068,13 +1068,9 @@ void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event )
    // To avoid an unwanted block move command if the mouse is moved while double clicking
    if( localbutt == (int) ( GR_M_LEFT_DOWN | GR_M_DCLICK ) )
    {
        if( !screen->IsBlockActive() )
        {
            if( ForceCloseManageCurseur )
        if( !screen->IsBlockActive() && IsMouseCaptured() )
        {
                ForceCloseManageCurseur( this, &DC );
                m_AutoPAN_Request = false;
            }
            m_endMouseCaptureCallback( this, &DC );
        }
    }

@@ -1111,10 +1107,10 @@ void EDA_DRAW_PANEL::OnKeyEvent( wxKeyEvent& event )
    case WXK_ESCAPE:
        m_AbortRequest = true;

        if( ManageCurseur && ForceCloseManageCurseur )
            UnManageCursor( -1, m_defaultCursor );
        if( IsMouseCaptured() )
            EndMouseCapture( -1, m_defaultCursor );
        else
            UnManageCursor( 0, m_cursor, wxEmptyString );
            EndMouseCapture( 0, m_cursor, wxEmptyString );

        break;
    }
@@ -1207,14 +1203,14 @@ void EDA_DRAW_PANEL::OnPan( wxCommandEvent& event )
}


void EDA_DRAW_PANEL::UnManageCursor( int id, int cursor, const wxString& title )
void EDA_DRAW_PANEL::EndMouseCapture( int id, int cursor, const wxString& title )
{
    if( ManageCurseur && ForceCloseManageCurseur )
    if( m_mouseCaptureCallback && m_endMouseCaptureCallback )
    {
        INSTALL_UNBUFFERED_DC( dc, this );
        ForceCloseManageCurseur( this, &dc );
        ManageCurseur = NULL;
        ForceCloseManageCurseur = NULL;
        m_endMouseCaptureCallback( this, &dc );
        m_mouseCaptureCallback = NULL;
        m_endMouseCaptureCallback = NULL;
        m_AutoPAN_Request = false;
    }

Loading