changeset 70:5e7a4d93d8d7

Implemented dw_container_optimize() on OS/2.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sun, 10 Feb 2002 18:06:50 +0000
parents 9510897c0b03
children 291c30a92b9b
files dw.h os2/dw.c
diffstat 2 files changed, 40 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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 {
--- 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));
+	}
 }
 
 /*