- HWND scroll_bar = CreateWindowEx
- (
- exStyle, TRACKBAR_CLASS, wxEmptyString,
- msStyle,
- 0, 0, 0, 0, (HWND) parent->GetHWND(), (HMENU)m_windowId,
- wxGetInstance(), NULL
- );
-
- m_rangeMax = maxValue;
- m_rangeMin = minValue;
-
- m_pageSize = (int)((maxValue-minValue)/10);
-
- ::SendMessage(scroll_bar, TBM_SETRANGE, TRUE, MAKELONG(minValue, maxValue));
- ::SendMessage(scroll_bar, TBM_SETPOS, TRUE, (LPARAM)value);
- ::SendMessage(scroll_bar, TBM_SETPAGESIZE, 0, (LPARAM)m_pageSize);
-
- m_hWnd = (WXHWND)scroll_bar;
-
- SubclassWin(GetHWND());
-
- ::SetWindowText((HWND) m_hWnd, wxEmptyString);
-
- SetFont(parent->GetFont());
-
- if ( m_windowStyle & wxSL_LABELS )
- {
- // Finally, create max value static item
- wxString maxLabel;
- maxLabel.Printf(wxT("%d"), maxValue);
- wstyle = STATIC_FLAGS;
-
- if ( m_windowStyle & wxCLIP_SIBLINGS )
- msStyle |= WS_CLIPSIBLINGS;
-
- m_staticMax = (WXHWND) CreateWindowEx
- (
- 0, wxT("STATIC"), maxLabel,
- wstyle,
- 0, 0, 0, 0, (HWND) parent->GetHWND(), (HMENU)NewControlId(),
- wxGetInstance(), NULL
- );
-
-
- if (GetFont().Ok())
- {
- if (GetFont().GetResourceHandle())
- {
- if ( m_staticMin )
- ::SendMessage((HWND) m_staticMin, WM_SETFONT,
- (WPARAM) GetFont().GetResourceHandle(), 0L);
-
- if ( m_staticMax )
- ::SendMessage((HWND) m_staticMax, WM_SETFONT,
- (WPARAM) GetFont().GetResourceHandle(), 0L);
-
- if (m_staticValue)
- ::SendMessage((HWND) m_staticValue, WM_SETFONT,
- (WPARAM) GetFont().GetResourceHandle(), 0L);
- }
- }
- }
-
- SetSize(x, y, width, height);
- SetValue(value);