wxWidgets: wxGridUpdateLocker Class Reference

| Version: 3.1.5

Loading...
Searching...
No Matches
Public Member Functions | List of all members
wxGridUpdateLocker Class Reference
Class List by Category » Grid Related Classes

`#include </cygdrive/c/Users/Hamis/Cygwin-packaging/wxWidgets3.1/wxWidgets3.1-3.1.5-4.x86_64/src/wxWidgets-3.1.5/interface/wx/grid.h>`

## Detailed Description

This small class can be used to prevent wxGrid from redrawing during its lifetime by calling wxGrid::BeginBatch() in its constructor and wxGrid::EndBatch() in its destructor.

It is typically used in a function performing several operations with a grid which would otherwise result in flicker. For example:

void MyFrame::Foo()
{
m_grid = new wxGrid(this, ...);
wxGridUpdateLocker noUpdates(m_grid);
m_grid-AppendColumn();
// ... many other operations with m_grid ...
m_grid-AppendRow();
// destructor called, grid refreshed
}
wxGrid
wxGrid and its related classes are used for displaying and editing tabular data.
Definition grid.h:2919
wxGridUpdateLocker::wxGridUpdateLocker
wxGridUpdateLocker(wxGrid *grid=NULL)
Creates an object preventing the updates of the specified grid.

Using this class is easier and safer than calling wxGrid::BeginBatch() and wxGrid::EndBatch() because you don't risk missing the call the latter (due to an exception for example).

##

Library: wxCore

<>< =''>:</>&;&;< =''>\ </></>

## Public Member Functions
| wxGridUpdateLocker (wxGrid *grid=NULL)
| Creates an object preventing the updates of the specified grid.
| ~wxGridUpdateLocker ()
| Destructor reenables updates for the grid this object is associated with.
void | Create (wxGrid *grid)
| This method can be called if the object had been constructed using the default constructor.

## Constructor & Destructor Documentation

## ◆ wxGridUpdateLocker()

wxGridUpdateLocker::wxGridUpdateLocker | ( | wxGrid * | grid = NULL | ) |

Creates an object preventing the updates of the specified grid.

The parameter could be NULL in which case nothing is done. If grid is non-NULL then the grid must exist for longer than this wxGridUpdateLocker object itself.

The default constructor could be followed by a call to Create() to set the grid object later.

## ◆ ~wxGridUpdateLocker()

wxGridUpdateLocker::~wxGridUpdateLocker | ( |  | ) |

Destructor reenables updates for the grid this object is associated with.

## Member Function Documentation

## ◆ Create()

void wxGridUpdateLocker::Create | ( | wxGrid * | grid | ) |

This method can be called if the object had been constructed using the default constructor.

It must not be called more than once.