wxGrid* grid)
{
wxString value = Combo()->GetValue();
- bool changed = value != m_startValue;
-
- if ( changed )
- grid->GetTable()->SetValue(row, col, value);
+ if ( value == m_startValue )
+ return false;
- m_startValue = wxEmptyString;
- if (m_allowOthers)
- Combo()->SetValue(m_startValue);
- else
- Combo()->SetSelection(0);
+ grid->GetTable()->SetValue(row, col, value);
- return changed;
+ return true;
}
void wxGridCellChoiceEditor::Reset()
m_colMinWidths(GRID_HASH_SIZE),
m_rowMinHeights(GRID_HASH_SIZE)
{
- // Can't use SetBestFittingSize here to avoid a crash as CreateGrid hasn't
- // been called yet.
- SetMinSize(size);
Create();
+ SetBestFittingSize(size);
}
bool wxGrid::Create(wxWindow *parent, wxWindowID id,
m_colMinWidths = wxLongToLongHashMap(GRID_HASH_SIZE) ;
m_rowMinHeights = wxLongToLongHashMap(GRID_HASH_SIZE) ;
- // Can't use SetBestFittingSize here to avoid a crash as CreateGrid hasn't
- // been called yet.
- SetMinSize(size);
Create() ;
+ SetBestFittingSize(size);
return true;
}
// of the scrollbars, is there any magic incantaion for that?
int xpu, ypu;
GetScrollPixelsPerUnit(&xpu, &ypu);
- width += 1 + xpu - (width % xpu);
- height += 1 + ypu - (height % ypu);
+ if (xpu)
+ width += 1 + xpu - (width % xpu);
+ if (ypu)
+ height += 1 + ypu - (height % ypu);
// limit to 1/4 of the screen size
int maxwidth, maxheight;