Bugfixes; added selection modes demo to griddemo

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6439 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Neis
2000-03-04 19:56:39 +00:00
parent a56fcaaf46
commit 043d16b225
5 changed files with 63 additions and 19 deletions

View File

@@ -3165,9 +3165,9 @@ bool wxGrid::CreateGrid( int numRows, int numCols,
m_table->SetView( this );
m_ownTable = TRUE;
Init();
m_selection = new wxGridSelection( this, selmode );
m_created = TRUE;
}
m_selection = new wxGridSelection( this, selmode );
return m_created;
}
@@ -3181,7 +3181,8 @@ void wxGrid::SetSelectionMode(wxGrid::wxGridSelectionModes selmode)
m_selection->SetSelectionMode( selmode );
}
bool wxGrid::SetTable( wxGridTableBase *table, bool takeOwnership )
bool wxGrid::SetTable( wxGridTableBase *table, bool takeOwnership,
wxGrid::wxGridSelectionModes selmode )
{
if ( m_created )
{
@@ -3190,6 +3191,7 @@ bool wxGrid::SetTable( wxGridTableBase *table, bool takeOwnership )
// View at runtime. Is there anything in the implmentation that would
// prevent this?
// At least, you now have to copy with m_selection
wxFAIL_MSG( wxT("wxGrid::CreateGrid or wxGrid::SetTable called more than once") );
return FALSE;
}
@@ -3203,6 +3205,7 @@ bool wxGrid::SetTable( wxGridTableBase *table, bool takeOwnership )
if (takeOwnership)
m_ownTable = TRUE;
Init();
m_selection = new wxGridSelection( this, selmode );
m_created = TRUE;
}
@@ -4391,10 +4394,10 @@ void wxGrid::ProcessGridCellMouseEvent( wxMouseEvent& event )
if ( m_selectingTopLeft != wxGridNoCellCoords &&
m_selectingBottomRight != wxGridNoCellCoords )
{
m_selection->SelectBlock( m_selectingTopLeft.GetRow(),
m_selectingTopLeft.GetCol(),
m_selectingBottomRight.GetRow(),
m_selectingBottomRight.GetCol() );
m_selection->SelectBlock( m_selectingTopLeft.GetRow(),
m_selectingTopLeft.GetCol(),
m_selectingBottomRight.GetRow(),
m_selectingBottomRight.GetCol() );
if (m_winCapture)
{
m_winCapture->ReleaseMouse();