Index: trunk/src/user32/Makefile
===================================================================
--- trunk/src/user32/Makefile	(revision 1055)
+++ trunk/src/user32/Makefile	(revision 1057)
@@ -1,3 +1,3 @@
-# $Id: Makefile,v 1.21 1999-09-23 10:33:59 sandervl Exp $
+# $Id: Makefile,v 1.22 1999-09-26 10:09:59 sandervl Exp $
 
 #
@@ -33,5 +33,5 @@
         combo.obj edit.obj clipboard.obj winicon.obj win32wmdiclient.obj \
         oslibutil.obj oslibmsg.obj dib.obj oslibdos.obj win32wmdichild.obj \
-        winprop.obj wingdi.obj oslibgdi.obj winaccel.obj winscrollbar.obj \
+        winprop.obj wingdi.obj oslibgdi.obj winaccel.obj \
         nativerc.obj oslibres.obj dummy.obj oslibmenu.obj dc.obj\
         windlgmsg.obj windlg.obj win32wdesktop.obj
@@ -82,5 +82,5 @@
 button.obj: button.cpp $(PDWIN32_INCLUDE)\win\button.h
 static.obj: static.cpp $(PDWIN32_INCLUDE)\win\static.h
-scroll.obj: scroll.cpp $(PDWIN32_INCLUDE)\win\scroll.h
+scroll.obj: scroll.cpp $(PDWIN32_INCLUDE)\win\scroll.h win32wbase.h
 listbox.obj: listbox.cpp $(PDWIN32_INCLUDE)\win\combo.h
 combo.obj: combo.cpp $(PDWIN32_INCLUDE)\win\combo.h
@@ -97,5 +97,4 @@
 windowword.obj:  windowword.cpp win32class.h win32wbase.h win32dlg.h win32wndchild.h
 winaccel.obj:     winaccel.cpp  $(PDWIN32_INCLUDE)\winres.h win32wbase.h
-winscrollbar.obj: winscrollbar.cpp win32wbase.h
 winicon.obj:    winicon.cpp $(PDWIN32_INCLUDE)\winicon.h win32wbase.h
 windlg.obj:    windlg.cpp win32wbase.h win32dlg.h
Index: trunk/src/user32/dc.cpp
===================================================================
--- trunk/src/user32/dc.cpp	(revision 1055)
+++ trunk/src/user32/dc.cpp	(revision 1057)
@@ -1,3 +1,3 @@
-/* $Id: dc.cpp,v 1.4 1999-09-25 14:15:36 sandervl Exp $ */
+/* $Id: dc.cpp,v 1.5 1999-09-26 10:09:58 sandervl Exp $ */
 
 /*
@@ -1287,6 +1287,66 @@
    return (result);
 }
-
 //******************************************************************************
 //******************************************************************************
-
+BOOL WIN32API ScrollWindow(HWND hwnd, int dx, int dy, const RECT *pScroll, const RECT *pClip)
+{
+ Win32BaseWindow *window;
+ APIRET  rc;
+ RECTL   clientRect;
+ RECTL   scrollRect;
+ RECTL   clipRect;
+ PRECTL  pScrollRect = NULL;
+ PRECTL  pClipRect   = NULL;
+ ULONG   scrollFlags = 0;
+
+    window = Win32BaseWindow::GetWindowFromHandle(hwnd);
+    if(!window) {
+        dprintf(("ScrollWindow, window %x not found", hwnd));
+        return 0;
+    }
+    dprintf(("ScrollWindow %x %d %d\n", hwnd, dx, dy));
+    MapWin32ToOS2Rectl(window->getClientRect(), (PRECTLOS2)&clientRect);
+    if(pScroll) {
+    	 MapWin32ToOS2Rectl((RECT *)pScroll, (PRECTLOS2)&scrollRect);
+	 pScrollRect = &scrollRect;
+
+	 //Scroll rectangle relative to client area
+         pScrollRect->xLeft   += clientRect.xLeft;
+         pScrollRect->xRight  += clientRect.xLeft;
+         pScrollRect->yTop    += clientRect.yBottom;
+         pScrollRect->yBottom += clientRect.yBottom;
+         WinIntersectRect ((HAB) 0, pScrollRect, pScrollRect, &clientRect);
+    }
+    else scrollFlags |= SW_SCROLLCHILDREN;
+
+    if(pClip) {
+    	 MapWin32ToOS2Rectl((RECT *)pClip, (PRECTLOS2)&clipRect);
+	 pClipRect = &clipRect;
+
+	 //Clip rectangle relative to client area
+         pClipRect->xLeft     += clientRect.xLeft;
+         pClipRect->xRight    += clientRect.xLeft;
+         pClipRect->yTop      += clientRect.yBottom;
+         pClipRect->yBottom   += clientRect.yBottom;
+         WinIntersectRect ((HAB) 0, pClipRect, pClipRect, &clientRect);
+    }
+
+    dy = -dy; //always correct?
+
+    rc = WinScrollWindow(window->getOS2WindowHandle(), dx, dy,
+                         pScrollRect, pClipRect, NULLHANDLE,
+                         NULL, scrollFlags);
+
+    return (rc != RGN_ERROR);
+}
+//******************************************************************************
+//TODO: Implement this one
+//******************************************************************************
+INT WIN32API ScrollWindowEx(HWND hwnd, int dx, int dy, const RECT *pScroll, const RECT *pClip, 
+                            HRGN hrgnUpdate, PRECT pRectUpdate, UINT scrollFlag)
+{
+    dprintf(("USER32:  ScrollWindowEx NOT CORRECTLY IMPLEMENTED\n"));
+    return ScrollWindow(hwnd, dx, dy, pScroll, pClip);
+}
+//******************************************************************************
+//******************************************************************************
Index: trunk/src/user32/oslibgdi.cpp
===================================================================
--- trunk/src/user32/oslibgdi.cpp	(revision 1055)
+++ trunk/src/user32/oslibgdi.cpp	(revision 1057)
@@ -1,3 +1,3 @@
-/* $Id: oslibgdi.cpp,v 1.1 1999-09-15 23:18:53 sandervl Exp $ */
+/* $Id: oslibgdi.cpp,v 1.2 1999-09-26 10:09:59 sandervl Exp $ */
 /*
  * Window GDI wrapper functions for OS/2
@@ -127,5 +127,5 @@
 BOOL MapWin32ToOS2Rectl(PRECT rectWin32, PRECTLOS2 rectOS2)
 {
- ULONG length = rectWin32->top - rectWin32->bottom;
+ ULONG length = rectWin32->bottom - rectWin32->top;
 
     rectOS2->yBottom = length - rectWin32->bottom;
Index: trunk/src/user32/oslibwin.cpp
===================================================================
--- trunk/src/user32/oslibwin.cpp	(revision 1055)
+++ trunk/src/user32/oslibwin.cpp	(revision 1057)
@@ -1,3 +1,3 @@
-/* $Id: oslibwin.cpp,v 1.8 1999-09-25 19:11:18 sandervl Exp $ */
+/* $Id: oslibwin.cpp,v 1.9 1999-09-26 10:09:59 sandervl Exp $ */
 /*
  * Window API wrappers for OS/2
@@ -138,4 +138,5 @@
     if(dwStyle & WS_HSCROLL_W)
           *OSFrameStyle |= FCF_HORZSCROLL;
+
     if(dwStyle & WS_SYSMENU_W)
           *OSFrameStyle |= FCF_SYSMENU;
@@ -676,2 +677,68 @@
 //******************************************************************************
 //******************************************************************************
+BOOL OSLibWinEnableScrollBar(HWND hwndParent, int scrollBar, BOOL fEnable)
+{
+ HWND hwndScroll;
+
+   if(scrollBar == OSLIB_VSCROLL) {
+	hwndScroll = WinWindowFromID(hwndParent, FID_VERTSCROLL);
+   }
+   else hwndScroll = WinWindowFromID(hwndParent, FID_HORZSCROLL);
+
+   if(hwndScroll == NULL)
+	return FALSE;
+
+   return WinEnableWindow(hwndScroll, fEnable);
+}
+//******************************************************************************
+//******************************************************************************
+BOOL OSLibWinShowScrollBar(HWND hwndParent, int scrollBar, BOOL fShow)
+{
+ HWND hwndScroll;
+
+   if(scrollBar == OSLIB_VSCROLL) {
+	hwndScroll = WinWindowFromID(hwndParent, FID_VERTSCROLL);
+   }
+   else hwndScroll = WinWindowFromID(hwndParent, FID_HORZSCROLL);
+
+   if(hwndScroll == NULL)
+	return FALSE;
+
+   if(fShow != WinIsWindowVisible(hwndScroll)) {
+	WinShowWindow(hwndScroll, fShow);
+   }
+   return TRUE;   
+}
+//******************************************************************************
+//******************************************************************************
+void OSLibTranslateScrollCmdAndMsg(ULONG *msg, ULONG *scrollcmd)
+{
+    switch(*scrollcmd)
+    {
+        case SB_LINEUP:
+               *scrollcmd = SB_LINEUP_W;
+               break;
+        case SB_LINEDOWN:
+               *scrollcmd = SB_LINEDOWN_W;
+               break;
+        case SB_PAGEUP:
+               *scrollcmd = SB_PAGEUP_W;
+               break;
+        case SB_PAGEDOWN:
+               *scrollcmd = SB_PAGEDOWN_W;
+               break;
+        case SB_SLIDERTRACK:
+               *scrollcmd = SB_THUMBTRACK_W;
+               break;
+        case SB_SLIDERPOSITION:
+               *scrollcmd = SB_THUMBPOSITION_W;
+               break;
+        case SB_ENDSCROLL:
+               *scrollcmd = SB_ENDSCROLL_W;
+               break;
+    }
+    *msg = (*msg == WM_HSCROLL) ? WM_HSCROLL_W : WM_VSCROLL_W;
+    return;
+}
+//******************************************************************************
+//******************************************************************************
Index: trunk/src/user32/oslibwin.h
===================================================================
--- trunk/src/user32/oslibwin.h	(revision 1055)
+++ trunk/src/user32/oslibwin.h	(revision 1057)
@@ -1,3 +1,3 @@
-/* $Id: oslibwin.h,v 1.4 1999-09-25 09:27:07 dengert Exp $ */
+/* $Id: oslibwin.h,v 1.5 1999-09-26 10:09:59 sandervl Exp $ */
 /*
  * Window API wrappers for OS/2
@@ -242,3 +242,9 @@
 BOOL  OSLibWinMapWindowPoints (HWND hwndFrom, HWND hwndTo, OSLIBPOINT *pptl, ULONG num);
 
+#define OSLIB_HSCROLL 	0
+#define OSLIB_VSCROLL	1
+BOOL  OSLibWinEnableScrollBar(HWND hwndParent, int scrollBar, BOOL fEnable);
+BOOL  OSLibWinShowScrollBar(HWND hwndParent, int scrollBar, BOOL fShow);
+void  OSLibTranslateScrollCmdAndMsg(ULONG *msg, ULONG *scrollcmd);
+
 #endif //__OSLIBWIN_H__
Index: trunk/src/user32/pmwindow.cpp
===================================================================
--- trunk/src/user32/pmwindow.cpp	(revision 1055)
+++ trunk/src/user32/pmwindow.cpp	(revision 1057)
@@ -1,3 +1,3 @@
-/* $Id: pmwindow.cpp,v 1.8 1999-09-25 17:34:36 sandervl Exp $ */
+/* $Id: pmwindow.cpp,v 1.9 1999-09-26 10:09:59 sandervl Exp $ */
 /*
  * Win32 Window Managment Code for OS/2
@@ -482,4 +482,18 @@
     case WM_VSCROLL:
     case WM_HSCROLL:
+    {
+     ULONG scrollPos, scrollCode, scrollMsg;
+
+	scrollCode = SHORT2FROMMP(mp2);
+	scrollPos  = SHORT1FROMMP(mp2);
+	scrollMsg  = msg;
+
+	OSLibTranslateScrollCmdAndMsg(&scrollMsg, &scrollCode);
+
+        if(win32wnd->MsgScroll(scrollMsg, scrollCode, scrollPos)) {
+            goto RunDefWndProc;
+        }
+	break;
+    }
 
     case WM_CONTROL:
Index: trunk/src/user32/scroll.cpp
===================================================================
--- trunk/src/user32/scroll.cpp	(revision 1055)
+++ trunk/src/user32/scroll.cpp	(revision 1057)
@@ -1,3 +1,3 @@
-/* $Id: scroll.cpp,v 1.1 1999-09-15 23:18:55 sandervl Exp $ */
+/* $Id: scroll.cpp,v 1.2 1999-09-26 10:10:00 sandervl Exp $ */
 /*
  * Scrollbar control
@@ -17,8 +17,9 @@
 
 #include <stdlib.h>
-#include "winuser.h"
-#include "winbase.h"
+#include <os2win.h>
 #include "controls.h"
 #include "scroll.h"
+#include "win32wbase.h"
+#include "oslibwin.h"
 
 static HBITMAP hUpArrow = 0;
@@ -98,8 +99,8 @@
                                    const SCROLLINFO *info, INT *action );
 static void SCROLL_DrawInterior_9x( HWND hwnd, HDC hdc, INT nBar,
-				    RECT *rect, INT arrowSize,
-				    INT thumbSize, INT thumbPos,
-				    UINT flags, BOOL vertical,
-				    BOOL top_selected, BOOL bottom_selected );
+                    RECT *rect, INT arrowSize,
+                    INT thumbSize, INT thumbPos,
+                    UINT flags, BOOL vertical,
+                    BOOL top_selected, BOOL bottom_selected );
 
 /***********************************************************************
@@ -402,7 +403,7 @@
 
   DrawFrameControl( hdc, &r, DFC_SCROLL,
-		    (vertical ? DFCS_SCROLLUP : DFCS_SCROLLLEFT)
-		    | (top_pressed ? (DFCS_PUSHED | DFCS_FLAT) : 0 )
-		    | (infoPtr->flags&ESB_DISABLE_LTUP ? DFCS_INACTIVE : 0 ) );
+            (vertical ? DFCS_SCROLLUP : DFCS_SCROLLLEFT)
+            | (top_pressed ? (DFCS_PUSHED | DFCS_FLAT) : 0 )
+            | (infoPtr->flags&ESB_DISABLE_LTUP ? DFCS_INACTIVE : 0 ) );
 
   r = *rect;
@@ -413,12 +414,13 @@
 
   DrawFrameControl( hdc, &r, DFC_SCROLL,
-		    (vertical ? DFCS_SCROLLDOWN : DFCS_SCROLLRIGHT)
-		    | (bottom_pressed ? (DFCS_PUSHED | DFCS_FLAT) : 0 )
-		    | (infoPtr->flags&ESB_DISABLE_RTDN ? DFCS_INACTIVE : 0) );
-}
-
+            (vertical ? DFCS_SCROLLDOWN : DFCS_SCROLLRIGHT)
+            | (bottom_pressed ? (DFCS_PUSHED | DFCS_FLAT) : 0 )
+            | (infoPtr->flags&ESB_DISABLE_RTDN ? DFCS_INACTIVE : 0) );
+}
+//******************************************************************************
+//******************************************************************************
 static void SCROLL_DrawArrows( HDC hdc, SCROLLBAR_INFO *infoPtr,
-			       RECT *rect, INT arrowSize, BOOL vertical,
-			       BOOL top_pressed, BOOL bottom_pressed )
+                   RECT *rect, INT arrowSize, BOOL vertical,
+                   BOOL top_pressed, BOOL bottom_pressed )
 {
   SCROLL_DrawArrows_9x( hdc, infoPtr, rect, arrowSize,
@@ -433,5 +435,5 @@
  */
 static void SCROLL_DrawMovingThumb_9x( HDC hdc, RECT *rect, BOOL vertical,
-				       INT arrowSize, INT thumbSize )
+                       INT arrowSize, INT thumbSize )
 {
   INT pos = SCROLL_TrackingPos;
@@ -451,16 +453,16 @@
 
   SCROLL_DrawInterior_9x( SCROLL_TrackingWin, hdc, SCROLL_TrackingBar,
-			  rect, arrowSize, thumbSize, pos,
-			  0, vertical, FALSE, FALSE );
-			
+              rect, arrowSize, thumbSize, pos,
+              0, vertical, FALSE, FALSE );
+
   SCROLL_MovingThumb = !SCROLL_MovingThumb;
 }
-
+//******************************************************************************
+//******************************************************************************
 static void SCROLL_DrawMovingThumb( HDC hdc, RECT *rect, BOOL vertical,
-				    INT arrowSize, INT thumbSize )
+                    INT arrowSize, INT thumbSize )
 {
   SCROLL_DrawMovingThumb_9x( hdc, rect, vertical, arrowSize, thumbSize );
 }
-
 /***********************************************************************
  *           SCROLL_DrawInterior
@@ -469,8 +471,8 @@
  */
 static void SCROLL_DrawInterior_9x( HWND hwnd, HDC hdc, INT nBar,
-				    RECT *rect, INT arrowSize,
-				    INT thumbSize, INT thumbPos,
-				    UINT flags, BOOL vertical,
-				    BOOL top_selected, BOOL bottom_selected )
+                    RECT *rect, INT arrowSize,
+                    INT thumbSize, INT thumbPos,
+                    UINT flags, BOOL vertical,
+                    BOOL top_selected, BOOL bottom_selected )
 {
     RECT r;
@@ -485,5 +487,5 @@
     {
       hBrush = (HBRUSH)SendMessageA( GetParent(hwnd), WM_CTLCOLORSCROLLBAR,
-				     (WPARAM)hdc,(LPARAM)hwnd);
+                     (WPARAM)hdc,(LPARAM)hwnd);
     }
     else
@@ -556,6 +558,6 @@
     SelectObject( hdc, hSaveBrush );
 }
-
-
+//******************************************************************************
+//******************************************************************************
 static void SCROLL_DrawInterior( HWND hwnd, HDC hdc, INT nBar,
                                  RECT *rect, INT arrowSize,
@@ -607,5 +609,5 @@
       /* Draw the scroll bar frame */
 
-	/* Only draw outline if Win 3.1.  Mar 24, 1999 - Ronald B. Cemer */
+    /* Only draw outline if Win 3.1.  Mar 24, 1999 - Ronald B. Cemer */
 
       /* Draw the scroll rectangles and thumb */
@@ -673,5 +675,4 @@
     SelectObject( hdc, hSaveBrush );
 }
-
 /***********************************************************************
  *           SCROLL_DrawScrollBar
@@ -724,6 +725,4 @@
 
 }
-
-
 /***********************************************************************
  *           SCROLL_RefreshScrollBar
@@ -742,6 +741,4 @@
     ReleaseDC( hwnd, hdc );
 }
-
-
 /***********************************************************************
  *           SCROLL_HandleKbdEvent
@@ -769,6 +766,4 @@
                     msg, hwnd );
 }
-
-
 /***********************************************************************
  *           SCROLL_HandleScrollEvent
@@ -985,6 +980,4 @@
     ReleaseDC( hwnd, hdc );
 }
-
-
 /***********************************************************************
  *           ScrollBarWndProc
@@ -1124,11 +1117,9 @@
  *  the text), and info->nPage=25.
  */
-/* CB:
-
 INT WINAPI SetScrollInfo(
-HWND hwnd / * [I] Handle of window whose scrollbar will be affected * /,
-INT nBar / * [I] One of SB_HORZ, SB_VERT, or SB_CTL * /,
-const SCROLLINFO *info / * [I] Specifies what to change and new values * /,
-BOOL bRedraw / * [I] Should scrollbar be redrawn afterwards ? * /)
+                HWND hwnd /* [I] Handle of window whose scrollbar will be affected */,
+                INT nBar /* [I] One of SB_HORZ, SB_VERT, or SB_CTL */,
+                const SCROLLINFO *info /* [I] Specifies what to change and new values */,
+                BOOL bRedraw /* [I] Should scrollbar be redrawn afterwards ? */)
 {
     INT action;
@@ -1141,5 +1132,5 @@
         if( action & SA_SSI_SHOW )
             if( SCROLL_ShowScrollBar( hwnd, nBar, TRUE, TRUE ) )
-                return retVal; / * SetWindowPos() already did the painting * /
+                return retVal; /* SetWindowPos() already did the painting */
 
         if( bRedraw && (action & SA_SSI_REFRESH))
@@ -1149,6 +1140,7 @@
     }
     return retVal;
-} */
-
+}
+//******************************************************************************
+//******************************************************************************
 INT SCROLL_SetScrollInfo( HWND hwnd, INT nBar,
                             const SCROLLINFO *info, INT *action  )
@@ -1276,6 +1268,4 @@
     return infoPtr->CurVal;
 }
-
-
 /*************************************************************************
  *           GetScrollInfo32   (USER32.284)
@@ -1285,9 +1275,8 @@
  * RETURNS STD
  */
-/* CB:
 BOOL WINAPI GetScrollInfo(
-  HWND hwnd / * [I] Handle of window * / ,
-  INT nBar / * [I] One of SB_HORZ, SB_VERT, or SB_CTL * /,
-  LPSCROLLINFO info / * [IO] (info.fMask [I] specifies which values are to retrieve) * /)
+                HWND hwnd /* [I] Handle of window */ ,
+                INT nBar /* [I] One of SB_HORZ, SB_VERT, or SB_CTL */,
+                LPSCROLLINFO info /* [IO] (info.fMask [I] specifies which values are to retrieve) */)
 {
     SCROLLBAR_INFO *infoPtr;
@@ -1308,7 +1297,5 @@
     }
     return (info->fMask & SIF_ALL) != 0;
-} */
-
-
+}
 /*************************************************************************
  *           SetScrollPos32   (USER32.502)
@@ -1322,10 +1309,9 @@
  *    to make sure there was an error (and to know which one).
  */
-/* CB:
 INT WINAPI SetScrollPos(
-HWND hwnd / * [I] Handle of window whose scrollbar will be affected * /,
-INT nBar / * [I] One of SB_HORZ, SB_VERT, or SB_CTL * /,
-INT nPos / * [I] New value * /,
-BOOL bRedraw / * [I] Should scrollbar be redrawn afterwards ? * / )
+                HWND hwnd /* [I] Handle of window whose scrollbar will be affected */,
+                INT nBar /* [I] One of SB_HORZ, SB_VERT, or SB_CTL */,
+                INT nPos /* [I] New value */,
+                BOOL bRedraw /* [I] Should scrollbar be redrawn afterwards ? */ )
 {
     SCROLLINFO info;
@@ -1340,7 +1326,5 @@
     SetScrollInfo( hwnd, nBar, &info, bRedraw );
     return oldPos;
-} */
-
-
+}
 /*************************************************************************
  *           GetScrollPos32   (USER32.285)
@@ -1354,8 +1338,7 @@
  *    to make sure there was an error (and to know which one).
  */
-/* CB:
 INT WINAPI GetScrollPos(
-HWND hwnd, / * [I] Handle of window * /
-INT nBar / * [I] One of SB_HORZ, SB_VERT, or SB_CTL * /)
+                HWND hwnd, /* [I] Handle of window */
+                INT nBar /* [I] One of SB_HORZ, SB_VERT, or SB_CTL */)
 {
     SCROLLBAR_INFO *infoPtr;
@@ -1363,7 +1346,5 @@
     if (!(infoPtr = SCROLL_GetScrollInfo( hwnd, nBar ))) return 0;
     return infoPtr->CurVal;
-} */
-
-
+}
 /*************************************************************************
  *           SetScrollRange32   (USER32.503)
@@ -1371,11 +1352,10 @@
  * RETURNS STD
  */
-/* CB:
 BOOL WINAPI SetScrollRange(
-HWND hwnd, / * [I] Handle of window whose scrollbar will be affected * /
-INT nBar, / * [I] One of SB_HORZ, SB_VERT, or SB_CTL * /
-INT MinVal, / * [I] New minimum value * /
-INT MaxVal, / * [I] New maximum value * /
-BOOL bRedraw / * [I] Should scrollbar be redrawn afterwards ? * /)
+                HWND hwnd,   /* [I] Handle of window whose scrollbar will be affected */
+                INT nBar,    /* [I] One of SB_HORZ, SB_VERT, or SB_CTL */
+                INT MinVal,  /* [I] New minimum value */
+                INT MaxVal,  /* [I] New maximum value */
+                BOOL bRedraw /* [I] Should scrollbar be redrawn afterwards ? */)
 {
     SCROLLINFO info;
@@ -1387,7 +1367,5 @@
     SetScrollInfo( hwnd, nBar, &info, bRedraw );
     return TRUE;
-} */
-
-
+}
 /*************************************************************************
  *           SCROLL_SetNCSbState
@@ -1429,10 +1407,9 @@
  * RETURNS STD
  */
-/* CB:
 BOOL WINAPI GetScrollRange(
-HWND hwnd, / * [I] Handle of window * /
-INT nBar, / * [I] One of SB_HORZ, SB_VERT, or SB_CTL  * /
-LPINT lpMin, / * [O] Where to store minimum value * /
-LPINT lpMax / * [O] Where to store maximum value * /)
+                HWND hwnd,   /* [I] Handle of window */
+                INT nBar,    /* [I] One of SB_HORZ, SB_VERT, or SB_CTL  */
+                LPINT lpMin, /* [O] Where to store minimum value */
+                LPINT lpMax  /* [O] Where to store maximum value */)
 {
     SCROLLBAR_INFO *infoPtr;
@@ -1447,7 +1424,5 @@
     if (lpMax) *lpMax = infoPtr->MaxVal;
     return TRUE;
-}*/
-
-
+}
 /*************************************************************************
  *           SCROLL_ShowScrollBar()
@@ -1456,6 +1431,6 @@
  * NOTE: fShowV/fShowH must be zero when nBar is SB_HORZ/SB_VERT.
  */
-BOOL SCROLL_ShowScrollBar( HWND hwnd, INT nBar,
-                             BOOL fShowH, BOOL fShowV )
+BOOL SCROLL_ShowScrollBar(HWND hwnd, INT nBar,
+                          BOOL fShowH, BOOL fShowV )
 {
     BOOL retvalue = FALSE;
@@ -1531,27 +1506,79 @@
  * RETURNS STD
  */
-/* CB:
 BOOL WINAPI ShowScrollBar(
-HWND hwnd, / * [I] Handle of window whose scrollbar(s) will be affected   * /
-INT nBar, / * [I] One of SB_HORZ, SB_VERT, SB_BOTH or SB_CTL * /
-BOOL fShow / * [I] TRUE = show, FALSE = hide  * /)
-{
+                    HWND hwnd,  /* [I] Handle of window whose scrollbar(s) will be affected   */
+                    INT nBar,   /* [I] One of SB_HORZ, SB_VERT, SB_BOTH or SB_CTL */
+                    BOOL fShow  /* [I] TRUE = show, FALSE = hide  */)
+{
+  Win32BaseWindow *window;
+
+    dprintf(("ShowScrollBar %04x %d %d\n", hwnd, nBar, fShow));
+
+    window = Win32BaseWindow::GetWindowFromHandle(hwnd);
+    if(!window) {
+        dprintf(("ShowScrollBar window not found!"));
+        SetLastError(ERROR_INVALID_HANDLE);
+        return 0;
+    }
+    if(nBar != SB_CTL || (window->getStyle() & (WM_HSCROLL|WM_VSCROLL) != 0))
+    {
+     BOOL rc;
+
+        if(nBar == SB_HORZ || nBar == SB_BOTH)
+            rc = OSLibWinShowScrollBar(window->getOS2FrameWindowHandle(), OSLIB_HSCROLL, fShow);
+
+        if(nBar == SB_VERT || ( rc == TRUE && nBar == SB_BOTH))
+            rc = OSLibWinShowScrollBar(window->getOS2FrameWindowHandle(), OSLIB_VSCROLL, fShow);
+
+        return rc;
+    }
+
     SCROLL_ShowScrollBar( hwnd, nBar, (nBar == SB_VERT) ? 0 : fShow,
                                       (nBar == SB_HORZ) ? 0 : fShow );
     return TRUE;
-}*/
-
-
+}
 /*************************************************************************
  *           EnableScrollBar32   (USER32.171)
  */
-/* CB_
-BOOL WINAPI EnableScrollBar( HWND hwnd, INT nBar, UINT flags )
-{
-    BOOL bFineWithMe;
-    SCROLLBAR_INFO *infoPtr;
-
-    //TRACE("%04x %d %d\n", hwnd, nBar, flags );
-
+BOOL WINAPI EnableScrollBar( HWND hwnd, INT nBar, UINT flags)
+{
+  Win32BaseWindow *window;
+  BOOL bFineWithMe;
+  SCROLLBAR_INFO *infoPtr;
+
+    dprintf(("EnableScrollBar %04x %d %d\n", hwnd, nBar, flags));
+
+    window = Win32BaseWindow::GetWindowFromHandle(hwnd);
+    if(!window) {
+        dprintf(("EnableScrollBar window not found!"));
+        SetLastError(ERROR_INVALID_HANDLE);
+        return 0;
+    }
+    if(nBar != SB_CTL || (window->getStyle() & (WM_HSCROLL|WM_VSCROLL) != 0))
+    {
+     BOOL fEnable, rc;
+
+        //hwnd = parent window with default scrollbar(s)
+        switch(flags) {
+        case ESB_ENABLE_BOTH:
+            fEnable = TRUE;
+            break;
+        case ESB_DISABLE_BOTH:
+        case ESB_DISABLE_RTDN:
+        case ESB_DISABLE_LTUP:
+            fEnable = FALSE;
+            break;
+        default:
+            SetLastError(ERROR_INVALID_PARAMETER);
+            return 0;
+        }
+        if(nBar == SB_HORZ || nBar == SB_BOTH)
+            rc = OSLibWinEnableScrollBar(window->getOS2FrameWindowHandle(), OSLIB_HSCROLL, fEnable);
+
+        if(nBar == SB_VERT || ( rc == TRUE && nBar == SB_BOTH))
+            rc = OSLibWinEnableScrollBar(window->getOS2FrameWindowHandle(), OSLIB_VSCROLL, fEnable);
+
+        return rc;
+    }
     flags &= ESB_DISABLE_BOTH;
 
@@ -1575,6 +1602,7 @@
     SCROLL_RefreshScrollBar( hwnd, nBar, TRUE, TRUE );
     return TRUE;
-}*/
-
+}
+//******************************************************************************
+//******************************************************************************
 BOOL SCROLLBAR_Register()
 {
@@ -1594,6 +1622,6 @@
     return RegisterClassA(&wndClass);
 }
-
-
+//******************************************************************************
+//******************************************************************************
 BOOL SCROLLBAR_Unregister()
 {
@@ -1602,2 +1630,5 @@
     else return FALSE;
 }
+//******************************************************************************
+//******************************************************************************
+
Index: trunk/src/user32/user32.cpp
===================================================================
--- trunk/src/user32/user32.cpp	(revision 1055)
+++ trunk/src/user32/user32.cpp	(revision 1057)
@@ -1,3 +1,3 @@
-/* $Id: user32.cpp,v 1.31 1999-09-25 14:18:11 sandervl Exp $ */
+/* $Id: user32.cpp,v 1.32 1999-09-26 10:10:00 sandervl Exp $ */
 
 /*
@@ -475,5 +475,6 @@
   return(rc);
 }
-
+//******************************************************************************
+//******************************************************************************
 /* Caret Functions */
 
Index: trunk/src/user32/win32wbase.cpp
===================================================================
--- trunk/src/user32/win32wbase.cpp	(revision 1055)
+++ trunk/src/user32/win32wbase.cpp	(revision 1057)
@@ -1,3 +1,3 @@
-/* $Id: win32wbase.cpp,v 1.13 1999-09-25 16:49:30 cbratschi Exp $ */
+/* $Id: win32wbase.cpp,v 1.14 1999-09-26 10:10:01 sandervl Exp $ */
 /*
  * Win32 Window Base Class for OS/2
@@ -825,4 +825,12 @@
   // TODO: call TIMERPROC if not NULL
   return SendInternalMessageA(WM_TIMER, TimerID, 0);
+}
+//******************************************************************************
+//******************************************************************************
+ULONG Win32BaseWindow::MsgScroll(ULONG msg, ULONG scrollCode, ULONG scrollPos)
+{
+  //According to the SDK docs, the scrollbar handle (lParam) is 0 when the standard
+  //window scrollbars send these messages
+  return SendInternalMessageA(msg, MAKELONG(scrollCode, scrollPos), 0);
 }
 //******************************************************************************
Index: trunk/src/user32/win32wbase.h
===================================================================
--- trunk/src/user32/win32wbase.h	(revision 1055)
+++ trunk/src/user32/win32wbase.h	(revision 1057)
@@ -1,3 +1,3 @@
-/* $Id: win32wbase.h,v 1.6 1999-09-24 12:47:51 sandervl Exp $ */
+/* $Id: win32wbase.h,v 1.7 1999-09-26 10:10:01 sandervl Exp $ */
 /*
  * Win32 Window Base Class for OS/2
@@ -75,4 +75,5 @@
          ULONG  MsgKillFocus(HWND hwnd);
          ULONG  MsgTimer(ULONG TimerID);
+	 ULONG  MsgScroll(ULONG msg, ULONG scrollCode, ULONG scrollPos);
          ULONG  MsgCommand(ULONG cmd, ULONG Id, HWND hwnd);
          ULONG  MsgSysCommand(ULONG win32sc, ULONG x, ULONG y);
Index: trunk/src/user32/winscrollbar.cpp
===================================================================
--- trunk/src/user32/winscrollbar.cpp	(revision 1055)
+++ 	(revision )
@@ -1,142 +1,0 @@
-/* $Id: winscrollbar.cpp,v 1.1 1999-09-15 23:19:03 sandervl Exp $ */
-/*
- * Win32 scrollbar functions for OS/2
- *
- * Copyright 1999 Sander van Leeuwen
- *
- *
- * Project Odin Software License can be found in LICENSE.TXT
- *
- */
-#include <os2win.h>
-#include <misc.h>
-
-//******************************************************************************
-//******************************************************************************
-BOOL WIN32API EnableScrollBar( HWND arg1, INT arg2, UINT arg3)
-{
-#ifdef DEBUG
-    WriteLog("USER32:  EnableScrollBar\n");
-#endif
-    //CB: implement in window class
-    return O32_EnableScrollBar(arg1, arg2, arg3);
-}
-//******************************************************************************
-//******************************************************************************
-int WIN32API SetScrollPos( HWND arg1, int arg2, int arg3, BOOL  arg4)
-{
-#ifdef DEBUG
-    WriteLog("USER32:  SetScrollPos\n");
-#endif
-    return O32_SetScrollPos(arg1, arg2, arg3, arg4);
-}
-//******************************************************************************
-//******************************************************************************
-BOOL WIN32API SetScrollRange( HWND arg1, int arg2, int arg3, int arg4, BOOL  arg5)
-{
-#ifdef DEBUG
-    WriteLog("USER32:  SetScrollRange\n");
-#endif
-    return O32_SetScrollRange(arg1, arg2, arg3, arg4, arg5);
-}
-//******************************************************************************
-//******************************************************************************
-BOOL WIN32API ShowScrollBar( HWND arg1, int arg2, BOOL  arg3)
-{
-#ifdef DEBUG
-    WriteLog("USER32:  ShowScrollBar\n");
-#endif
-    return O32_ShowScrollBar(arg1, arg2, arg3);
-}
-//******************************************************************************
-//******************************************************************************
-int WIN32API GetScrollPos(HWND hwnd, int fnBar)
-{
- int pos;
-
-    pos = O32_GetScrollPos(hwnd, fnBar);
-#ifdef DEBUG
-    WriteLog("USER32:  GetScrollPos of %X type %d returned %d\n", hwnd, fnBar, pos);
-#endif
-    return(pos);
-}
-//******************************************************************************
-//******************************************************************************
-BOOL WIN32API GetScrollRange( HWND arg1, int arg2, int * arg3, int *  arg4)
-{
-#ifdef DEBUG
-    WriteLog("USER32:  GetScrollRange\n");
-#endif
-    return O32_GetScrollRange(arg1, arg2, arg3, arg4);
-}
-//******************************************************************************
-//******************************************************************************
-BOOL WIN32API ScrollWindow( HWND arg1, int arg2, int arg3, const RECT * arg4, const RECT *  arg5)
-{
-#ifdef DEBUG
-    WriteLog("USER32:  ScrollWindow\n");
-#endif
-    return O32_ScrollWindow(arg1, arg2, arg3, arg4, arg5);
-}
-//******************************************************************************
-//******************************************************************************
-INT WIN32API ScrollWindowEx( HWND arg1, int arg2, int arg3, const RECT * arg4, const RECT * arg5, HRGN arg6, PRECT arg7, UINT  arg8)
-{
-#ifdef DEBUG
-    WriteLog("USER32:  ScrollWindowEx\n");
-#endif
-    return O32_ScrollWindowEx(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
-}
-//******************************************************************************
-//******************************************************************************
-BOOL WIN32API GetScrollInfo(HWND hwnd, int fnBar, LPSCROLLINFO lpsi)
-{
-#ifdef DEBUG
-  WriteLog("USER32:  GetScrollInfo\n");
-#endif
-  if(lpsi == NULL)
-    return(FALSE);
-
-  if(lpsi->fMask & SIF_POS)
-    lpsi->nPos = GetScrollPos(hwnd, fnBar);
-  if(lpsi->fMask & SIF_RANGE)
-    GetScrollRange(hwnd, fnBar, &lpsi->nMin, &lpsi->nMax);
-  if(lpsi->fMask & SIF_PAGE) {
-#ifdef DEBUG
-    WriteLog("USER32:  GetScrollInfo, page info not implemented\n");
-#endif
-    lpsi->nPage     = 25;
-  }
-  return(TRUE);
-}
-//******************************************************************************
-//TODO: Not complete
-//******************************************************************************
-INT WIN32API SetScrollInfo(HWND hwnd, INT fnBar, const SCROLLINFO *lpsi, BOOL fRedraw)
-{
- int smin, smax;
-
-#ifdef DEBUG
-  WriteLog("USER32:  SetScrollInfo\n");
-#endif
-  if(lpsi == NULL)
-    return(FALSE);
-
-  if(lpsi->fMask & SIF_POS)
-        SetScrollPos(hwnd, fnBar, lpsi->nPos, fRedraw);
-  if(lpsi->fMask & SIF_RANGE)
-        SetScrollRange(hwnd, fnBar, lpsi->nMin, lpsi->nMax, fRedraw);
-  if(lpsi->fMask & SIF_PAGE) {
-#ifdef DEBUG
-        WriteLog("USER32:  GetScrollInfo, page info not implemented\n");
-#endif
-  }
-  if(lpsi->fMask & SIF_DISABLENOSCROLL) {
-#ifdef DEBUG
-        WriteLog("USER32:  GetScrollInfo, disable scrollbar not yet implemented\n");
-#endif
-  }
-  return(TRUE);
-}
-//******************************************************************************
-//******************************************************************************
