]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/listbkg.cpp
Change EnsureVisble() to including column parameter, implemented it for wxGTK
[wxWidgets.git] / src / generic / listbkg.cpp
index a898d9827682fd60dde15e6d94e42f0c0b00b859..eae7c13d3ca20aeb952ae650550c3d2911ac8426 100644 (file)
@@ -54,11 +54,10 @@ IMPLEMENT_DYNAMIC_CLASS(wxListbookEvent, wxNotifyEvent)
 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()
 
 // ============================================================================
@@ -103,7 +102,7 @@ wxListbook::Create(wxWindow *parent,
     m_bookctrl = new wxListView
                  (
                     this,
-                    wxID_LISTBOOKLISTVIEW,
+                    wxID_ANY,
                     wxDefaultPosition,
                     wxDefaultSize,
                     wxLC_ICON | wxLC_SINGLE_SEL |
@@ -330,7 +329,7 @@ wxListbook::InsertPage(size_t n,
     if (GetPageCount() == 1)
     {
         wxSizeEvent sz(GetSize(), GetId());
-        ProcessEvent(sz);
+        GetEventHandler()->ProcessEvent(sz);
     }
     return true;
 }
@@ -364,7 +363,7 @@ wxWindow *wxListbook::DoRemovePage(size_t page)
         if (GetPageCount() == 0)
         {
             wxSizeEvent sz(GetSize(), GetId());
-            ProcessEvent(sz);
+            GetEventHandler()->ProcessEvent(sz);
         }
     }
 
@@ -381,7 +380,7 @@ bool wxListbook::DeleteAllPages()
     m_selection = -1;
 
     wxSizeEvent sz(GetSize(), GetId());
-    ProcessEvent(sz);
+    GetEventHandler()->ProcessEvent(sz);
 
     return true;
 }
@@ -392,6 +391,12 @@ bool wxListbook::DeleteAllPages()
 
 void wxListbook::OnListSelected(wxListEvent& eventList)
 {
+    if ( eventList.GetEventObject() != m_bookctrl )
+    {
+        eventList.Skip();
+        return;
+    }
+
     const int selNew = eventList.GetIndex();
 
     if ( selNew == m_selection )