nameControl,
veto;
const wxEventType eventType = event.GetEventType();
+
+ // NB: can't use wxStaticCast here as wxBookCtrlBase is not in
+ // wxRTTI
+ const wxBookCtrlBase * const
+ book = static_cast<wxBookCtrlBase *>(event.GetEventObject());
+
for ( size_t n = 0; n < WXSIZEOF(events); n++ )
{
const EventInfo& ei = events[n];
{
const int idx = event.GetOldSelection();
- // NB: can't use wxStaticCast here as wxBookCtrlBase is not in
- // wxRTTI
- const wxBookCtrlBase * const
- book = static_cast<wxBookCtrlBase *>(event.GetEventObject());
if ( idx != wxNOT_FOUND &&
book && book->GetPageText(idx) == VETO_PAGE_NAME )
{
static int s_num = 0;
- wxLogMessage(wxT("Event #%d: %s: %s (%d) new sel %d, old %d%s"),
+ wxLogMessage(wxT("Event #%d: %s: %s (%d) new sel %d, old %d, current %d%s"),
++s_num,
nameControl.c_str(),
nameEvent.c_str(),
eventType,
event.GetSelection(),
event.GetOldSelection(),
+ book->GetSelection(),
veto.c_str());
#if USE_LOG
event.SetEventObject(this);
event.SetInt(idCtrl);
- bool processed = HandleWindowEvent(event);
+ // Change the selection before generating the event as its handler should
+ // already see the new page selected.
if ( hdr->code == TCN_SELCHANGE )
UpdateSelection(event.GetSelection());
+ bool processed = HandleWindowEvent(event);
*result = !event.IsAllowed();
return processed;
}