void wxSlider::Init()
{
m_labels = NULL;
- m_labelIds = NULL;
m_pageSize = 1;
m_lineSize = 1;
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());
wxSlider::~wxSlider()
{
delete m_labels;
- delete[] m_labelIds;
}
// ----------------------------------------------------------------------------