This class is responsible for providing and manipulating the in-place edit controls for the grid.
Instances of wx.grid.GridCellEditor (actually, instances of derived classes since it is an abstract class) can be associated with the cell attributes for individual cells, rows, columns, or even for the entire grid.
See also
wx.grid.GridCellAutoWrapStringEditor, wx.grid.GridCellBoolEditor, wx.grid.GridCellChoiceEditor, wx.grid.GridCellEnumEditor, wx.grid.GridCellFloatEditor, wx.grid.GridCellNumberEditor, wx.grid.GridCellTextEditor
wx.grid.GridCellBoolEditor, wx.grid.GridCellChoiceEditor, wx.grid.GridCellTextEditor
__init__ |
Default constructor. |
ApplyEdit |
Effectively save the changes in the grid. |
BeginEdit |
Fetch the value from the table and prepare the edit control to begin editing. |
Clone |
Create a new object which is the copy of this one. |
Create |
Creates the actual edit control. |
Destroy |
Final cleanup. |
EndEdit |
End editing the cell. |
GetControl |
Get the wx.Control used by this editor. |
GetValue |
Returns the value currently in the editor control. |
HandleReturn |
Some types of controls on some platforms may need some help with the Return key. |
IsCreated |
Returns True if the edit control has been created. |
PaintBackground |
Draws the part of the cell not occupied by the control: the base class version just fills it with background colour from the attribute. |
Reset |
Reset the value in the control back to its starting value. |
SetControl |
Set the wx.Control that will be used by this cell editor for editing the value. |
SetSize |
Size and position the edit control. |
Show |
Show or hide the edit control, use the specified attributes to set colours/fonts for it. |
StartingClick |
If the editor is enabled by clicking on the cell, this method will be called. |
StartingKey |
If the editor is enabled by pressing keys on the grid, this will be called to let the editor do something about that first key if desired. |
~wxGridCellEditor |
The destructor is private because only DecRef can delete us. |
wx.grid.
GridCellEditor
(ClientDataContainer, RefCounter)¶Possible constructors:
GridCellEditor()
This class is responsible for providing and manipulating the in-place edit controls for the grid.
__init__
(self)¶Default constructor.
ApplyEdit
(self, row, col, grid)¶Effectively save the changes in the grid.
This function should save the value of the control in the grid. It is called only after EndEdit
returns True
.
Parameters: |
|
---|
BeginEdit
(self, row, col, grid)¶Fetch the value from the table and prepare the edit control to begin editing.
This function should save the original value of the grid cell at the given row and col and show the control allowing the user to change it.
Parameters: |
|
---|
See also
Clone
(self)¶Create a new object which is the copy of this one.
Return type: | wx.grid.GridCellEditor |
---|
Create
(self, parent, id, evtHandler)¶Creates the actual edit control.
Parameters: |
|
---|
Destroy
(self)¶Final cleanup.
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.
GetControl
(self)¶Get the wx.Control used by this editor.
Return type: | Control |
---|
GetValue
(self)¶Returns the value currently in the editor control.
Return type: | string |
---|
HandleReturn
(self, event)¶Some types of controls on some platforms may need some help with the Return key.
Parameters: | event (wx.KeyEvent) – |
---|
IsCreated
(self)¶Returns True
if the edit control has been created.
Return type: | bool |
---|
PaintBackground
(self, dc, rectCell, attr)¶Draws the part of the cell not occupied by the control: the base class version just fills it with background colour from the attribute.
Parameters: |
|
---|
Reset
(self)¶Reset the value in the control back to its starting value.
SetControl
(self, control)¶Set the wx.Control that will be used by this cell editor for editing the value.
Parameters: | control (wx.Control) – |
---|
Show
(self, show, attr=None)¶Show or hide the edit control, use the specified attributes to set colours/fonts for it.
Parameters: |
|
---|
StartingClick
(self)¶If the editor is enabled by clicking on the cell, this method will be called.
StartingKey
(self, event)¶If the editor is enabled by pressing keys on the grid, this will be called to let the editor do something about that first key if desired.
Parameters: | event (wx.KeyEvent) – |
---|
~wxGridCellEditor(self)
The destructor is private because only DecRef
can delete us.
Control
¶See GetControl
and SetControl