Allow a NULL editor and/or renderer to be passed to RegisterDataType
and not crash when it tries to get them later. (If NULL it falls back to the grid's default like it used to before the type registry was added.) Added wxTE_PROCESS_TAB to wxTextCtrl style for MSW. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8723 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -502,7 +502,8 @@ void wxGridCellTextEditor::Create(wxWindow* parent,
|
|||||||
m_control = new wxTextCtrl(parent, id, wxEmptyString,
|
m_control = new wxTextCtrl(parent, id, wxEmptyString,
|
||||||
wxDefaultPosition, wxDefaultSize
|
wxDefaultPosition, wxDefaultSize
|
||||||
#if defined(__WXMSW__)
|
#if defined(__WXMSW__)
|
||||||
, wxTE_MULTILINE | wxTE_NO_VSCROLL | wxTE_AUTO_SCROLL
|
, wxTE_PROCESS_TAB | wxTE_MULTILINE |
|
||||||
|
wxTE_NO_VSCROLL | wxTE_AUTO_SCROLL
|
||||||
#endif
|
#endif
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -538,9 +539,9 @@ void wxGridCellTextEditor::SetSize(const wxRect& rectOrig)
|
|||||||
}
|
}
|
||||||
#else // !GTK
|
#else // !GTK
|
||||||
int extra_x = ( rect.x > 2 )? 2 : 1;
|
int extra_x = ( rect.x > 2 )? 2 : 1;
|
||||||
|
|
||||||
// MB: treat MSW separately here otherwise the caret doesn't show
|
// MB: treat MSW separately here otherwise the caret doesn't show
|
||||||
// when the editor is in the first row.
|
// when the editor is in the first row.
|
||||||
#if defined(__WXMSW__)
|
#if defined(__WXMSW__)
|
||||||
int extra_y = 2;
|
int extra_y = 2;
|
||||||
#else
|
#else
|
||||||
@@ -2417,14 +2418,16 @@ int wxGridTypeRegistry::FindOrCloneDataType(const wxString& typeName)
|
|||||||
wxGridCellRenderer* wxGridTypeRegistry::GetRenderer(int index)
|
wxGridCellRenderer* wxGridTypeRegistry::GetRenderer(int index)
|
||||||
{
|
{
|
||||||
wxGridCellRenderer* renderer = m_typeinfo[index]->m_renderer;
|
wxGridCellRenderer* renderer = m_typeinfo[index]->m_renderer;
|
||||||
renderer->IncRef();
|
if (renderer)
|
||||||
|
renderer->IncRef();
|
||||||
return renderer;
|
return renderer;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxGridCellEditor* wxGridTypeRegistry::GetEditor(int index)
|
wxGridCellEditor* wxGridTypeRegistry::GetEditor(int index)
|
||||||
{
|
{
|
||||||
wxGridCellEditor* editor = m_typeinfo[index]->m_editor;
|
wxGridCellEditor* editor = m_typeinfo[index]->m_editor;
|
||||||
editor->IncRef();
|
if (editor)
|
||||||
|
editor->IncRef();
|
||||||
return editor;
|
return editor;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3831,8 +3834,8 @@ bool wxGrid::Redimension( wxGridTableMessage& msg )
|
|||||||
wxGridCellAttrProvider * attrProvider = m_table->GetAttrProvider();
|
wxGridCellAttrProvider * attrProvider = m_table->GetAttrProvider();
|
||||||
if (attrProvider) {
|
if (attrProvider) {
|
||||||
attrProvider->UpdateAttrRows( pos, -((int)numRows) );
|
attrProvider->UpdateAttrRows( pos, -((int)numRows) );
|
||||||
// ifdef'd out following patch from Paul Gammans
|
// ifdef'd out following patch from Paul Gammans
|
||||||
#if 0
|
#if 0
|
||||||
// No need to touch column attributes, unless we
|
// No need to touch column attributes, unless we
|
||||||
// removed _all_ rows, in this case, we remove
|
// removed _all_ rows, in this case, we remove
|
||||||
// all column attributes.
|
// all column attributes.
|
||||||
@@ -3840,7 +3843,7 @@ bool wxGrid::Redimension( wxGridTableMessage& msg )
|
|||||||
// needed data is not available inside UpdateAttrRows.
|
// needed data is not available inside UpdateAttrRows.
|
||||||
if ( !GetNumberRows() )
|
if ( !GetNumberRows() )
|
||||||
attrProvider->UpdateAttrCols( 0, -GetNumberCols() );
|
attrProvider->UpdateAttrCols( 0, -GetNumberCols() );
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
if ( !GetBatchCount() )
|
if ( !GetBatchCount() )
|
||||||
{
|
{
|
||||||
@@ -3967,8 +3970,8 @@ bool wxGrid::Redimension( wxGridTableMessage& msg )
|
|||||||
wxGridCellAttrProvider * attrProvider = m_table->GetAttrProvider();
|
wxGridCellAttrProvider * attrProvider = m_table->GetAttrProvider();
|
||||||
if (attrProvider) {
|
if (attrProvider) {
|
||||||
attrProvider->UpdateAttrCols( pos, -((int)numCols) );
|
attrProvider->UpdateAttrCols( pos, -((int)numCols) );
|
||||||
// ifdef'd out following patch from Paul Gammans
|
// ifdef'd out following patch from Paul Gammans
|
||||||
#if 0
|
#if 0
|
||||||
// No need to touch row attributes, unless we
|
// No need to touch row attributes, unless we
|
||||||
// removed _all_ columns, in this case, we remove
|
// removed _all_ columns, in this case, we remove
|
||||||
// all row attributes.
|
// all row attributes.
|
||||||
@@ -3976,7 +3979,7 @@ bool wxGrid::Redimension( wxGridTableMessage& msg )
|
|||||||
// needed data is not available inside UpdateAttrCols.
|
// needed data is not available inside UpdateAttrCols.
|
||||||
if ( !GetNumberCols() )
|
if ( !GetNumberCols() )
|
||||||
attrProvider->UpdateAttrRows( 0, -GetNumberRows() );
|
attrProvider->UpdateAttrRows( 0, -GetNumberRows() );
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
if ( !GetBatchCount() )
|
if ( !GetBatchCount() )
|
||||||
{
|
{
|
||||||
@@ -5615,7 +5618,7 @@ void wxGrid::SetCurrentCell( const wxGridCellCoords& coords )
|
|||||||
}
|
}
|
||||||
|
|
||||||
CalcCellsExposed( r );
|
CalcCellsExposed( r );
|
||||||
|
|
||||||
// Otherwise refresh redraws the highlight!
|
// Otherwise refresh redraws the highlight!
|
||||||
m_currentCellCoords = coords;
|
m_currentCellCoords = coords;
|
||||||
|
|
||||||
@@ -7344,14 +7347,14 @@ void wxGrid::SetRowLabelAlignment( int horiz, int vert )
|
|||||||
case wxRIGHT: horiz = wxALIGN_RIGHT; break;
|
case wxRIGHT: horiz = wxALIGN_RIGHT; break;
|
||||||
case wxCENTRE: horiz = wxALIGN_CENTRE; break;
|
case wxCENTRE: horiz = wxALIGN_CENTRE; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch ( vert )
|
switch ( vert )
|
||||||
{
|
{
|
||||||
case wxTOP: vert = wxALIGN_TOP; break;
|
case wxTOP: vert = wxALIGN_TOP; break;
|
||||||
case wxBOTTOM: vert = wxALIGN_BOTTOM; break;
|
case wxBOTTOM: vert = wxALIGN_BOTTOM; break;
|
||||||
case wxCENTRE: vert = wxALIGN_CENTRE; break;
|
case wxCENTRE: vert = wxALIGN_CENTRE; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( horiz == wxALIGN_LEFT || horiz == wxALIGN_CENTRE || horiz == wxALIGN_RIGHT )
|
if ( horiz == wxALIGN_LEFT || horiz == wxALIGN_CENTRE || horiz == wxALIGN_RIGHT )
|
||||||
{
|
{
|
||||||
m_rowLabelHorizAlign = horiz;
|
m_rowLabelHorizAlign = horiz;
|
||||||
@@ -7377,14 +7380,14 @@ void wxGrid::SetColLabelAlignment( int horiz, int vert )
|
|||||||
case wxRIGHT: horiz = wxALIGN_RIGHT; break;
|
case wxRIGHT: horiz = wxALIGN_RIGHT; break;
|
||||||
case wxCENTRE: horiz = wxALIGN_CENTRE; break;
|
case wxCENTRE: horiz = wxALIGN_CENTRE; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch ( vert )
|
switch ( vert )
|
||||||
{
|
{
|
||||||
case wxTOP: vert = wxALIGN_TOP; break;
|
case wxTOP: vert = wxALIGN_TOP; break;
|
||||||
case wxBOTTOM: vert = wxALIGN_BOTTOM; break;
|
case wxBOTTOM: vert = wxALIGN_BOTTOM; break;
|
||||||
case wxCENTRE: vert = wxALIGN_CENTRE; break;
|
case wxCENTRE: vert = wxALIGN_CENTRE; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( horiz == wxALIGN_LEFT || horiz == wxALIGN_CENTRE || horiz == wxALIGN_RIGHT )
|
if ( horiz == wxALIGN_LEFT || horiz == wxALIGN_CENTRE || horiz == wxALIGN_RIGHT )
|
||||||
{
|
{
|
||||||
m_colLabelHorizAlign = horiz;
|
m_colLabelHorizAlign = horiz;
|
||||||
@@ -8253,14 +8256,14 @@ void wxGrid::SelectCol( int col, bool addToSelected )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void wxGrid::SelectBlock( int topRow, int leftCol, int bottomRow, int rightCol,
|
void wxGrid::SelectBlock( int topRow, int leftCol, int bottomRow, int rightCol,
|
||||||
bool addToSelected )
|
bool addToSelected )
|
||||||
{
|
{
|
||||||
if ( IsSelection() && !addToSelected )
|
if ( IsSelection() && !addToSelected )
|
||||||
ClearSelection();
|
ClearSelection();
|
||||||
|
|
||||||
m_selection->SelectBlock( topRow, leftCol, bottomRow, rightCol,
|
m_selection->SelectBlock( topRow, leftCol, bottomRow, rightCol,
|
||||||
FALSE, addToSelected );
|
FALSE, addToSelected );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user