Improve grid editors placing

Remove the code in wxGrid::ShowCellEditControl() which moves grid
editors unnecessarily and also remove workarounds that were required
because of it in the editors SetSize() functions.

This helps to ensure that the editor is placed at the same position the
renderer draws the cell value, so that it doesn't jump around annoyingly
when editing starts (which was especially noticeable for boolean-valued
cells).
This commit is contained in:
Ilya Sinitsyn
2019-11-01 04:02:26 +07:00
committed by Vadim Zeitlin
parent 6a21d6f2e4
commit 3ca9491c5f
4 changed files with 84 additions and 133 deletions

View File

@@ -1007,5 +1007,12 @@ private:
wxGridDataTypeInfoArray m_typeinfo;
};
// Returns the rect of the check box in a cell with the given alignmens
// and the size.
// The function is used by wxGridCellBoolEditor and wxGridCellBoolRenderer.
wxRect wxGetGridCheckBoxRect(const wxSize& checkBoxSize,
const wxRect& cellRect,
int hAlign, int vAlign);
#endif // wxUSE_GRID
#endif // _WX_GENERIC_GRID_PRIVATE_H_