X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5ad998f2808122841875cd3b91abbbccbe54922d..1759ff9e918d43734793c67328af21203924931f:/src/msw/notebook.cpp diff --git a/src/msw/notebook.cpp b/src/msw/notebook.cpp index cdfedb4cb3..e5ff7ec7f4 100644 --- a/src/msw/notebook.cpp +++ b/src/msw/notebook.cpp @@ -123,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)); @@ -146,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 )