#include "xscrlbar.h"

XScrollBar :: XScrollBar( HWND hwnd): XControl( hwnd )
{ ;}


XScrollBar :: XScrollBar( XWindow * owner, XRect * rec, USHORT id, ULONG style): XControl( rec, style | WS_VISIBLE, owner, "", WC_SCROLLBAR, id)
{
}

BOOL XScrollBar :: SetPos( LONG pos)
{
   return (BOOL) WinSendMsg( winhandle, SBM_SETPOS , MPFROMSHORT( pos), 0);
}


BOOL XScrollBar :: SetRange( SHORT first, SHORT last, SHORT sliderPos)
{
   return (BOOL) WinSendMsg( winhandle,  SBM_SETSCROLLBAR, MPFROMSHORT( sliderPos), MPFROM2SHORT( first, last) );
}


BOOL XScrollBar :: SetSliderSize( SHORT visible, SHORT total)
{
   return (BOOL) WinSendMsg( winhandle,  SBM_SETTHUMBSIZE, MPFROM2SHORT(visible, total), 0 );
}



