Phoenix Logo

phoenix_title wx.grid.GridCellEditor

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.


class_hierarchy Class Hierarchy

Inheritance diagram for class GridCellEditor:

method_summary Methods Summary

__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.

property_summary Properties Summary

Control See GetControl and SetControl
Value See GetValue

api Class API



class wx.grid.GridCellEditor(ClientDataContainer, RefCounter)

Possible constructors:

GridCellEditor()

This class is responsible for providing and manipulating the in-place edit controls for the grid.


Methods



__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

EndEdit



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) –


SetSize(self, rect)

Size and position the edit control.

Parameters:rect (wx.Rect) –


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.


Properties



Control

See GetControl and SetControl



Value

See GetValue