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. angular-ui-select (系列二)远程搜索,页面方框显示的值跟传给后台的值不一样解决方案

    三:下拉单选远程搜索: 一个重点是: 这个方法,就是让我们去远程搜索的 refresh="ctrl.refreshAddresses($select.search)" refres ...

  2. python 连接数据库 pymysql模块的使用

    一 Python3连接MySQL 本文介绍Python3连接MySQL的第三方库--PyMySQL的基本使用. 1 PyMySQL介绍 PyMySQL 是在 Python3.x 版本中用于连接 MyS ...

  3. Android ToggleButton(开关函数)与switch (开关按钮)

    1.ToggleButton (1)介绍 (2)组件形状 (3)xml文件设置 <?xml version="1.0" encoding="utf-8"? ...

  4. linux中tr的功能多多

    功能 通过使用 tr,您可以非常容易地实现 sed 的许多最基本功能. 您可以将 tr 看作为 sed 的(极其)简化的变体:它可以用一个字符来替换另一个字符,或者可以完全除去一些字符.您也可以用它来 ...

  5. BFS和图的最短路径 279,127,126

    在本题中,任何一个正整数都会由完全平方数1组成,所以不可能没有解. 贪心是不成立的,因为如果寻找12的完全平方数,使用贪心,则它由9,1,1,1四个数组成:但是最少的完全平方数是由三个4组成的. 4- ...

  6. HDU - 1427 / UESTC - 1252 经典dfs

    很好奇为什么hzwer那种稍改一下还是无法过样例,代码我没看出问题 换了一种用桶组合挑取两个数不断回溯的做法 这是HDU1427的代码,后者改一改就行了 #include<bits/stdc++ ...

  7. SQL批量提交修改业务

    把你需要批量提交修改的东西在内存中修改完毕 然后执行以下代码 SqlConnection conn = new SqlConnection(ConnectionString);SqlDataAdapt ...

  8. hadoop 配置安装

    1.   下载hadoop 压缩包,   拷贝到 /usr/hadoop目录下   tar -zxvf  hadoop-2.7.1.tar.gz, 比如: 127.0.0.1 localhost 19 ...

  9. 剑指offer——面试题8:二叉树的下一个节点

    // 面试题8:二叉树的下一个结点 // 题目:给定一棵二叉树和其中的一个结点,如何找出中序遍历顺序的下一个结点? // 树中的结点除了有两个分别指向左右子结点的指针以外,还有一个指向父结点的指针. ...

  10. django笔记-url

    本文章只是用于学习方面的笔记,方便以后避免重复掉坑. 1.模板template的html文件可以根据url.py文件配置的name查找对应的url 2.在template的html文件里里面的url就 ...