X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/186ef90c55be910263ef31cb09fe38a6ac700d1d..0ddf7c0cad6ab8c394d5e1002660a3dc983735a7:/src/msw/tabctrl.cpp?ds=sidebyside diff --git a/src/msw/tabctrl.cpp b/src/msw/tabctrl.cpp index 5b970afa46..128ffff8cc 100644 --- a/src/msw/tabctrl.cpp +++ b/src/msw/tabctrl.cpp @@ -32,7 +32,7 @@ #include -#if !(defined(__GNUWIN32_OLD__) || defined(__TWIN32__)) +#if defined(__WIN95__) && !((defined(__GNUWIN32_OLD__) || defined(__TWIN32__)) && !defined(__CYGWIN10__)) #include #else #include "wx/msw/gnuwin32/extra.h" @@ -45,6 +45,7 @@ #include "wx/msw/imaglist.h" IMPLEMENT_DYNAMIC_CLASS(wxTabCtrl, wxControl) +IMPLEMENT_DYNAMIC_CLASS(wxTabEvent, wxNotifyEvent) DEFINE_EVENT_TYPE(wxEVT_COMMAND_TAB_SEL_CHANGED) DEFINE_EVENT_TYPE(wxEVT_COMMAND_TAB_SEL_CHANGING) @@ -76,15 +77,8 @@ bool wxTabCtrl::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, cons m_windowStyle = style; - SetFont(* (wxTheFontList->FindOrCreateFont(11, wxSWISS, wxNORMAL, wxNORMAL))); - SetParent(parent); - DWORD msflags = 0; - if (style & wxBORDER) - msflags |= WS_BORDER; - msflags |= WS_CHILD | WS_VISIBLE; - if (width <= 0) width = 100; if (height <= 0) @@ -96,7 +90,7 @@ bool wxTabCtrl::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, cons m_windowId = (id < 0 ? NewControlId() : id); - long tabStyle = 0; + long tabStyle = WS_CHILD; if (m_windowStyle & wxTC_MULTILINE) tabStyle |= TCS_MULTILINE; if (m_windowStyle & wxTC_RIGHTJUSTIFY) @@ -105,6 +99,8 @@ bool wxTabCtrl::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, cons tabStyle |= TCS_FIXEDWIDTH; if (m_windowStyle & wxTC_OWNERDRAW) tabStyle |= TCS_OWNERDRAWFIXED; + if (m_windowStyle & wxBORDER) + tabStyle |= WS_BORDER; tabStyle |= TCS_TOOLTIPS; @@ -112,7 +108,7 @@ bool wxTabCtrl::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, cons HWND hWndTabCtrl = CreateWindowEx(0L, // No extended styles. WC_TABCONTROL, // Class name for the tab control wxT(""), // No default text. - WS_CHILD | WS_BORDER | WS_VISIBLE | tabStyle, // Styles and defaults. + tabStyle, // Styles and defaults. x, y, width, height, // Standard size and position. (HWND) parent->GetHWND(), // Parent window (HMENU)m_windowId, // ID. @@ -124,6 +120,8 @@ bool wxTabCtrl::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, cons SubclassWin((WXHWND) hWndTabCtrl); + SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT)); + return TRUE; } @@ -161,6 +159,7 @@ bool wxTabCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) event.SetEventObject( this ); event.SetEventType(eventType); event.SetInt(idCtrl) ; + event.SetSelection(idCtrl); return ProcessEvent(event); } @@ -442,14 +441,5 @@ void wxMapBitmap(HBITMAP hBitmap, int width, int height) } #endif -// Tab event -IMPLEMENT_DYNAMIC_CLASS(wxTabEvent, wxCommandEvent) - -wxTabEvent::wxTabEvent(wxEventType commandType, int id): - wxCommandEvent(commandType, id) -{ -} - - #endif // __WIN95__