Re: Possible bug in wxGrid when using wxEVT_GRID_ROW_MOVE event, GetRow returns wxNOT_FOUND, GetCol returns row number that was moved.

Tony Kennedy <[email protected]>
Newsgroups gmane.comp.lib.wxwindows.general
Message-ID <[email protected]>
PS. It's an easy fix. In wxGrid::DoEndMoveRow, the call to "SendEvent" 
should have  m_dragMoveRowOrCol, -1, not   -1, m_dragMoveRowOrCol.



void wxGrid::DoEndMoveRow(int pos)
{
    wxASSERT_MSG( m_dragMoveRowOrCol != -1, "no matching DoStartMoveRow?" );

    if ( SendEvent(wxEVT_GRID_ROW_MOVE, m_dragMoveRowOrCol, -1) != 
Event_Vetoed )
        SetRowPos(m_dragMoveRowOrCol, pos);

    m_dragMoveRowOrCol = -1;
}



On Tuesday, 11 February 2025 at 09:27:30 UTC Tony Kennedy wrote:

> Hi all,
>
> Using wx 3.2.6 on Windows.
>
> I think I've found a bug in the wxGrid class.
>
> Easy to replicate using the grid sample. Put a breakpoint in the function 
> "OnGridRowMove". 
>
> Click File->Tabular Table Test, then tick show row labels. Now drag/drop a 
> row, the "OnGridRowMove" function is called, but the event has the row 
> number set to -1, but the column number set to the row you move.
>
> All the best,
>
> Tony.
>

-- 
Please read https://www.wxwidgets.org/support/mlhowto.htm before posting.
--- 
You received this message because you are subscribed to the Google Groups "wx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/wx-users/af465691-dc42-4453-a843-87ab050055f6n%40googlegroups.com.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.