X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/851dee09b5ab50a69519a39b0f3f6b95b1a63373..d968078adbfb147e913b9a33fc54242a36f117ce:/src/msw/slider95.cpp diff --git a/src/msw/slider95.cpp b/src/msw/slider95.cpp index 2a9a690577..1ebdb425dc 100644 --- a/src/msw/slider95.cpp +++ b/src/msw/slider95.cpp @@ -27,16 +27,15 @@ #if wxUSE_SLIDER +#include "wx/slider.h" + #ifndef WX_PRECOMP + #include "wx/msw/wrapcctl.h" // include "properly" #include "wx/brush.h" #endif -#include "wx/slider.h" #include "wx/msw/subwin.h" -// include "properly" -#include "wx/msw/wrapcctl.h" - // ---------------------------------------------------------------------------- // constants // ---------------------------------------------------------------------------- @@ -209,17 +208,21 @@ wxSlider::Create(wxWindow *parent, HWND hwndParent = GetHwndOf(parent); for ( size_t n = 0; n < SliderLabel_Last; n++ ) { - (*m_labels)[n] = ::CreateWindow - ( - wxT("STATIC"), - NULL, - WS_CHILD | WS_VISIBLE | SS_CENTER, - 0, 0, 0, 0, - hwndParent, - (HMENU)NewControlId(), - wxGetInstance(), - NULL - ); + wxWindowIDRef lblid = NewControlId(); + + HWND wnd = ::CreateWindow + ( + wxT("STATIC"), + NULL, + WS_CHILD | WS_VISIBLE | SS_CENTER, + 0, 0, 0, 0, + hwndParent, + (HMENU)lblid.GetValue(), + wxGetInstance(), + NULL + ); + + m_labels->Set(n, wnd, lblid); } m_labels->SetFont(GetFont()); @@ -365,13 +368,13 @@ bool wxSlider::MSWOnScroll(int WXUNUSED(orientation), wxScrollEvent event(scrollEvent, m_windowId); event.SetPosition(newPos); event.SetEventObject( this ); - GetEventHandler()->ProcessEvent(event); + HandleWindowEvent(event); wxCommandEvent cevent( wxEVT_COMMAND_SLIDER_UPDATED, GetId() ); cevent.SetInt( newPos ); cevent.SetEventObject( this ); - return GetEventHandler()->ProcessEvent( cevent ); + return HandleWindowEvent( cevent ); } void wxSlider::Command (wxCommandEvent & event) @@ -574,7 +577,7 @@ void wxSlider::SetValue(int value) if ( m_labels ) { - ::SetWindowText((*m_labels)[SliderLabel_Value], Format(value)); + ::SetWindowText((*m_labels)[SliderLabel_Value], Format(value).wx_str()); } } @@ -588,8 +591,10 @@ void wxSlider::SetRange(int minValue, int maxValue) if ( m_labels ) { - ::SetWindowText((*m_labels)[SliderLabel_Min], Format(ValueInvertOrNot(m_rangeMin))); - ::SetWindowText((*m_labels)[SliderLabel_Max], Format(ValueInvertOrNot(m_rangeMax))); + ::SetWindowText((*m_labels)[SliderLabel_Min], + Format(ValueInvertOrNot(m_rangeMin)).wx_str()); + ::SetWindowText((*m_labels)[SliderLabel_Max], + Format(ValueInvertOrNot(m_rangeMax)).wx_str()); } }