wxWindowDisabler Class Reference | wxWidgets

| Version: 3.2.11

Loading...
Searching...
No Matches
Public Member Functions | List of all members
wxWindowDisabler Class Reference
Class List by Category » Miscellaneous

`#include </cygdrive/c/Users/Hamis/Cygwin-packaging/wxWidgets3.2/wxWidgets3.2-3.2.11-1.x86_64/src/wxWidgets-3.2.11/interface/wx/utils.h>`

## Detailed Description

This class disables all top level windows of the application (maybe with the exception of one of them) in its constructor and enables them back in its destructor.

This is useful when you want to indicate to the user that the application is currently busy and cannot respond to user input.

Note
  When instantiated, this affects only windows shown on the screen and not already disabled.

##

Library: wxCore
Category: Miscellaneous

See also
  wxBusyCursor

## Public Member Functions
| wxWindowDisabler (bool disable=true)
| Disables all top level windows of the applications.
| wxWindowDisabler (wxWindow *winToSkip, wxWindow *winToSkip2=NULL)
| Disables all top level windows of the applications with the exception of winToSkip if it is not NULL.
| ~wxWindowDisabler ()
| Reenables the windows disabled by the constructor.

## Constructor & Destructor Documentation

## ◆ wxWindowDisabler() [1/2]

wxWindowDisabler::wxWindowDisabler | ( | bool | disable = true | ) |
| explicit

Disables all top level windows of the applications.

If disable is `false` nothing is done. This can be convenient if the windows should be disabled depending on some condition.

Since
  2.9.0

## ◆ wxWindowDisabler() [2/2]

wxWindowDisabler::wxWindowDisabler | ( | wxWindow * | winToSkip,
|  | wxWindow * | winToSkip2 = NULL )
| explicit

Disables all top level windows of the applications with the exception of winToSkip if it is not NULL.

Notice that under MSW if winToSkip appears in the taskbar, the user will be able to close the entire application (even though its main window is disabled) by right clicking on the taskbar icon and selecting the appropriate "Close" command from the context menu. To prevent this from happening you may want to use wxFRAME_TOOL_WINDOW, if applicable, or wxFRAME_NO_TASKBAR style when creating the window that will remain enabled.

The argument winToSkip2 may be used to specify another window to leave enabled, if it is non-null. This parameter is only available since wxWidgets 3.1.7.

## ◆ ~wxWindowDisabler()

wxWindowDisabler::~wxWindowDisabler | ( |  | ) |

Reenables the windows disabled by the constructor.