void PropGrid::OnRangeSelected( wxGridRangeSelectEvent& ev ) { if(ev.Selecting()) { bool reselect=false; //Fusion avec la précédente séléction if((currentSelection.TopRow==ev.GetTopRow() && currentSelection.BottomRow==ev.GetBottomRow())) { currentSelection.LeftCol=wxMin(currentSelection.LeftCol,ev.GetLeftCol()); currentSelection.RightCol=wxMax(ev.GetRightCol(),currentSelection.RightCol); } else if(currentSelection.LeftCol==ev.GetLeftCol() && currentSelection.RightCol==ev.GetRightCol()) { currentSelection.TopRow=wxMin(ev.GetTopRow(),currentSelection.TopRow); currentSelection.BottomRow=wxMax(ev.GetBottomRow(),currentSelection.BottomRow); }else{ currentSelection.TopRow=ev.GetTopRow(); currentSelection.LeftCol=ev.GetLeftCol(); currentSelection.BottomRow=ev.GetBottomRow(); currentSelection.RightCol=ev.GetRightCol(); } //if(oldSelection.TopRow!=currentSelection.TopRow || oldSelection.LeftCol!=currentSelection.LeftCol || oldSelection.BottomRow!=currentSelection.BottomRow || oldSelection.RightCol!=currentSelection.RightCol) if(reselect) SelectBlock(currentSelection.TopRow, currentSelection.LeftCol, currentSelection.BottomRow, currentSelection.RightCol); }else{ currentSelection=t_selection(); } #ifdef __WXDEBUG__ //wxLogDebug("orig:[%i;%i] dest:[%i;%i] sel[%i]",currentSelection.TopRow,currentSelection.LeftCol,currentSelection.BottomRow,currentSelection.RightCol,ev.Selecting()); #endif ev.Skip(); }
//---------------------------------------------------------------------------------------- void DBGrid::OnRangeSelected( wxGridRangeSelectEvent& ev ) { logBuf = _T("DBGrid::OnRangeSelected : "); logBuf << _T("Selected cells from row ") << ev.GetTopRow() << _T(" col ") << ev.GetLeftCol() << _T(" to row ") << ev.GetBottomRow() << _T(" col ") << ev.GetRightCol(); logBuf += _T("\n"); // wxLogMessage( "%s", logBuf.c_str() ); wxLogMessage(logBuf.c_str()); ev.Skip(); }
void GridFrame::OnRangeSelected( wxGridRangeSelectEvent& ev ) { wxString logBuf; if ( ev.Selecting() ) logBuf << _T("Selected "); else logBuf << _T("Deselected "); logBuf << _T("cells from row ") << ev.GetTopRow() << _T(" col ") << ev.GetLeftCol() << _T(" to row ") << ev.GetBottomRow() << _T(" col ") << ev.GetRightCol() << _T(" ( ControlDown: ")<< (ev.ControlDown() ? 'T':'F') << _T(", ShiftDown: ")<< (ev.ShiftDown() ? 'T':'F') << _T(", AltDown: ")<< (ev.AltDown() ? 'T':'F') << _T(", MetaDown: ")<< (ev.MetaDown() ? 'T':'F') << _T(" )"); wxLogMessage( wxT("%s"), logBuf.c_str() ); ev.Skip(); }