X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c59da60ade987fd1e54f4aca0fdbc6d95d0d2388..e70b4f10951f806a7b6cf7e65317a21421e2f3a6:/src/generic/listbkg.cpp diff --git a/src/generic/listbkg.cpp b/src/generic/listbkg.cpp index 0a616643e2..c4c83d0b91 100644 --- a/src/generic/listbkg.cpp +++ b/src/generic/listbkg.cpp @@ -53,11 +53,12 @@ IMPLEMENT_DYNAMIC_CLASS(wxListbookEvent, wxNotifyEvent) const wxEventType wxEVT_COMMAND_LISTBOOK_PAGE_CHANGING = wxNewEventType(); const wxEventType wxEVT_COMMAND_LISTBOOK_PAGE_CHANGED = wxNewEventType(); +const int wxID_LISTBOOKLISTVIEW = wxNewId(); BEGIN_EVENT_TABLE(wxListbook, wxBookCtrl) EVT_SIZE(wxListbook::OnSize) - EVT_LIST_ITEM_SELECTED(wxID_ANY, wxListbook::OnListSelected) + EVT_LIST_ITEM_SELECTED(wxID_LISTBOOKLISTVIEW, wxListbook::OnListSelected) END_EVENT_TABLE() // ============================================================================ @@ -99,7 +100,7 @@ wxListbook::Create(wxWindow *parent, m_list = new wxListView ( this, - -1, + wxID_LISTBOOKLISTVIEW, wxDefaultPosition, wxDefaultSize, wxLC_ICON | wxLC_SINGLE_SEL @@ -136,8 +137,8 @@ wxSize wxListbook::GetListSize() const wxRect r; m_list->GetItemRect(i, r); - wxCoord w = r.x + r.width, - h = r.y + r.height; + wxCoord w = r.width, + h = r.height; if ( w > widthMax ) widthMax = w; @@ -160,9 +161,9 @@ wxSize wxListbook::GetListSize() const } else // left/right aligned { - // +10 is due to an apparent bug in wxListCtrl::GetItemRect() but I + // +20 is due to an apparent bug in wxListCtrl::GetItemRect() but I // can't fix it there right now so just add a fudge here... - size.x = widthMax + 10; + size.x = widthMax + 20; size.y = sizeClient.y; if ( heightMax >= sizeClient.y )