]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/notebook.cpp
Oops, I didn't see Robert had already corrected 16bit BMP typo
[wxWidgets.git] / src / msw / notebook.cpp
index 90e4450857fb0c6c2323aabd62c543b8014648ab..e5ff7ec7f44fb630f556a0ef1adebd192a568a91 100644 (file)
@@ -68,7 +68,8 @@
   BEGIN_EVENT_TABLE(wxNotebook, wxControl)
     EVT_NOTEBOOK_PAGE_CHANGED(-1, wxNotebook::OnSelChange)
 
-    EVT_WINDOW_CREATE(wxNotebook::OnWindowCreate)
+    // doesn't work yet EVT_WINDOW_CREATE(wxNotebook::OnWindowCreate)
+    EVT_SIZE(wxNotebook::OnWindowCreate)
 
     EVT_SET_FOCUS(wxNotebook::OnSetFocus)
 
@@ -122,10 +123,7 @@ bool wxNotebook::Create(wxWindow *parent,
                         const wxString& name)
 {
   // base init
-  SetName(name);
-  SetParent(parent);
-
-  m_windowId = id == -1 ? NewControlId() : id;
+  CreateBase(parent, id, pos, size, style, name);
 
   // colors and font
   m_backgroundColour = wxColour(GetSysColor(COLOR_BTNFACE));
@@ -145,28 +143,16 @@ bool wxNotebook::Create(wxWindow *parent,
   if (m_windowStyle & wxNB_FIXEDWIDTH)
     tabStyle |= TCS_FIXEDWIDTH ;
 
-  // create the tab control.
-  m_hWnd = (WXHWND)CreateWindowEx
-    (
-      0,                                      // extended style
-      WC_TABCONTROL,                          // class name for the tab control
-      "",                                     // no caption
-      tabStyle,                               // style
-      pos.x, pos.y, size.x, size.y,           // size and position
-      (HWND)parent->GetHWND(),                // parent window
-      (HMENU)m_windowId,                      // child id
-      wxGetInstance(),                        // current instance
-      NULL                                    // no class data
-    );
-
-  if ( m_hWnd == 0 ) {
-    wxLogSysError("Can't create the notebook control");
+  if ( !MSWCreate(GetId(), GetParent(), WC_TABCONTROL,
+                  this, NULL, pos.x, pos.y, size.x, size.y,
+                  tabStyle, NULL, 0) )
+  {
     return FALSE;
   }
 
   // Not all compilers recognise SetWindowFont
-  ::SendMessage((HWND) m_hwnd, WM_SETFONT,
-                  (WPARAM)::GetStockObject(DEFAULT_GUI_FONT),TRUE);
+  ::SendMessage(GetHwnd(), WM_SETFONT,
+                (WPARAM)::GetStockObject(DEFAULT_GUI_FONT), TRUE);
 
 
   if ( parent != NULL )