# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1013364410 0 # Node ID 5e7a4d93d8d707935209caf370072a0576d7c297 # Parent 9510897c0b03b126c32f97afa9c0db6c910cf694 Implemented dw_container_optimize() on OS/2. diff -r 9510897c0b03 -r 5e7a4d93d8d7 dw.h --- a/dw.h Mon Feb 04 16:04:43 2002 +0000 +++ b/dw.h Sun Feb 10 18:06:50 2002 +0000 @@ -288,6 +288,7 @@ ColorInfo cinfo; ULONG *flags; WNDPROC pOldProc; + ULONG columns; } ContainerInfo; typedef struct _hpixmap { diff -r 9510897c0b03 -r 5e7a4d93d8d7 os2/dw.c --- a/os2/dw.c Mon Feb 04 16:04:43 2002 +0000 +++ b/os2/dw.c Sun Feb 10 18:06:50 2002 +0000 @@ -5261,6 +5261,7 @@ tempflags[count] = 0; blah->data = tempflags; + blah->flags = separator; if(oldflags) free(oldflags); @@ -5808,6 +5809,44 @@ */ void dw_container_optimize(HWND handle) { + WindowData *blah = (WindowData *)WinQueryWindowPtr(handle, QWP_USER); + RECTL item; + PRECORDCORE pCore = NULL; + int max = 0; + + if(blah && !blah->flags) + return; + + pCore = WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)0L, MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER)); + while(pCore) + { + QUERYRECORDRECT qrr; + int vector; + + qrr.cb = sizeof(QUERYRECORDRECT); + qrr.pRecord = pCore; + qrr.fRightSplitWindow = 0; + qrr.fsExtent = CMA_TEXT; + + WinSendMsg(handle, CM_QUERYRECORDRECT, (MPARAM)&item, (MPARAM)&qrr); + + vector = item.xRight - item.xLeft; + + if(vector > max) + max = vector; + + pCore = WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)pCore, MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER)); + } + + if(max) + { + CNRINFO cnri; + + cnri.cb = sizeof(CNRINFO); + cnri.xVertSplitbar = max; + + WinSendMsg(handle, CM_SETCNRINFO, MPFROMP(&cnri), MPFROMLONG(CMA_XVERTSPLITBAR)); + } } /*