# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1301439469 0 # Node ID 89dd3e442e7ea8c6e2044a14caa915bf189d7167 # Parent 9be19dbd2ff4c24f6c82d0a02f77c714cbac9b51 Implemented dw_scrollbox_get_pos() and dw_scrollbox_get_range() on Windows. diff -r 9be19dbd2ff4 -r 89dd3e442e7e win/dw.c --- a/win/dw.c Tue Mar 29 22:20:45 2011 +0000 +++ b/win/dw.c Tue Mar 29 22:57:49 2011 +0000 @@ -4580,12 +4580,44 @@ int API dw_scrollbox_get_pos( HWND handle, int orient ) { - return 0; + SCROLLINFO si; + int bar = SB_HORZ; + + if(orient == DW_VERT) + { + bar = SB_VERT; + } + + si.cbSize = sizeof(SCROLLINFO); + si.fMask = SIF_POS; + + /* Save the current scroll positions */ + if(!GetScrollInfo(handle, bar, &si)) + { + return -1; + } + return si.nPos; } int API dw_scrollbox_get_range( HWND handle, int orient ) { - return 0; + SCROLLINFO si; + int bar = SB_HORZ; + + if(orient == DW_VERT) + { + bar = SB_VERT; + } + + si.cbSize = sizeof(SCROLLINFO); + si.fMask = SIF_RANGE; + + /* Save the current scroll positions */ + if(!GetScrollInfo(handle, bar, &si)) + { + return -1; + } + return si.nMax; } /* * Create a new Group Box to be packed.