#include </home/zeitlin/src/wx/github/interface/wx/event.h>
This class is a special event handler which allows to discard any event (or a set of event types) directed to a specific window.
例:
void MyWindow::DoSomething() { { // block all events directed to this window while // we do the 1000 FunctionWhichSendsEvents() calls wxEventBlocker blocker(this); for ( int i = 0; i 1000; i++ ) FunctionWhichSendsEvents(i); } // ~wxEventBlocker called, old event handler is restored // the event generated by this call will be processed: FunctionWhichSendsEvents(0) }
Public Member Functions | |
wxEventBlocker (wxWindow *win, wxEventType type=-1) | |
Constructs the blocker for the given window and for the given event type. | |
virtual | ~wxEventBlocker () |
Destructor. | |
void | Block (wxEventType eventType) |
Adds to the list of event types which should be blocked the given eventType. |
wxEventBlocker::wxEventBlocker | ( | wxWindow * | win, |
wxEventType | type = -1 |
||
) |
Constructs the blocker for the given window and for the given event type.
If type is wxEVT_ANY
, then all events for that window are blocked. You can call Block() after creation to add other event types to the list of events to block.
Note that the win window must remain alive until the wxEventBlocker object destruction.
virtual wxEventBlocker::~wxEventBlocker | ( | ) | [virtual] |
Destructor.
The blocker will remove itself from the chain of event handlers for the window provided in the constructor, thus restoring normal processing of events.
void wxEventBlocker::Block | ( | wxEventType | eventType | ) |
Adds to the list of event types which should be blocked the given eventType.