X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/cf2810aa394d47a43489d6138edf0497c389a22c..18caa1e963269d02499b327bb4e7cc2ac48fd67e:/src/msw/slider95.cpp?ds=sidebyside diff --git a/src/msw/slider95.cpp b/src/msw/slider95.cpp index 159e0ddea3..1ebdb425dc 100644 --- a/src/msw/slider95.cpp +++ b/src/msw/slider95.cpp @@ -135,7 +135,6 @@ IMPLEMENT_DYNAMIC_CLASS(wxSlider, wxControl) void wxSlider::Init() { m_labels = NULL; - m_labelIds = NULL; m_pageSize = 1; m_lineSize = 1; @@ -205,24 +204,25 @@ wxSlider::Create(wxWindow *parent, if ( m_windowStyle & wxSL_LABELS ) { m_labels = new wxSubwindows(SliderLabel_Last); - m_labelIds = new wxWindowIDRef[SliderLabel_Last]; HWND hwndParent = GetHwndOf(parent); for ( size_t n = 0; n < SliderLabel_Last; n++ ) { - m_labelIds[n] = NewControlId(); - - (*m_labels)[n] = ::CreateWindow - ( - wxT("STATIC"), - NULL, - WS_CHILD | WS_VISIBLE | SS_CENTER, - 0, 0, 0, 0, - hwndParent, - (HMENU)(wxWindowID)m_labelIds[n], - 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()); @@ -286,7 +286,6 @@ WXDWORD wxSlider::MSWGetStyle(long style, WXDWORD *exstyle) const wxSlider::~wxSlider() { delete m_labels; - delete[] m_labelIds; } // ----------------------------------------------------------------------------