X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7798a18ec81d3733082bc60a958fac1d4510faca..eeccd5d94ce6b11f36af95db4ac528a2e2e0c4c5:/src/msw/spinbutt.cpp diff --git a/src/msw/spinbutt.cpp b/src/msw/spinbutt.cpp index db8c8dc34b..03657deaa0 100644 --- a/src/msw/spinbutt.cpp +++ b/src/msw/spinbutt.cpp @@ -21,15 +21,18 @@ #endif #ifndef WX_PRECOMP -#include "wx.h" +#include "wx/wx.h" #endif -#if defined(__WIN95__) +// Can't resolve reference to CreateUpDownControl in +// TWIN32, but could probably use normal CreateWindow instead. + +#if defined(__WIN95__) && !defined(__TWIN32__) #include "wx/spinbutt.h" #include "wx/msw/private.h" -#ifndef __GNUWIN32__ +#if !defined(__GNUWIN32__) || defined(__TWIN32__) #include #endif @@ -43,12 +46,12 @@ wxSpinButton::wxSpinButton(void) m_max = 100; } -bool wxSpinButton::Create(wxWindow *parent, const wxWindowID id, const wxPoint& pos, const wxSize& size, - const long style, const wxString& name) +bool wxSpinButton::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, + long style, const wxString& name) { wxSystemSettings settings; - m_backgroundColour = parent->GetDefaultBackgroundColour() ; - m_foregroundColour = parent->GetDefaultForegroundColour() ; + m_backgroundColour = parent->GetBackgroundColour() ; + m_foregroundColour = parent->GetForegroundColour() ; SetName(name); @@ -91,7 +94,7 @@ bool wxSpinButton::Create(wxWindow *parent, const wxWindowID id, const wxPoint& m_windowId, wxGetInstance(), 0, - m_min, m_max, 0); + m_min, m_max, m_min); m_hWnd = (WXHWND) hWndListControl; if (parent) parent->AddChild(this); @@ -117,19 +120,20 @@ int wxSpinButton::GetValue(void) const return (int) ::SendMessage((HWND) GetHWND(), UDM_GETPOS, 0, 0); } -void wxSpinButton::SetValue(const int val) +void wxSpinButton::SetValue(int val) { ::SendMessage((HWND) GetHWND(), UDM_SETPOS, 0, (LPARAM) MAKELONG((short) val, 0)); } -void wxSpinButton::SetRange(const int minVal, const int maxVal) +void wxSpinButton::SetRange(int minVal, int maxVal) { m_min = minVal; m_max = maxVal; - ::SendMessage((HWND) GetHWND(), UDM_SETRANGE, 0, (LPARAM) MAKELONG((short) minVal, (short) maxVal)); + ::SendMessage((HWND) GetHWND(), UDM_SETRANGE, 0, + (LPARAM) MAKELONG((short)maxVal, (short)minVal)); } -void wxSpinButton::MSWOnVScroll(const WXWORD wParam, const WXWORD pos, const WXHWND control) +void wxSpinButton::MSWOnVScroll(WXWORD wParam, WXWORD pos, WXHWND control) { if (control) { @@ -178,7 +182,7 @@ void wxSpinButton::MSWOnVScroll(const WXWORD wParam, const WXWORD pos, const WXH } } -void wxSpinButton::MSWOnHScroll( const WXWORD wParam, const WXWORD pos, const WXHWND control) +void wxSpinButton::MSWOnHScroll( WXWORD wParam, WXWORD pos, WXHWND control) { if (control) { @@ -227,32 +231,29 @@ void wxSpinButton::MSWOnHScroll( const WXWORD wParam, const WXWORD pos, const WX } } -bool wxSpinButton::MSWCommand(const WXUINT cmd, const WXWORD id) +bool wxSpinButton::MSWCommand(WXUINT cmd, WXWORD id) { // No command messages return FALSE; } -bool wxSpinButton::MSWNotify(const WXWPARAM wParam, const WXLPARAM lParam) +bool wxSpinButton::MSWNotify(WXWPARAM wParam, WXLPARAM lParam, WXLPARAM* result) { NMHDR* hdr1 = (NMHDR*) lParam; switch ( hdr1->code ) { -/* We don't process this message, currently */ + /* We don't process this message, currently */ case UDN_DELTAPOS: - { - return wxControl::MSWNotify(wParam, lParam); - break; - } + default : - return wxControl::MSWNotify(wParam, lParam); + return wxControl::MSWNotify(wParam, lParam, result); break; } /* event.eventObject = this; event.SetEventType(eventType); - if ( !ProcessEvent(event) ) + if ( !GetEventHandler()->ProcessEvent(event) ) return FALSE; */ return TRUE;