X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ee4f8c2af9c6c5458e488db10aef7d00a89ace25..2e35f56f6d323a15d4e70d4ac0adf9a0a42cce15:/src/msw/tabctrl.cpp diff --git a/src/msw/tabctrl.cpp b/src/msw/tabctrl.cpp index df6dc39552..9537e0fbc9 100644 --- a/src/msw/tabctrl.cpp +++ b/src/msw/tabctrl.cpp @@ -21,24 +21,26 @@ #endif #ifndef WX_PRECOMP -#include "wx.h" +#include "wx/wx.h" #endif #if defined(__WIN95__) -#ifndef __GNUWIN32__ +#if !defined(__GNUWIN32__) && !defined(__SALFORDC__) #include "malloc.h" #endif #include -#ifndef __GNUWIN32__ +#if (defined(__WIN95__) && !defined(__GNUWIN32__)) || defined(__TWIN32__) #include #endif +#ifndef __TWIN32__ #ifdef __GNUWIN32__ #include "wx/msw/gnuwin32/extra.h" #endif +#endif #include "wx/msw/dib.h" #include "wx/msw/tabctrl.h" @@ -72,10 +74,6 @@ bool wxTabCtrl::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, cons GetGValue(GetSysColor(COLOR_BTNFACE)), GetBValue(GetSysColor(COLOR_BTNFACE))); m_foregroundColour = *wxBLACK ; - m_defaultForegroundColour = *wxBLACK ; - m_defaultBackgroundColour = wxColour(GetRValue(GetSysColor(COLOR_BTNFACE)), - GetGValue(GetSysColor(COLOR_BTNFACE)), GetBValue(GetSysColor(COLOR_BTNFACE))); - SetName(name); int x = pos.x; @@ -145,50 +143,42 @@ void wxTabCtrl::Command(wxCommandEvent& event) { } -bool wxTabCtrl::MSWCommand(const WXUINT cmd, const WXWORD id) +bool wxTabCtrl::MSWCommand(WXUINT cmd, WXWORD id) { return FALSE; } -bool wxTabCtrl::MSWNotify(const WXWPARAM wParam, const WXLPARAM lParam) +bool wxTabCtrl::MSWNotify(WXWPARAM wParam, WXLPARAM lParam, WXLPARAM *result) { - wxTabEvent event(0, m_windowId); - int eventType = 0; + wxTabEvent event(wxEVT_NULL, m_windowId); + wxEventType eventType = wxEVT_NULL; NMHDR* hdr1 = (NMHDR*) lParam; switch ( hdr1->code ) { case TCN_SELCHANGE: - { eventType = wxEVT_COMMAND_TAB_SEL_CHANGED; - event.SetInt( (int) LOWORD(wParam) ) ; break; - } + case TCN_SELCHANGING: - { eventType = wxEVT_COMMAND_TAB_SEL_CHANGING; - event.SetInt( (int) LOWORD(wParam) ) ; break; - } + case TTN_NEEDTEXT: { // TODO // if (tool->m_shortHelpString != "") // ttText->lpszText = (char *) (const char *)tool->m_shortHelpString; - return wxControl::MSWNotify(wParam, lParam); - break; } default : - return wxControl::MSWNotify(wParam, lParam); - break; + return wxControl::MSWNotify(wParam, lParam, result); } event.SetEventObject( this ); event.SetEventType(eventType); + event.SetInt( (int) LOWORD(wParam) ) ; - if ( !ProcessEvent(event) ) - return FALSE; - return TRUE; + return ProcessEvent(event); } // Responds to colour changes, and passes event on to children. @@ -196,8 +186,6 @@ void wxTabCtrl::OnSysColourChanged(wxSysColourChangedEvent& event) { m_backgroundColour = wxColour(GetRValue(GetSysColor(COLOR_BTNFACE)), GetGValue(GetSysColor(COLOR_BTNFACE)), GetBValue(GetSysColor(COLOR_BTNFACE))); - m_defaultBackgroundColour = wxColour(GetRValue(GetSysColor(COLOR_BTNFACE)), - GetGValue(GetSysColor(COLOR_BTNFACE)), GetBValue(GetSysColor(COLOR_BTNFACE))); // Remap the buttons // CreateTools(); @@ -228,6 +216,12 @@ int wxTabCtrl::GetSelection() const return (int) TabCtrl_GetCurSel( (HWND) GetHWND() ); } +// Get the tab with the current keyboard focus +int wxTabCtrl::GetCurFocus() const +{ + return (int) TabCtrl_GetCurFocus( (HWND) GetHWND() ); +} + // Get the associated image list wxImageList* wxTabCtrl::GetImageList() const { @@ -471,7 +465,7 @@ void wxMapBitmap(HBITMAP hBitmap, int width, int height) // Tab event IMPLEMENT_DYNAMIC_CLASS(wxTabEvent, wxCommandEvent) -wxTabEvent::wxTabEvent(WXTYPE commandType, int id): +wxTabEvent::wxTabEvent(wxEventType commandType, int id): wxCommandEvent(commandType, id) { }