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. WebStorm ES6 语法支持设置和ES6语法的JS文件编译为ES5语法文件

    ECMAScript 6是JavaScript语言的下一代标准,已经在2015年6月正式发布了.Mozilla公司将在这个标准的基础上,推出JavaScript 2.0.ES6的目标,是使得JavaS ...

  2. Luogu P1801 黑匣子_NOI导刊2010提高(06)

    P1801 黑匣子_NOI导刊2010提高(06) 题目描述 Black Box是一种原始的数据库.它可以储存一个整数数组,还有一个特别的变量i.最开始的时候Black Box是空的.而i等于0.这个 ...

  3. 简单易懂的VS-CODE C++环境配置(ACM向)

    网上教程比较繁琐,他们似乎要把vs-code变得无所不能,而我只是想代替dev进行简单的输入输出 所以大概花了1个多小时找到了能用的方法(中途还搞了个ubuntu子系统发现没啥用) 这里随便说下 1. ...

  4. BZOJ - 1003 DP+最短路

    这道题被马老板毒瘤了一下,TLE到怀疑人生 //然而BZOJ上妥妥地过了(5500ms+ -> 400ms+) 要么SPFA太玄学要么是初始化block被卡到O(n^4) 不管了,不改了 另外D ...

  5. SQL中的object_id函数

    关于SQL中的object_id函数:应该就是指系统表中存储着数据库的所有对象 每一个对象都有一个唯一的标识符Id进行标识object_id 就是根据对象名称返回改对象的Idobject_name 就 ...

  6. CSS3--底部菜单上拉效果

    <!DOCTYPE html><html>    <head>        <meta charset="UTF-8">      ...

  7. matlab遍历文件制作自己的数据集 .mat文件

    原文作者:aircraft 原文地址:https://www.cnblogs.com/DOMLX/p/9115788.html 看到深度学习里面的教学动不动就是拿MNIST数据集,或者是IMGPACK ...

  8. POJ 2570 Fiber Network

    Description Several startup companies have decided to build a better Internet, called the "Fibe ...

  9. C和C++中include 搜索路径的一般形式以及gcc搜索头文件的路径

    C和C++中include 搜索路径的一般形式 对于include 搜索的路径: C中可以通过 #include <stdio.h> 和 #include "stidio.h&q ...

  10. xss攻击汇总--转

    (1)普通的XSS JavaScript注入<SCRIPT SRC=http://3w.org/XSS/xss.js></SCRIPT>(2)IMG标签XSS使用JavaScr ...