m_defaultBackgroundColour = wxColour(GetSysColor(COLOR_BTNFACE));
// style
- m_windowStyle = style;
+ m_windowStyle = style | wxTAB_TRAVERSAL;
long tabStyle = WS_CHILD | WS_VISIBLE | WS_TABSTOP | TCS_TABS;
if ( m_windowStyle & wxTC_MULTILINE )
return FALSE;
}
- // @@@ this crashes the application with "Invalid instruction" exception
- // deep inside Windows -- why???
- SetWindowFont((HWND)m_hwnd, ::GetStockObject(DEFAULT_GUI_FONT), 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);
+
if ( parent != NULL )
parent->AddChild(this);
GetSize((int *)&rc.right, (int *)&rc.bottom);
TabCtrl_AdjustRect(m_hwnd, FALSE, &rc);
- uint nCount = m_aPages.Count();
- for ( uint nPage = 0; nPage < nCount; nPage++ ) {
+ size_t nCount = m_aPages.Count();
+ for ( size_t nPage = 0; nPage < nCount; nPage++ ) {
wxNotebookPage *pPage = m_aPages[nPage];
pPage->SetSize(rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top);
if ( pPage->GetAutoLayout() )
bool wxNotebook::MSWNotify(WXWPARAM wParam, WXLPARAM lParam)
{
- wxNotebookEvent event(wxEVT_NULL, m_windowId,
- TabCtrl_GetCurSel(m_hwnd), m_nSelection);
+ wxNotebookEvent event(wxEVT_NULL, m_windowId);
NMHDR* hdr = (NMHDR *)lParam;
switch ( hdr->code ) {
event.SetEventType(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING);
break;
- // if we don't intercept it here this message is passed to our parent (if
- // we have one) and then lost in it's DefWindowProc
+ // prevent this msg from being passed to wxControl::MSWNotify which would
+ // retrun FALSE disabling the change of page
case UDN_DELTAPOS:
- MSWDefWindowProc(WM_NOTIFY, wParam, lParam);
return TRUE;
default :
return wxControl::MSWNotify(wParam, lParam);
}
+ event.SetSelection(TabCtrl_GetCurSel(m_hwnd));
+ event.SetOldSelection(m_nSelection);
event.SetEventObject(this);
event.SetInt(LOWORD(wParam));