if (grid->GetTable()->CanGetValueAs(row, col, wxGRID_VALUE_BOOL))
m_startValue = grid->GetTable()->GetValueAsBool(row, col);
else
- m_startValue = !!grid->GetTable()->GetValue(row, col);
+ {
+ wxString cellval( grid->GetTable()->GetValue(row, col) );
+ m_startValue = !( !cellval || (cellval == "0") );
+ }
CBox()->SetValue(m_startValue);
CBox()->SetFocus();
}
if ( grid.GetTable()->CanGetValueAs(row, col, wxGRID_VALUE_BOOL) )
value = grid.GetTable()->GetValueAsBool(row, col);
else
- value = !!grid.GetTable()->GetValue(row, col);
+ {
+ wxString cellval( grid.GetTable()->GetValue(row, col) );
+ value = !( !cellval || (cellval == "0") );
+ }
if ( value )
{
wxGridCellAttrProvider * attrProvider = m_table->GetAttrProvider();
if (attrProvider) {
attrProvider->UpdateAttrRows( pos, -((int)numRows) );
-// ifdef'd out following patch from Paul Gammans
-#if 0
+// ifdef'd out following patch from Paul Gammans
+#if 0
+ // No need to touch column attributes, unless we
// removed _all_ rows, in this case, we remove
// all column attributes.
// I hate to do this here, but the
if (attrProvider) {
attrProvider->UpdateAttrCols( pos, -((int)numCols) );
// ifdef'd out following patch from Paul Gammans
-#if 0
+#if 0
// No need to touch row attributes, unless we
// removed _all_ columns, in this case, we remove
// all row attributes.
HideCellEditControl();
DisableCellEditControl();
- if ( IsVisible( m_currentCellCoords, FALSE ) ) // zzz
+ if ( IsVisible( m_currentCellCoords, FALSE ) )
{
wxRect r;
r = BlockToDeviceRect(m_currentCellCoords, m_currentCellCoords);
{
if ( !IsVisible( m_currentCellCoords ) )
{
- m_cellEditCtrlEnabled = false;
+ m_cellEditCtrlEnabled = FALSE;
return;
}
else
if ( rect.height > 0 )
{
CalcScrolledPosition(0, rect.y, &rect.x, &rect.y);
- rect.x = m_left;
+ rect.x = 0;
rect.width = m_rowLabelWidth;
m_rowLabelWin->Refresh( TRUE, &rect );
}
if ( rect.width > 0 )
{
CalcScrolledPosition(rect.x, 0, &rect.x, &rect.y);
- rect.y = m_top;
+ rect.y = 0;
rect.height = m_colLabelHeight;
m_colLabelWin->Refresh( TRUE, &rect );
}