initial commit
Signed-off-by: Peter Siegmund <mars3142@noreply.mars3142.dev>
This commit is contained in:
41
libs/wxWidgets-3.3.1/include/wx/gtk/private/eventsdisabler.h
Normal file
41
libs/wxWidgets-3.3.1/include/wx/gtk/private/eventsdisabler.h
Normal file
@@ -0,0 +1,41 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk/private/eventsdisabler.h
|
||||
// Purpose: Helper for temporarily disabling events.
|
||||
// Author: Vadim Zeitlin
|
||||
// Created: 2016-02-06
|
||||
// Copyright: (c) 2016 Vadim Zeitlin <vadim@wxwidgets.org>
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _GTK_PRIVATE_EVENTSDISABLER_H_
|
||||
#define _GTK_PRIVATE_EVENTSDISABLER_H_
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxGtkEventsDisabler: calls GTKDisableEvents() and GTKEnableEvents() in dtor.
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// Template parameter T must be a wxGTK class providing the required methods,
|
||||
// e.g. wxCheckBox, wxChoice, ...
|
||||
template <typename T>
|
||||
class wxGtkEventsDisabler
|
||||
{
|
||||
public:
|
||||
// Disable the events for the specified (non-null, having lifetime greater
|
||||
// than ours) window for the lifetime of this object.
|
||||
explicit wxGtkEventsDisabler(T* win) : m_win(win)
|
||||
{
|
||||
m_win->GTKDisableEvents();
|
||||
}
|
||||
|
||||
~wxGtkEventsDisabler()
|
||||
{
|
||||
m_win->GTKEnableEvents();
|
||||
}
|
||||
|
||||
private:
|
||||
T* const m_win;
|
||||
|
||||
wxDECLARE_NO_COPY_TEMPLATE_CLASS(wxGtkEventsDisabler, T);
|
||||
};
|
||||
|
||||
#endif // _GTK_PRIVATE_EVENTSDISABLER_H_
|
||||
Reference in New Issue
Block a user