Nikolay Sivov : comctl32/listview: Add partial support for cxMin width field.

Alexandre Julliard julliard at winehq.org
Tue Sep 8 08:55:34 CDT 2009


Module: wine
Branch: master
Commit: 52add2a30801749c54f9a78bb2c3e04cccf667c5
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=52add2a30801749c54f9a78bb2c3e04cccf667c5

Author: Nikolay Sivov <bunglehead at gmail.com>
Date:   Sun Sep  6 13:54:28 2009 +0400

comctl32/listview: Add partial support for cxMin width field.

---

 dlls/comctl32/listview.c |   14 +++++++++++---
 include/commctrl.h       |    1 +
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
index def3d1f..1c0f58b 100644
--- a/dlls/comctl32/listview.c
+++ b/dlls/comctl32/listview.c
@@ -176,7 +176,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(listview);
 typedef struct tagCOLUMN_INFO
 {
   RECT rcHeader;	/* tracks the header's rectangle */
-  int fmt;		/* same as LVCOLUMN.fmt */
+  INT fmt;		/* same as LVCOLUMN.fmt */
+  INT cxMin;
 } COLUMN_INFO;
 
 typedef struct tagITEMHDR
@@ -5733,6 +5734,9 @@ static BOOL LISTVIEW_GetColumnT(const LISTVIEW_INFO *infoPtr, INT nColumn, LPLVC
     if (lpColumn->mask & LVCF_SUBITEM)
 	lpColumn->iSubItem = hdi.lParam;
 
+    if (lpColumn->mask & LVCF_MINWIDTH)
+	lpColumn->cxMin = lpColumnInfo->cxMin;
+
     return TRUE;
 }
 
@@ -7456,6 +7460,7 @@ static INT LISTVIEW_InsertColumnT(LISTVIEW_INFO *infoPtr, INT nColumn,
     if (DPA_InsertPtr(infoPtr->hdpaColumns, nNewColumn, lpColumnInfo) == -1) goto fail;
 
     if (lpColumn->mask & LVCF_FMT) lpColumnInfo->fmt = lpColumn->fmt;
+    if (lpColumn->mask & LVCF_MINWIDTH) lpColumnInfo->cxMin = lpColumn->cxMin;
     if (!SendMessageW(infoPtr->hwndHeader, HDM_GETITEMRECT, nNewColumn, (LPARAM)&lpColumnInfo->rcHeader))
         goto fail;
 
@@ -7535,7 +7540,7 @@ static BOOL LISTVIEW_SetColumnT(const LISTVIEW_INFO *infoPtr, INT nColumn,
     if (lpColumn->mask & LVCF_FMT)
     {
 	COLUMN_INFO *lpColumnInfo = LISTVIEW_GetColumnInfo(infoPtr, nColumn);
-	int oldFmt = lpColumnInfo->fmt;
+	INT oldFmt = lpColumnInfo->fmt;
 	
 	lpColumnInfo->fmt = lpColumn->fmt;
 	if ((oldFmt ^ lpColumn->fmt) & (LVCFMT_JUSTIFYMASK | LVCFMT_IMAGE))
@@ -7544,6 +7549,9 @@ static BOOL LISTVIEW_SetColumnT(const LISTVIEW_INFO *infoPtr, INT nColumn,
 	}
     }
 
+    if (lpColumn->mask & LVCF_MINWIDTH)
+	LISTVIEW_GetColumnInfo(infoPtr, nColumn)->cxMin = lpColumn->cxMin;
+
     return TRUE;
 }
 
@@ -7679,7 +7687,7 @@ static BOOL LISTVIEW_SetColumnWidth(LISTVIEW_INFO *infoPtr, INT nColumn, INT cx)
 
     /* call header to update the column change */
     hdi.mask = HDI_WIDTH;
-    hdi.cxy = cx;
+    hdi.cxy = max(cx, LISTVIEW_GetColumnInfo(infoPtr, nColumn)->cxMin);
     TRACE("hdi.cxy=%d\n", hdi.cxy);
     return SendMessageW(infoPtr->hwndHeader, HDM_SETITEMW, nColumn, (LPARAM)&hdi);
 }
diff --git a/include/commctrl.h b/include/commctrl.h
index 17d8b86..1e13f10 100644
--- a/include/commctrl.h
+++ b/include/commctrl.h
@@ -2989,6 +2989,7 @@ static const WCHAR WC_LISTVIEWW[] = { 'S','y','s',
 #define LVCF_SUBITEM            0x0008
 #define LVCF_IMAGE              0x0010
 #define LVCF_ORDER              0x0020
+#define LVCF_MINWIDTH           0x0040
 
 #define LVCFMT_LEFT             0x0000
 #define LVCFMT_RIGHT            0x0001




More information about the wine-cvs mailing list