X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2e4df4bfaf214faac6d4c7519f4aab5b8c7fd287..fb5230de7413f1ac4aa026e8b7b492629c005f08:/src/msw/tabctrl.cpp diff --git a/src/msw/tabctrl.cpp b/src/msw/tabctrl.cpp index f4ffc5d16f..128ffff8cc 100644 --- a/src/msw/tabctrl.cpp +++ b/src/msw/tabctrl.cpp @@ -32,19 +32,20 @@ #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" #endif #include "wx/msw/dib.h" -#include "wx/msw/tabctrl.h" +#include "wx/tabctrl.h" #include "wx/app.h" #include "wx/msw/private.h" #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__