wxWidgets: wxWindow::ChildrenRepositioningGuard Class Reference

| Version: 3.1.5

Loading...
Searching...
No Matches
Public Member Functions | List of all members
wxWindow::ChildrenRepositioningGuard Class Reference

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

## Detailed Description

Helper for ensuring EndRepositioningChildren() is called correctly.

This class wraps the calls to BeginRepositioningChildren() and EndRepositioningChildren() by performing the former in its constructor and the latter in its destructor if, and only if, the first call returned true. This is the simplest way to call these methods and if this class is created as a local variable, it also ensures that EndRepositioningChildren() is correctly called (or not) on scope exit, so its use instead of calling these methods manually is highly recommended.

Since
  2.9.5

## Public Member Functions
| ChildrenRepositioningGuard (wxWindow *win)
| Constructor calls wxWindow::BeginRepositioningChildren().
| ~ChildrenRepositioningGuard ()
| Destructor calls wxWindow::EndRepositioningChildren() if necessary.

## Constructor & Destructor Documentation

## ◆ ChildrenRepositioningGuard()

wxWindow::ChildrenRepositioningGuard::ChildrenRepositioningGuard | ( | wxWindow * | win | ) |
| explicit

Constructor calls wxWindow::BeginRepositioningChildren().

Parameters

  win | The window to call BeginRepositioningChildren() on. If it is NULL, nothing is done.

## ◆ ~ChildrenRepositioningGuard()

wxWindow::ChildrenRepositioningGuard::~ChildrenRepositioningGuard | ( |  | ) |

Destructor calls wxWindow::EndRepositioningChildren() if necessary.

EndRepositioningChildren() is called only if a valid window was passed to the constructor and if BeginRepositioningChildren() returned true.