// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "scrolbar.h"
#endif
IMPLEMENT_DYNAMIC_CLASS(wxScrollBar, wxControl)
+/*
+ TODO PROPERTIES
+ value (long,0)
+ thumbsize(long,1)
+ range( long , 10 )
+ pagesize( long , 1)
+*/
+
BEGIN_EVENT_TABLE(wxScrollBar, wxControl)
#if WXWIN_COMPATIBILITY
EVT_SCROLL(wxScrollBar::OnScroll)
}
bool wxScrollBar::MSWOnScroll(int WXUNUSED(orientation), WXWORD wParam,
- WXWORD pos, WXHWND control)
+ WXWORD pos, WXHWND WXUNUSED(control))
{
// current and max positions
int position,
maxPos, trackPos = pos;
-#ifdef __WIN32__
// when we're dragging the scrollbar we can't use pos parameter because it
// is limited to 16 bits
- if ( wParam == SB_THUMBPOSITION || wParam == SB_THUMBTRACK )
+ // JACS: now always using GetScrollInfo, since there's no reason
+ // not to
+// if ( wParam == SB_THUMBPOSITION || wParam == SB_THUMBTRACK )
{
SCROLLINFO scrollInfo;
wxZeroMemory(scrollInfo);
position = scrollInfo.nPos;
maxPos = scrollInfo.nMax;
}
+#if 0
else
-#endif // Win32
{
position = ::GetScrollPos((HWND) control, SB_CTL);
int minPos;
::GetScrollRange((HWND) control, SB_CTL, &minPos, &maxPos);
}
+#endif
#if defined(__WIN95__)
// A page size greater than one has the effect of reducing the effective
int wxScrollBar::GetThumbPosition(void) const
{
- return ::GetScrollPos((HWND)m_hWnd, SB_CTL);
+ SCROLLINFO scrollInfo;
+ wxZeroMemory(scrollInfo);
+ scrollInfo.cbSize = sizeof(SCROLLINFO);
+ scrollInfo.fMask = SIF_POS;
+
+ if ( !::GetScrollInfo(GetHwnd(), SB_CTL, &scrollInfo) )
+ {
+ wxLogLastError(_T("GetScrollInfo"));
+ }
+ return scrollInfo.nPos;
+// return ::GetScrollPos((HWND)m_hWnd, SB_CTL);
}
void wxScrollBar::SetScrollbar(int position, int thumbSize, int range, int pageSize,