- // base init
- SetName(name);
- SetParent(parent);
-
- m_windowId = id == -1 ? NewControlId() : id;
-
- // colors and font
- m_backgroundColour = wxColour(GetSysColor(COLOR_BTNFACE));
- m_foregroundColour = *wxBLACK ;
-
- // style
- m_windowStyle = style | wxTAB_TRAVERSAL;
-
- long tabStyle = WS_CHILD | WS_VISIBLE | WS_TABSTOP | TCS_TABS;
-
- if (m_windowStyle & wxCLIP_CHILDREN)
- tabStyle |= WS_CLIPCHILDREN;
- if ( m_windowStyle & wxTC_MULTILINE )
- tabStyle |= TCS_MULTILINE;
- if ( m_windowStyle & wxBORDER )
- tabStyle &= WS_BORDER;
- 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");
- return FALSE;
- }
-
- // Not all compilers recognise SetWindowFont
-// SetWindowFont((HWND)m_hwnd, ::GetStockObject(DEFAULT_GUI_FONT), FALSE);
- ::SendMessage((HWND) m_hwnd, WM_SETFONT,
- (WPARAM)::GetStockObject(DEFAULT_GUI_FONT),TRUE);