]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/listbkg.cpp
reminder added
[wxWidgets.git] / src / generic / listbkg.cpp
index 0a616643e2321813194e560f19c5605f8079ac53..c4c83d0b9157463c49986f413feefae8d5f1429c 100644 (file)
@@ -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 )