X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ad81651f00edc6f489d9b6a0839d316a964fd521..69231000be8d209bb8ea1f6aaa1ff665a270e351:/src/msw/slidrmsw.cpp diff --git a/src/msw/slidrmsw.cpp b/src/msw/slidrmsw.cpp index a915542d62..2f27084534 100644 --- a/src/msw/slidrmsw.cpp +++ b/src/msw/slidrmsw.cpp @@ -52,7 +52,9 @@ bool wxSliderMSW::Create(wxWindow *parent, wxWindowID id, const wxString& name) { SetName(name); +#if wxUSE_VALIDATORS SetValidator(validator); +#endif // wxUSE_VALIDATORS if (parent) parent->AddChild(this); SetBackgroundColour(parent->GetBackgroundColour()) ; @@ -80,6 +82,9 @@ bool wxSliderMSW::Create(wxWindow *parent, wxWindowID id, long msStyle = WS_CHILD | WS_VISIBLE | WS_BORDER | SS_CENTER; + if ( m_windowStyle & wxCLIP_SIBLINGS ) + msStyle |= WS_CLIPSIBLINGS; + bool want3D; WXDWORD exStyle = Determine3DEffects(WS_EX_CLIENTEDGE, &want3D) ; @@ -90,14 +95,14 @@ bool wxSliderMSW::Create(wxWindow *parent, wxWindowID id, // Now create min static control wxSprintf(wxBuffer, wxT("%d"), minValue); + DWORD wstyle = STATIC_FLAGS; + if ( m_windowStyle & wxCLIP_SIBLINGS ) + wstyle |= WS_CLIPSIBLINGS; m_staticMin = (WXHWND) CreateWindowEx(0, wxT("STATIC"), wxBuffer, - STATIC_FLAGS, + wstyle, 0, 0, 0, 0, (HWND) parent->GetHWND(), (HMENU)NewControlId(), wxGetInstance(), NULL); - // Now create slider - m_windowId = (int)NewControlId(); - msStyle = 0; if (m_windowStyle & wxSL_VERTICAL) msStyle = SBS_VERT | WS_CHILD | WS_VISIBLE | WS_TABSTOP ; @@ -124,8 +129,11 @@ bool wxSliderMSW::Create(wxWindow *parent, wxWindowID id, // Finally, create max value static item wxSprintf(wxBuffer, wxT("%d"), maxValue); + wstyle = STATIC_FLAGS; + if ( m_windowStyle & wxCLIP_SIBLINGS ) + wstyle |= WS_CLIPSIBLINGS; m_staticMax = (WXHWND) CreateWindowEx(0, wxT("STATIC"), wxBuffer, - STATIC_FLAGS, + wstyle, 0, 0, 0, 0, (HWND) parent->GetHWND(), (HMENU)NewControlId(), wxGetInstance(), NULL); @@ -229,6 +237,7 @@ bool wxSliderMSW::MSWOnScroll(int WXUNUSED(orientation), WXWORD wParam, GetEventHandler()->ProcessEvent(event); wxCommandEvent cevent( wxEVT_COMMAND_SLIDER_UPDATED, GetId() ); + cevent.SetInt( newPos ); cevent.SetEventObject( this ); return GetEventHandler()->ProcessEvent( cevent ); @@ -324,9 +333,9 @@ void wxSliderMSW::DoSetSize(int x, int y, int width, int height, int sizeFlags) int currentX, currentY; GetPosition(¤tX, ¤tY); - if (x == -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE)) + if (x == -1 && !(sizeFlags & wxSIZE_ALLOW_MINUS_ONE)) x1 = currentX; - if (y == -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE)) + if (y == -1 && !(sizeFlags & wxSIZE_ALLOW_MINUS_ONE)) y1 = currentY; AdjustForParentClientOrigin(x1, y1, sizeFlags);