const wxEventType wxEVT_COMMAND_LISTBOOK_PAGE_CHANGING = wxNewEventType();
const wxEventType wxEVT_COMMAND_LISTBOOK_PAGE_CHANGED = wxNewEventType();
#endif
-const int wxID_LISTBOOKLISTVIEW = wxNewId();
BEGIN_EVENT_TABLE(wxListbook, wxBookCtrlBase)
EVT_SIZE(wxListbook::OnSize)
- EVT_LIST_ITEM_SELECTED(wxID_LISTBOOKLISTVIEW, wxListbook::OnListSelected)
+ EVT_LIST_ITEM_SELECTED(wxID_ANY, wxListbook::OnListSelected)
END_EVENT_TABLE()
// ============================================================================
m_bookctrl = new wxListView
(
this,
- wxID_LISTBOOKLISTVIEW,
+ wxID_ANY,
wxDefaultPosition,
wxDefaultSize,
wxLC_ICON | wxLC_SINGLE_SEL |
if ( selNew != -1 )
SetSelection(selNew);
- InvalidateBestSize();
- // GetListView()->InvalidateBestSize();
GetListView()->Arrange();
if (GetPageCount() == 1)
{
wxSizeEvent sz(GetSize(), GetId());
- ProcessEvent(sz);
+ GetEventHandler()->ProcessEvent(sz);
}
return true;
}
if (GetPageCount() == 0)
{
wxSizeEvent sz(GetSize(), GetId());
- ProcessEvent(sz);
+ GetEventHandler()->ProcessEvent(sz);
}
}
m_selection = -1;
wxSizeEvent sz(GetSize(), GetId());
- ProcessEvent(sz);
+ GetEventHandler()->ProcessEvent(sz);
return true;
}
void wxListbook::OnListSelected(wxListEvent& eventList)
{
+ if ( eventList.GetEventObject() != m_bookctrl )
+ {
+ eventList.Skip();
+ return;
+ }
+
const int selNew = eventList.GetIndex();
if ( selNew == m_selection )