- int x = pos.x;
- int y = pos.y;
- int width = size.x;
- int height = size.y;
-
- if (width == wxDefaultCoord)
- {
- if (style & wxHORIZONTAL)
- width = 140;
- else
- width = 14;
- }
- if (height == wxDefaultCoord)
- {
- if (style & wxVERTICAL)
- height = 140;
- else
- height = 14;
- }
-
- WXDWORD exStyle = 0;
- WXDWORD wstyle = MSWGetStyle(style, & exStyle) ;
-
- // Now create scrollbar
- DWORD _direction = (style & wxHORIZONTAL) ?
- SBS_HORZ: SBS_VERT;
- HWND scroll_bar = CreateWindowEx(exStyle, wxT("SCROLLBAR"), wxT("scrollbar"),
- _direction | wstyle,
- 0, 0, 0, 0, (HWND) parent->GetHWND(), (HMENU)m_windowId,
- wxGetInstance(), NULL);
-
- m_pageSize = 1;
- m_viewSize = 1;
- m_objectSize = 1;
-
- ::SetScrollRange(scroll_bar, SB_CTL, 0, 1, FALSE);
- ::SetScrollPos(scroll_bar, SB_CTL, 0, FALSE);
- ShowWindow(scroll_bar, SW_SHOW);
-
- m_hWnd = (WXHWND)scroll_bar;
-
- // Subclass again for purposes of dialog editing mode
- SubclassWin((WXHWND) scroll_bar);