phoenix_title wx.grid.GridCellChoiceEditor

Grid cell editor for string data providing the user a choice from a list of strings.

See also

wx.grid.GridCellEditor, wx.grid.GridCellAutoWrapStringEditor, wx.grid.GridCellBoolEditor, wx.grid.GridCellEnumEditor, wx.grid.GridCellFloatEditor, wx.grid.GridCellNumberEditor, wx.grid.GridCellTextEditor, wx.grid.GridCellDateEditor


class_hierarchy Class Hierarchy

Inheritance diagram for class GridCellChoiceEditor:

sub_classes Known Subclasses

wx.grid.GridCellEnumEditor


method_summary Methods Summary

__init__

Choice cell renderer constructor.

EndEdit

End editing the cell.

SetParameters

Parameters string format is “item1[,item2[…,itemN]]”.


api Class API

class wx.grid.GridCellChoiceEditor(GridCellEditor)

Possible constructors:

GridCellChoiceEditor(choices, allowOthers=False)

Grid cell editor for string data providing the user a choice from a list of strings.


Methods

__init__(self, choices, allowOthers=False)

Choice cell renderer constructor.

Parameters:
  • choices (list of strings) – An array of strings from which the user can choose.

  • allowOthers (bool) – If allowOthers is True, the user can type a string not in choices array.



EndEdit(self, row, col, grid, oldval)

End editing the cell.

This function must check if the current value of the editing cell is valid and different from the original value in its string form. If not then simply return None. If it has changed then this method should save the new value so that ApplyEdit can apply it later and the string representation of the new value should be returned.

Notice that this method shoiuld not modify the grid as the change could still be vetoed.



SetParameters(self, params)

Parameters string format is “item1[,item2[…,itemN]]”.

This method can be called before the editor is used for the first time, or later, in which case it replaces the previously specified strings with the new ones.

Parameters:

params (string) –