]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/notebook.cpp
Applied patch #421073 (making setup options work)
[wxWidgets.git] / src / msw / notebook.cpp
index b8ac425b2e9234a2cdada25fd631ccac2907cf1c..952ad27333a0bd584ebffe6dd45141774aad5e0b 100644 (file)
@@ -81,6 +81,9 @@
 // event table
 // ----------------------------------------------------------------------------
 
+DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED)
+DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING)
+
 BEGIN_EVENT_TABLE(wxNotebook, wxControl)
     EVT_NOTEBOOK_PAGE_CHANGED(-1, wxNotebook::OnSelChange)
 
@@ -106,6 +109,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxNotebookEvent, wxNotifyEvent)
 void wxNotebook::Init()
 {
   m_pImageList = NULL;
+  m_bOwnsImageList = FALSE;
   m_nSelection = -1;
 }
 
@@ -149,6 +153,8 @@ bool wxNotebook::Create(wxWindow *parent,
 
   long tabStyle = WS_CHILD | WS_VISIBLE | WS_TABSTOP | TCS_TABS;
 
+  if ( m_windowStyle & wxCLIP_SIBLINGS )
+    tabStyle |= WS_CLIPSIBLINGS;
   if (m_windowStyle & wxCLIP_CHILDREN)
     tabStyle |= WS_CLIPCHILDREN;
   if ( m_windowStyle & wxTC_MULTILINE )
@@ -188,6 +194,7 @@ bool wxNotebook::Create(wxWindow *parent,
 // dtor
 wxNotebook::~wxNotebook()
 {
+  if (m_bOwnsImageList) delete m_pImageList;
 }
 
 // ----------------------------------------------------------------------------
@@ -276,10 +283,18 @@ bool wxNotebook::SetPageImage(int nPage, int nImage)
 
 void wxNotebook::SetImageList(wxImageList* imageList)
 {
+  if (m_bOwnsImageList) delete m_pImageList;
   m_pImageList = imageList;
+  m_bOwnsImageList = FALSE;
   TabCtrl_SetImageList(m_hwnd, (HIMAGELIST)imageList->GetHIMAGELIST());
 }
 
+void wxNotebook::AssignImageList(wxImageList* imageList)
+{
+  SetImageList(imageList);
+  m_bOwnsImageList = TRUE;
+}
+
 // ----------------------------------------------------------------------------
 // wxNotebook size settings
 // ----------------------------------------------------------------------------