Commit 52add2a3 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

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

parent d9ebf196
......@@ -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);
}
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment