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. day--41 mysql索引原理与慢查询优化

    mysql索引原理与慢查询优化一:什么是索引 01:索引的出现是为了提高查询数据的效率 02:索引在mysql叫做“键” 或则“key“(primary key,uniquekey ,还有一个inde ...

  2. 老男孩python作业2-购物车程序

    购物车程序要求: 1.启动程序后,输入用户名密码后,如果是第一次登录,让用户输入工资,然后打印商品列表 2.允许用户根据商品编号购买商品 3.用户选择商品后,检测余额是否够,够就直接扣款,不够就提醒 ...

  3. PHP 中 快捷的三元运算...

    a!=null ? a: 123 当 a 不为空时,返回 123, 可简写为 a ?: 123(a 不为null 不为 '','0',0 时,返回它本身,否则返回123...)

  4. Mui 选项卡 tab 高度 没有自适应....

    因为项目中 用到了 mui ,mui 的选项卡有时候无法自适应高度,这回导致有的tab 出现一大片空白区域... 从jquery 的 思路 是  用一个值 保存 当前 的 高度... 当 点击其他 t ...

  5. C++_友元3-其他友元关系

    友元和类的关系还可以更复杂. 举个例子,假设出现了交互式遥控器,交互式遥控器能够让您回答电视节目中的问题,如果回答错误,电视将在控制器上产生嗡嗡声. 这个例子的问题,可以使用新的友元关系来解决.我把它 ...

  6. stiff chemistry模型出现NaN错误

    通过定位可以看到,是usr_rates.f中出现了奇异值,因为我的代码中有这样一句话: 而同时我的ConH2在声明后没有赋初值,因此,当X_g(IJK,H2) < c_Limiter后,ConH ...

  7. c# 动态生成继承类并实现序列化特性

    项目来源 App传过来的字段是动态的,希望能保证扩展性,返回时,把所需要的字段与数据融合后再返回过去 数据是第3方来源的,但是序列化后的结果又希望能并列返回 如:App传过来 一个设备Id,客户Id等 ...

  8. 微信小程序 修改(自定义) 单选/复选按钮样式 checkbox/radio样式自定义

    参考文章: 微信小程序 修改(自定义) 单选/复选按钮样式 checkbox/radio样式自定义

  9. v-show, v-if, 以及动态组件的区别

    vue提供了v-if, v-show来动态显示隐藏组件 同时也提供了<component>元素在一个挂载点上动态的切换组件, 通过 is 来决定哪个组件被渲染显示 配合<keep-a ...

  10. python (2) 之 pyc

    最近在编写Python脚本过程中遇到一个问题比较奇怪:Python脚本正常的,但执行报错"AttributeError: 'module' object has no attribute ' ...