Allow to leave another window enabled in wxWindowDisabler
Allow specifying another window to "skip", i.e. not to disable, in wxWindowDisabler. This is not used yet, but will be in the upcoming commit.
This commit is contained in:
@@ -732,8 +732,8 @@ public:
|
|||||||
// it doesn't do anything
|
// it doesn't do anything
|
||||||
explicit wxWindowDisabler(bool disable = true);
|
explicit wxWindowDisabler(bool disable = true);
|
||||||
|
|
||||||
// ctor disables all windows except winToSkip
|
// ctor disables all windows except the given one(s)
|
||||||
explicit wxWindowDisabler(wxWindow *winToSkip);
|
explicit wxWindowDisabler(wxWindow *winToSkip, wxWindow *winToSkip2 = NULL);
|
||||||
|
|
||||||
// dtor enables back all windows disabled by the ctor
|
// dtor enables back all windows disabled by the ctor
|
||||||
~wxWindowDisabler();
|
~wxWindowDisabler();
|
||||||
|
|||||||
@@ -97,8 +97,12 @@ public:
|
|||||||
from happening you may want to use wxFRAME_TOOL_WINDOW, if applicable,
|
from happening you may want to use wxFRAME_TOOL_WINDOW, if applicable,
|
||||||
or wxFRAME_NO_TASKBAR style when creating the window that will remain
|
or wxFRAME_NO_TASKBAR style when creating the window that will remain
|
||||||
enabled.
|
enabled.
|
||||||
|
|
||||||
|
The argument @a 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.
|
||||||
*/
|
*/
|
||||||
explicit wxWindowDisabler(wxWindow* winToSkip);
|
explicit wxWindowDisabler(wxWindow* winToSkip, wxWindow* winToSkip2 = NULL);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Reenables the windows disabled by the constructor.
|
Reenables the windows disabled by the constructor.
|
||||||
|
|||||||
@@ -1526,12 +1526,14 @@ wxWindowDisabler::wxWindowDisabler(bool disable)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
wxWindowDisabler::wxWindowDisabler(wxWindow *winToSkip)
|
wxWindowDisabler::wxWindowDisabler(wxWindow *winToSkip, wxWindow *winToSkip2)
|
||||||
{
|
{
|
||||||
m_disabled = true;
|
m_disabled = true;
|
||||||
|
|
||||||
if ( winToSkip )
|
if ( winToSkip )
|
||||||
m_windowsToSkip.push_back(winToSkip);
|
m_windowsToSkip.push_back(winToSkip);
|
||||||
|
if ( winToSkip2 )
|
||||||
|
m_windowsToSkip.push_back(winToSkip2);
|
||||||
|
|
||||||
DoDisable();
|
DoDisable();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user