void CDialogEditGridColours::OnGridSelect(wxGridRangeSelectEvent &e)
{
  bool bSkip = true;
  if(!m_nInSelect)
  {
    CIncrementer xxx(m_nInSelect);
    if(e.Selecting())
    {
      wxGrid *pGrid = (wxGrid *) e.GetEventObject();
      int nRow = pGrid->GetGridCursorRow();
      pGrid->ClearSelection();
      pGrid->SetGridCursor(nRow,0);
/*
      int nTop = e.GetTopRow();
      int nBot = e.GetBottomRow();
      if(nTop != nBot)
      {
        int nRow = pGrid->GetGridCursorRow();
        pGrid->ClearSelection();
        pGrid->SetGridCursor(nRow,0);
      }
*/
    }
  }
  e.Skip(bSkip);
}
Beispiel #2
0
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 ExtImportPrefs::OnRuleTableSelectRange (wxGridRangeSelectEvent& event)
{
   int toprow;
   event.Skip();
   if (!event.Selecting() || mStopRecursiveSelection)
      return;

   toprow = event.GetTopRow();
   if (toprow < 0)
      return;

   DoOnRuleTableSelect (toprow);
   mStopRecursiveSelection = true;
   RuleTable->SelectRow (toprow);
   mStopRecursiveSelection = false;
   RuleTable->SetGridCursor (toprow, 0);
}
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();
}
//---------------------------------------------------------
void CVIEW_Table_Control::On_Select(wxGridRangeSelectEvent &event)
{
	if( GetBatchCount() == 0 )
	{
		BeginBatch();

		for(int iRow=event.GetTopRow(); iRow<=event.GetBottomRow(); iRow++)
		{
			if( m_pRecords[iRow]->is_Selected() != event.Selecting() )
			{
				m_pTable->Select(m_pRecords[iRow], true);
			}
		}

		EndBatch();

		_Update_Views();
	}

	event.Skip();
}