wxGridCellEditor Class Referenceabstract

#include <wx/grid.h>

 Inheritance diagram for wxGridCellEditor:

Detailed Description

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

Instances of wxGridCellEditor (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.

Library:  wxAdvanced
See also
wxGridCellAutoWrapStringEditorwxGridCellBoolEditorwxGridCellChoiceEditorwxGridCellEnumEditorwxGridCellFloatEditorwxGridCellNumberEditorwxGridCellTextEditor

Public Member Functions

  wxGridCellEditor ()
  Default constructor. More...
 
virtual void  BeginEdit (int row, int col, wxGrid *grid)=0
  Fetch the value from the table and prepare the edit control to begin editing. More...
 
virtual wxGridCellEditor *  Clone () const =0
  Create a new object which is the copy of this one. More...
 
virtual void  Create (wxWindow *parent, wxWindowID id, wxEvtHandler *evtHandler)=0
  Creates the actual edit control. More...
 
virtual void  Destroy ()
  Final cleanup. More...
 
virtual bool  EndEdit (int row, int col, const wxGrid *grid, const wxString &oldval, wxString *newval)=0
  End editing the cell. More...
 
virtual void  ApplyEdit (int row, int col, wxGrid *grid)=0
  Effectively save the changes in the grid. More...
 
virtual void  HandleReturn (wxKeyEvent &event)
  Some types of controls on some platforms may need some help with the Return key. More...
 
bool  IsCreated ()
  Returns true if the edit control has been created. More...
 
virtual void  PaintBackground (wxDC &dc, const wxRect &rectCell, const wxGridCellAttr &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. More...
 
virtual void  Reset ()=0
  Reset the value in the control back to its starting value. More...
 
virtual void  SetSize (const wxRect &rect)
  Size and position the edit control. More...
 
virtual void  Show (bool show, wxGridCellAttr *attr=NULL)
  Show or hide the edit control, use the specified attributes to set colours/fonts for it. More...
 
virtual void  StartingClick ()
  If the editor is enabled by clicking on the cell, this method will be called. More...
 
virtual void  StartingKey (wxKeyEvent &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. More...
 
virtual wxString  GetValue () const =0
  Returns the value currently in the editor control. More...
 
wxControl *  GetControl () const
  Get the wxControl used by this editor. More...
 
void  SetControl (wxControl *control)
  Set the wxControl that will be used by this cell editor for editing the value. More...
 
 Public Member Functions inherited from wxClientDataContainer
 Public Member Functions inherited from wxRefCounter

Protected Member Functions

virtual  ~wxGridCellEditor ()
  The destructor is private because only DecRef() can delete us. More...
 
 Protected Member Functions inherited from wxRefCounter

Constructor & Destructor Documentation

wxGridCellEditor::wxGridCellEditor (   )  

Default constructor.

virtual wxGridCellEditor::~wxGridCellEditor (   )  
protectedvirtual

The destructor is private because only DecRef() can delete us.

Member Function Documentation

virtual void wxGridCellEditor::ApplyEdit ( int  row,
    int  col,
    wxGrid *  grid 
  )    
pure virtual

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.

virtual void wxGridCellEditor::BeginEdit ( int  row,
    int  col,
    wxGrid *  grid 
  )    
pure virtual

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.

See also
EndEdit()
virtual wxGridCellEditor* wxGridCellEditor::Clone (   ) const
pure virtual

Create a new object which is the copy of this one.

virtual void wxGridCellEditor::Create ( wxWindow *  parent,
    wxWindowID  id,
    wxEvtHandler *  evtHandler 
  )    
pure virtual

Creates the actual edit control.

virtual void wxGridCellEditor::Destroy (   )  
virtual

Final cleanup.

virtual bool wxGridCellEditor::EndEdit ( int  row,
    int  col,
    const wxGrid *  grid,
    const wxString &  oldval,
    wxString *  newval 
  )    
pure virtual

End editing the cell.

This function must check if the current value of the editing control is valid and different from the original value (available as oldval in its string form and possibly saved internally using its real type by BeginEdit()). If it isn't, it just returnsfalse, otherwise it must do the following:

  • Save the new value internally so that ApplyEdit() could apply it.
  • Fill newval (which is never NULL) with the string representation of the new value.
  • Return true

Notice that it must not modify the grid as the change could still be vetoed.

If the user-defined wxEVT_GRID_CELL_CHANGING event handler doesn't veto this change, ApplyEdit() will be called next.

wxControl* wxGridCellEditor::GetControl (   ) const

Get the wxControl used by this editor.

virtual wxString wxGridCellEditor::GetValue (   ) const
pure virtual

Returns the value currently in the editor control.

virtual void wxGridCellEditor::HandleReturn ( wxKeyEvent &  event )  
virtual

Some types of controls on some platforms may need some help with the Return key.

bool wxGridCellEditor::IsCreated (   )  

Returns true if the edit control has been created.

virtual void wxGridCellEditor::PaintBackground ( wxDC &  dc,
    const wxRect &  rectCell,
    const wxGridCellAttr &  attr 
  )    
virtual

Draws the part of the cell not occupied by the control: the base class version just fills it with background colour from the attribute.

virtual void wxGridCellEditor::Reset (   )  
pure virtual

Reset the value in the control back to its starting value.

void wxGridCellEditor::SetControl ( wxControl *  control )  

Set the wxControl that will be used by this cell editor for editing the value.

virtual void wxGridCellEditor::SetSize ( const wxRect &  rect )  
virtual

Size and position the edit control.

virtual void wxGridCellEditor::Show ( bool  show,
    wxGridCellAttr *  attr = NULL 
  )    
virtual

Show or hide the edit control, use the specified attributes to set colours/fonts for it.

virtual void wxGridCellEditor::StartingClick (   )  
virtual

If the editor is enabled by clicking on the cell, this method will be called.

virtual void wxGridCellEditor::StartingKey ( wxKeyEvent &  event )  
virtual

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的更多相关文章

随机推荐

  1. 【转】Caused by: Action class [com.struts.action.xxxAction] not found 解决方法

    刚学习Struts,自己写了个简单程序,一启动tomcat就报错,但是我按着ctrl点击struts.xml中com.struts.action.LoginAction也能定位到LoginAction ...

  2. Eclipse工程部署到Tomcat时出现中文乱码问题

    1.修改Server.xml文件:添加URIEncoding="UTF-8" <?xml version="1.0" encoding="UTF ...

  3. LeetCode8. 字符串转整数 (atoi)

    8. 字符串转整数 (atoi) 描述 实现 atoi,将字符串转为整数. 在找到第一个非空字符之前,需要移除掉字符串中的空格字符.如果第一个非空字符是正号或负号,选取该符号,并将其与后面尽可能多的连 ...

  4. 【算法笔记】B1024 科学计数法

    1024 科学计数法 (20 分) 科学计数法是科学家用来表示很大或很小的数字的一种方便的方法,其满足正则表达式 [+-][1-9].[0-9]+E[+-][0-9]+,即数字的整数部分只有 1 位, ...

  5. 关于:“无法序列化会话状态。在“StateServer”或“SQLServer”模式下,...的问题

    关于:“无法序列化会话状态.在“StateServer”或“SQLServer”模式下,...的问题 错误描述: 无法序列化会话状态.在“StateServer”或“SQLServer”模式下,ASP ...

  6. PIE SDK波段运算

    1.算法功能简介 波段运算(Band Math)工具能够方便的执行图像中的各个波段的加减乘除.三角函数.指数.对数等数学函数计算,也可以使用IDL编写的函数. 由于每个用户都有独特的需求,利用此工具用 ...

  7. How to add more to Git Bash on Windows

    How to add more to Git Bash on Windows Download the lastest wget binary for windows from https://ete ...

  8. mongodb随机查询一条记录的正确方法!

    关于从mongodb库中随机取出一条记录的方法的博文很多,其中都提到了下面三种方法: 1.skip过随机数量的记录. DBCursor cursor = coll.find(query); int r ...

  9. matlab中如何根据t检验参数查找t检验值

    这个问题花了一些时间.先看图 这个是t检验里面的公式,但是如何在matlab中找到该式子对应的值,我现在才知道. 就是这样:x=tinv(1-α/2,n-1)----t(n)分布的上侧α分位数     ...

  10. NSTimer循环引用的问题

    前言: 记得之前看过一个面试题问:ARC环境下的dealloc方法有什么用?问题解答是:代理指针置空,停止定时器timer,注销通知,释放掉实例变量.看着没什么问题,而且网上一收也是大概这样的答案.今 ...