Changeset 1351 for trunk/src


Ignore:
Timestamp:
Oct 18, 1999, 1:59:58 PM (26 years ago)
Author:
sandervl
Message:

Listbox changes + EnumChildWindow rewrite

Location:
trunk/src/user32
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/dc.cpp

    r1336 r1351  
    1 /* $Id: dc.cpp,v 1.15 1999-10-17 15:46:07 sandervl Exp $ */
     1/* $Id: dc.cpp,v 1.16 1999-10-18 11:59:57 sandervl Exp $ */
    22
    33/*
     
    10111011       sendEraseBkgnd (wnd);
    10121012
     1013#if 1
     1014   WinUpdateWindow(wnd->getOS2FrameWindowHandle());
     1015#else
    10131016   wnd->MsgPaint(0);
     1017#endif
    10141018
    10151019   SetFS(sel);
  • trunk/src/user32/listbox.cpp

    r1348 r1351  
    1 /* $Id: listbox.cpp,v 1.8 1999-10-18 10:54:03 sandervl Exp $ */
     1/* $Id: listbox.cpp,v 1.9 1999-10-18 11:59:57 sandervl Exp $ */
    22/*
    33 * Listbox controls
     
    199199    else
    200200    {
     201        info.nMin  = 0;
     202        info.nMax  = descr->nb_items - 1;
    201203        info.nPos  = descr->top_item;
    202 
    203204        info.nPage = LISTBOX_GetCurrentPageSize( hwnd, descr );
    204205        info.fMask = SIF_RANGE | SIF_POS | SIF_PAGE;
    205         info.nMin  = 0;
    206         info.nMax = descr->nb_items;
    207 
    208206        if (descr->style & LBS_DISABLENOSCROLL)
    209207            info.fMask |= SIF_DISABLENOSCROLL;
  • trunk/src/user32/win32wbase.cpp

    r1348 r1351  
    1 /* $Id: win32wbase.cpp,v 1.53 1999-10-18 10:54:04 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.54 1999-10-18 11:59:58 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    607607  {
    608608        hwndHorzScroll = OSLibWinQueryScrollBarHandle(OS2HwndFrame, OSLIB_HSCROLL);
    609         OSLibWinShowScrollBar(OS2HwndFrame, hwndHorzScroll, OSLIB_HSCROLL, FALSE, TRUE);
     609//        OSLibWinShowScrollBar(OS2HwndFrame, hwndHorzScroll, OSLIB_HSCROLL, FALSE, TRUE);
    610610  }
    611611
    612612  if (dwStyle & WS_VSCROLL) {
    613613        hwndVertScroll = OSLibWinQueryScrollBarHandle(OS2HwndFrame, OSLIB_VSCROLL);
    614         OSLibWinShowScrollBar(OS2HwndFrame, hwndVertScroll, OSLIB_VSCROLL, FALSE, TRUE);
     614//        OSLibWinShowScrollBar(OS2HwndFrame, hwndVertScroll, OSLIB_VSCROLL, FALSE, TRUE);
    615615  }
    616616
     
    21712171}
    21722172//******************************************************************************
     2173//TODO: Should not enumerate children that are created during the enumeration!
     2174//******************************************************************************
     2175BOOL Win32BaseWindow::EnumChildWindows(WNDENUMPROC lpfn, LPARAM lParam)
     2176{
     2177 BOOL rc = TRUE;
     2178 HWND hwnd;
     2179 Win32BaseWindow *prevchild = 0, *child = 0;
     2180
     2181        dprintf(("EnumChildWindows of %x parameter %x %x (%x)", getWindowHandle(), lpfn, lParam, getFirstChild()));
     2182    for (child = (Win32BaseWindow *)getFirstChild(); child; child = (Win32BaseWindow *)child->getNextChild())
     2183    {
     2184        dprintf(("EnumChildWindows: enumerating child %x", child->getWindowHandle()));
     2185        hwnd = child->getWindowHandle();
     2186        if(lpfn(hwnd, lParam) == FALSE)
     2187        {
     2188                rc = FALSE;
     2189                break;
     2190        }
     2191        //check if the window still exists
     2192        if(!::IsWindow(hwnd))
     2193        {
     2194            child = prevchild;
     2195            continue;
     2196        }
     2197        if(child->getFirstChild() != NULL)
     2198        {
     2199            dprintf(("EnumChildWindows: Enumerate children of %x", child->getWindowHandle()));
     2200            if(child->EnumChildWindows(lpfn, lParam) == FALSE)
     2201            {
     2202                rc = FALSE;
     2203                break;
     2204            }
     2205        }
     2206        prevchild = child;
     2207    }
     2208    return rc;
     2209}
     2210//******************************************************************************
    21732211//******************************************************************************
    21742212Win32BaseWindow *Win32BaseWindow::FindWindowById(int id)
  • trunk/src/user32/win32wbase.h

    r1346 r1351  
    1 /* $Id: win32wbase.h,v 1.29 1999-10-17 20:18:46 sandervl Exp $ */
     1/* $Id: win32wbase.h,v 1.30 1999-10-18 11:59:58 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    203203                             BOOL fUnicode = 0);
    204204
     205           BOOL EnumChildWindows(WNDENUMPROC lpfn, LPARAM lParam);
     206
    205207    static HWND Win32ToOS2Handle(HWND hwnd);
    206208    static HWND Win32ToOS2FrameHandle(HWND hwnd);
  • trunk/src/user32/window.cpp

    r1346 r1351  
    1 /* $Id: window.cpp,v 1.20 1999-10-17 20:18:46 sandervl Exp $ */
     1/* $Id: window.cpp,v 1.21 1999-10-18 11:59:58 sandervl Exp $ */
    22/*
    33 * Win32 window apis for OS/2
     
    12741274BOOL WIN32API EnumChildWindows(HWND hwnd, WNDENUMPROC lpfn, LPARAM lParam)
    12751275{
    1276  Win32BaseWindow *window, *parentwindow;
     1276 Win32BaseWindow *window;
    12771277 BOOL   rc = TRUE;
    12781278 ULONG  henum;
    12791279 HWND   hwndNext;
    12801280
    1281   dprintf(("EnumChildWindows %x %x\n", hwnd, lParam));
    1282 
    1283   parentwindow = Win32BaseWindow::GetWindowFromHandle(hwnd);
    1284   if(!parentwindow) {
    1285         dprintf(("EnumChildWindows, window %x not found", hwnd));
    1286         SetLastError(ERROR_INVALID_WINDOW_HANDLE);
     1281  if(lpfn == NULL) {
     1282        dprintf(("EnumChildWindows invalid parameter %x %x\n", hwnd, lParam));
     1283        SetLastError(ERROR_INVALID_PARAMETER);
    12871284        return FALSE;
    12881285  }
    1289 
    1290   henum = OSLibWinBeginEnumWindows(OSLIB_HWND_DESKTOP);
    1291   while ((hwndNext = OSLibWinGetNextWindow(henum)) != 0)
    1292   {
    1293         window = Win32BaseWindow::GetWindowFromOS2Handle(hwndNext);
    1294         if(window == NULL) {
    1295                 window = Win32BaseWindow::GetWindowFromOS2FrameHandle(hwndNext);
    1296                 if(!window) {
    1297                         //OS/2 window or non-frame window, so skip it
    1298                         continue;
    1299                 }
    1300         }
    1301         if((rc = lpfn(window->getWindowHandle(), lParam)) == FALSE)
    1302         {
    1303                 rc = FALSE;
    1304                 break;
    1305         }
     1286  window = Win32BaseWindow::GetWindowFromHandle(hwnd);
     1287  if(!window) {
     1288        dprintf(("EnumChildWindows, window %x not found", hwnd));
     1289        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
     1290        return FALSE;
    13061291  }
    1307   OSLibWinEndEnumWindows(henum);
    1308   return rc;
     1292  return window->EnumChildWindows(lpfn, lParam);
    13091293}
    13101294//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.