Author: dchapyshev
Date: Sat Sep 26 12:45:59 2009
New Revision: 43161
URL:
http://svn.reactos.org/svn/reactos?rev=43161&view=rev
Log:
- Sync comctl32/comdlg32 with Wine 1.1.30
Modified:
trunk/reactos/dll/win32/comctl32/comctl32.h
trunk/reactos/dll/win32/comctl32/comctl32.spec
trunk/reactos/dll/win32/comctl32/comctl32undoc.c
trunk/reactos/dll/win32/comctl32/dpa.c
trunk/reactos/dll/win32/comctl32/header.c
trunk/reactos/dll/win32/comctl32/listview.c
trunk/reactos/dll/win32/comctl32/monthcal.c
trunk/reactos/dll/win32/comctl32/trackbar.c
trunk/reactos/dll/win32/comctl32/updown.c
trunk/reactos/dll/win32/comdlg32/filedlg.c
Modified: trunk/reactos/dll/win32/comctl32/comctl32.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/comctl3…
==============================================================================
--- trunk/reactos/dll/win32/comctl32/comctl32.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/comctl32/comctl32.h [iso-8859-1] Sat Sep 26 12:45:59 2009
@@ -182,18 +182,6 @@
INT WINAPI Str_GetPtrA (LPCSTR, LPSTR, INT);
INT WINAPI Str_GetPtrW (LPCWSTR, LPWSTR, INT);
-
-INT WINAPI DPA_GetPtrIndex (HDPA, LPCVOID);
-BOOL WINAPI DPA_Grow (HDPA, INT);
-
-#define DPAM_NOSORT 0x0001
-#define DPAM_INSERT 0x0004
-#define DPAM_DELETE 0x0008
-
-typedef PVOID (CALLBACK *PFNDPAMERGE)(DWORD,PVOID,PVOID,LPARAM);
-BOOL WINAPI DPA_Merge (HDPA, HDPA, DWORD, PFNDPACOMPARE, PFNDPAMERGE, LPARAM);
-
-#define DPA_GetPtrCount(hdpa) (*(INT*)(hdpa))
LRESULT WINAPI SetPathWordBreakProc(HWND hwnd, BOOL bSet);
BOOL WINAPI MirrorIcon(HICON *phicon1, HICON *phicon2);
Modified: trunk/reactos/dll/win32/comctl32/comctl32.spec
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/comctl3…
==============================================================================
--- trunk/reactos/dll/win32/comctl32/comctl32.spec [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/comctl32/comctl32.spec [iso-8859-1] Sat Sep 26 12:45:59 2009
@@ -125,6 +125,7 @@
@ stdcall DestroyPropertySheetPage(long)
@ stdcall -private DllGetVersion(ptr)
@ stdcall -private DllInstall(long wstr)
+@ stdcall DPA_GetSize(ptr)
@ stdcall DrawShadowText(long wstr long ptr long long long long long)
@ stdcall DrawStatusText(long ptr ptr long) DrawStatusTextA
@ stdcall DrawStatusTextW(long ptr wstr long)
Modified: trunk/reactos/dll/win32/comctl32/comctl32undoc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/comctl3…
==============================================================================
--- trunk/reactos/dll/win32/comctl32/comctl32undoc.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/comctl32/comctl32undoc.c [iso-8859-1] Sat Sep 26 12:45:59
2009
@@ -206,6 +206,10 @@
* - Free an MRU-list with FreeMRUList().
*/
+typedef INT (CALLBACK *MRUStringCmpFnA)(LPCSTR lhs, LPCSTR rhs);
+typedef INT (CALLBACK *MRUStringCmpFnW)(LPCWSTR lhs, LPCWSTR rhs);
+typedef INT (CALLBACK *MRUBinaryCmpFn)(LPCVOID lhs, LPCVOID rhs, DWORD length);
+
typedef struct tagCREATEMRULISTA
{
DWORD cbSize;
@@ -213,7 +217,11 @@
DWORD dwFlags;
HKEY hKey;
LPSTR lpszSubKey;
- PROC lpfnCompare;
+ union
+ {
+ MRUStringCmpFnA string_cmpfn;
+ MRUBinaryCmpFn binary_cmpfn;
+ } u;
} CREATEMRULISTA, *LPCREATEMRULISTA;
typedef struct tagCREATEMRULISTW
@@ -223,7 +231,11 @@
DWORD dwFlags;
HKEY hKey;
LPWSTR lpszSubKey;
- PROC lpfnCompare;
+ union
+ {
+ MRUStringCmpFnW string_cmpfn;
+ MRUBinaryCmpFn binary_cmpfn;
+ } u;
} CREATEMRULISTW, *LPCREATEMRULISTW;
/* dwFlags */
@@ -385,7 +397,7 @@
UINT i;
LPSTR dataA = NULL;
- if (!mp || !mp->extview.lpfnCompare)
+ if (!mp || !mp->extview.u.string_cmpfn)
return -1;
if(!(mp->extview.dwFlags & MRUF_BINARY_LIST) && !mp->isUnicode) {
@@ -397,13 +409,12 @@
for(i=0; i<mp->cursize; i++) {
if (mp->extview.dwFlags & MRUF_BINARY_LIST) {
- if (!mp->extview.lpfnCompare(lpData, &mp->array[i]->datastart,
- cbData))
+ if (!mp->extview.u.binary_cmpfn(lpData, &mp->array[i]->datastart,
cbData))
break;
}
else {
if(mp->isUnicode) {
- if (!mp->extview.lpfnCompare(lpData, &mp->array[i]->datastart))
+ if (!mp->extview.u.string_cmpfn(lpData,
(LPWSTR)&mp->array[i]->datastart))
break;
} else {
DWORD len = WideCharToMultiByte(CP_ACP, 0,
@@ -414,7 +425,7 @@
WideCharToMultiByte(CP_ACP, 0, (LPWSTR)&mp->array[i]->datastart, -1,
itemA, len, NULL, NULL);
- cmp = mp->extview.lpfnCompare(dataA, itemA);
+ cmp = mp->extview.u.string_cmpfn((LPWSTR)dataA, (LPWSTR)itemA);
Free(itemA);
if(!cmp)
break;
@@ -672,7 +683,7 @@
ERR("(%u %u %x %p %s %p): Could not open key, error=%d\n",
mp->extview.cbSize, mp->extview.nMaxItems, mp->extview.dwFlags,
mp->extview.hKey, debugstr_w(mp->extview.lpszSubKey),
- mp->extview.lpfnCompare, err);
+ mp->extview.u.string_cmpfn, err);
return 0;
}
@@ -717,7 +728,7 @@
TRACE("(%u %u %x %p %s %p): Current Size = %d\n",
mp->extview.cbSize, mp->extview.nMaxItems, mp->extview.dwFlags,
mp->extview.hKey, debugstr_w(mp->extview.lpszSubKey),
- mp->extview.lpfnCompare, mp->cursize);
+ mp->extview.u.string_cmpfn, mp->cursize);
return mp;
}
Modified: trunk/reactos/dll/win32/comctl32/dpa.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/dpa.c?r…
==============================================================================
--- trunk/reactos/dll/win32/comctl32/dpa.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/comctl32/dpa.c [iso-8859-1] Sat Sep 26 12:45:59 2009
@@ -45,14 +45,14 @@
WINE_DEFAULT_DEBUG_CHANNEL(dpa);
-struct _DPA
+typedef struct _DPA
{
INT nItemCount;
LPVOID *ptrs;
HANDLE hHeap;
INT nGrow;
INT nMaxCount;
-};
+} DPA;
typedef struct _STREAMDATA
{
@@ -61,15 +61,6 @@
DWORD dwItems;
} STREAMDATA, *PSTREAMDATA;
-typedef struct _LOADDATA
-{
- INT nCount;
- PVOID ptr;
-} LOADDATA, *LPLOADDATA;
-
-typedef HRESULT (CALLBACK *DPALOADPROC)(LPLOADDATA,IStream*,LPARAM);
-
-
/**************************************************************************
* DPA_LoadStream [COMCTL32.9]
*
@@ -79,29 +70,29 @@
* phDpa [O] pointer to a handle to a dynamic pointer array
* loadProc [I] pointer to a callback function
* pStream [I] pointer to a stream
- * lParam [I] application specific value
- *
- * RETURNS
- * Success: TRUE
- * Failure: FALSE
+ * pData [I] pointer to callback data
+ *
+ * RETURNS
+ * Success: S_OK, S_FALSE - partial success
+ * Failure: HRESULT error code
*
* NOTES
* No more information available yet!
*/
-HRESULT WINAPI DPA_LoadStream (HDPA *phDpa, DPALOADPROC loadProc,
- IStream *pStream, LPARAM lParam)
+HRESULT WINAPI DPA_LoadStream (HDPA *phDpa, PFNDPASTREAM loadProc,
+ IStream *pStream, LPVOID pData)
{
HRESULT errCode;
LARGE_INTEGER position;
- ULARGE_INTEGER newPosition;
+ ULARGE_INTEGER initial_pos;
STREAMDATA streamData;
- LOADDATA loadData;
+ DPASTREAMINFO streamInfo;
ULONG ulRead;
HDPA hDpa;
PVOID *ptr;
- FIXME ("phDpa=%p loadProc=%p pStream=%p lParam=%lx\n",
- phDpa, loadProc, pStream, lParam);
+ TRACE ("phDpa=%p loadProc=%p pStream=%p pData=%p\n",
+ phDpa, loadProc, pStream, pData);
if (!phDpa || !loadProc || !pStream)
return E_INVALIDARG;
@@ -110,27 +101,24 @@
position.QuadPart = 0;
- /*
- * Zero out our streamData
- */
- memset(&streamData,0,sizeof(STREAMDATA));
-
- errCode = IStream_Seek (pStream, position, STREAM_SEEK_CUR, &newPosition);
+ errCode = IStream_Seek (pStream, position, STREAM_SEEK_CUR, &initial_pos);
if (errCode != S_OK)
return errCode;
+ memset(&streamData, 0, sizeof(STREAMDATA));
errCode = IStream_Read (pStream, &streamData, sizeof(STREAMDATA), &ulRead);
if (errCode != S_OK)
return errCode;
- FIXME ("dwSize=%u dwData2=%u dwItems=%u\n",
+ TRACE ("dwSize=%u dwData2=%u dwItems=%u\n",
streamData.dwSize, streamData.dwData2, streamData.dwItems);
- if ( ulRead < sizeof(STREAMDATA) ||
- lParam < sizeof(STREAMDATA) ||
- streamData.dwSize < sizeof(STREAMDATA) ||
- streamData.dwData2 < 1) {
- errCode = E_FAIL;
+ if (ulRead < sizeof(STREAMDATA) ||
+ streamData.dwSize < sizeof(STREAMDATA) || streamData.dwData2 != 1) {
+ /* back to initial position */
+ position.QuadPart = initial_pos.QuadPart;
+ IStream_Seek (pStream, position, STREAM_SEEK_SET, NULL);
+ return E_FAIL;
}
if (streamData.dwItems > (UINT_MAX / 2 / sizeof(VOID*))) /* 536870911 */
@@ -146,23 +134,23 @@
/* load data from the stream into the dpa */
ptr = hDpa->ptrs;
- for (loadData.nCount = 0; loadData.nCount < streamData.dwItems; loadData.nCount++)
{
- errCode = (loadProc)(&loadData, pStream, lParam);
+ for (streamInfo.iPos = 0; streamInfo.iPos < streamData.dwItems; streamInfo.iPos++)
{
+ errCode = (loadProc)(&streamInfo, pStream, pData);
if (errCode != S_OK) {
errCode = S_FALSE;
break;
}
- *ptr = loadData.ptr;
+ *ptr = streamInfo.pvItem;
ptr++;
}
/* set the number of items */
- hDpa->nItemCount = loadData.nCount;
+ hDpa->nItemCount = streamInfo.iPos;
/* store the handle to the dpa */
*phDpa = hDpa;
- FIXME ("new hDpa=%p, errorcode=%x\n", hDpa, errCode);
+ TRACE ("new hDpa=%p, errorcode=%x\n", hDpa, errCode);
return errCode;
}
@@ -175,25 +163,80 @@
*
* PARAMS
* hDpa [I] handle to a dynamic pointer array
- * loadProc [I] pointer to a callback function
+ * saveProc [I] pointer to a callback function
* pStream [I] pointer to a stream
- * lParam [I] application specific value
- *
- * RETURNS
- * Success: TRUE
- * Failure: FALSE
+ * pData [I] pointer to callback data
+ *
+ * RETURNS
+ * Success: S_OK, S_FALSE - partial success
+ * Failure: HRESULT error code
*
* NOTES
* No more information available yet!
*/
-HRESULT WINAPI DPA_SaveStream (const HDPA hDpa, DPALOADPROC loadProc,
- IStream *pStream, LPARAM lParam)
-{
-
- FIXME ("hDpa=%p loadProc=%p pStream=%p lParam=%lx\n",
- hDpa, loadProc, pStream, lParam);
-
- return E_FAIL;
+HRESULT WINAPI DPA_SaveStream (const HDPA hDpa, PFNDPASTREAM saveProc,
+ IStream *pStream, LPVOID pData)
+{
+ LARGE_INTEGER position;
+ ULARGE_INTEGER initial_pos, curr_pos;
+ STREAMDATA streamData;
+ DPASTREAMINFO streamInfo;
+ HRESULT hr;
+ PVOID *ptr;
+
+ TRACE ("hDpa=%p saveProc=%p pStream=%p pData=%p\n",
+ hDpa, saveProc, pStream, pData);
+
+ if (!hDpa || !saveProc || !pStream) return E_INVALIDARG;
+
+ /* save initial position to write header after completion */
+ position.QuadPart = 0;
+ hr = IStream_Seek (pStream, position, STREAM_SEEK_CUR, &initial_pos);
+ if (hr != S_OK)
+ return hr;
+
+ /* write empty header */
+ streamData.dwSize = sizeof(streamData);
+ streamData.dwData2 = 1;
+ streamData.dwItems = 0;
+
+ hr = IStream_Write (pStream, &streamData, sizeof(streamData), NULL);
+ if (hr != S_OK) {
+ position.QuadPart = initial_pos.QuadPart;
+ IStream_Seek (pStream, position, STREAM_SEEK_SET, NULL);
+ return hr;
+ }
+
+ /* no items - we're done */
+ if (hDpa->nItemCount == 0) return S_OK;
+
+ ptr = hDpa->ptrs;
+ for (streamInfo.iPos = 0; streamInfo.iPos < hDpa->nItemCount;
streamInfo.iPos++) {
+ streamInfo.pvItem = *ptr;
+ hr = (saveProc)(&streamInfo, pStream, pData);
+ if (hr != S_OK) {
+ hr = S_FALSE;
+ break;
+ }
+ ptr++;
+ }
+
+ /* write updated header */
+ position.QuadPart = 0;
+ IStream_Seek (pStream, position, STREAM_SEEK_CUR, &curr_pos);
+
+ streamData.dwSize = curr_pos.QuadPart - initial_pos.QuadPart;
+ streamData.dwData2 = 1;
+ streamData.dwItems = streamInfo.iPos;
+
+ position.QuadPart = initial_pos.QuadPart;
+ IStream_Seek (pStream, position, STREAM_SEEK_SET, NULL);
+ IStream_Write (pStream, &streamData, sizeof(streamData), NULL);
+
+ position.QuadPart = curr_pos.QuadPart;
+ IStream_Seek (pStream, position, STREAM_SEEK_SET, NULL);
+
+ return hr;
}
@@ -241,7 +284,7 @@
if (IsBadCodePtr ((FARPROC)pfnMerge))
return FALSE;
- if (!(dwFlags & DPAM_NOSORT)) {
+ if (!(dwFlags & DPAM_SORTED)) {
TRACE("sorting dpa's!\n");
if (hdpa1->nItemCount > 0)
DPA_Sort (hdpa1, pfnCompare, lParam);
@@ -269,14 +312,14 @@
do
{
if (nIndex < 0) {
- if ((nCount >= 0) && (dwFlags & DPAM_INSERT)) {
+ if ((nCount >= 0) && (dwFlags & DPAM_UNION)) {
/* Now insert the remaining new items into DPA 1 */
TRACE("%d items to be inserted at start of DPA 1\n",
nCount+1);
for (i=nCount; i>=0; i--) {
PVOID ptr;
- ptr = (pfnMerge)(3, *pWork2, NULL, lParam);
+ ptr = (pfnMerge)(DPAMM_INSERT, *pWork2, NULL, lParam);
if (!ptr)
return FALSE;
DPA_InsertPtr (hdpa1, 0, ptr);
@@ -293,7 +336,7 @@
{
PVOID ptr;
- ptr = (pfnMerge)(1, *pWork1, *pWork2, lParam);
+ ptr = (pfnMerge)(DPAMM_MERGE, *pWork1, *pWork2, lParam);
if (!ptr)
return FALSE;
@@ -306,14 +349,14 @@
else if (nResult > 0)
{
/* item in DPA 1 missing from DPA 2 */
- if (dwFlags & DPAM_DELETE)
+ if (dwFlags & DPAM_INTERSECT)
{
/* Now delete the extra item in DPA1 */
PVOID ptr;
- ptr = DPA_DeletePtr (hdpa1, hdpa1->nItemCount - 1);
-
- (pfnMerge)(2, ptr, NULL, lParam);
+ ptr = DPA_DeletePtr (hdpa1, nIndex);
+
+ (pfnMerge)(DPAMM_DELETE, ptr, NULL, lParam);
}
nIndex--;
pWork1--;
@@ -321,12 +364,12 @@
else
{
/* new item in DPA 2 */
- if (dwFlags & DPAM_INSERT)
+ if (dwFlags & DPAM_UNION)
{
/* Now insert the new item in DPA 1 */
PVOID ptr;
- ptr = (pfnMerge)(3, *pWork2, NULL, lParam);
+ ptr = (pfnMerge)(DPAMM_INSERT, *pWork2, NULL, lParam);
if (!ptr)
return FALSE;
DPA_InsertPtr (hdpa1, nIndex+1, ptr);
@@ -954,3 +997,23 @@
DPA_EnumCallback (hdpa, enumProc, lParam);
DPA_Destroy (hdpa);
}
+
+/**************************************************************************
+ * DPA_GetSize [COMCTL32.@]
+ *
+ * Returns all array allocated memory size
+ *
+ * PARAMS
+ * hdpa [I] handle to the dynamic pointer array
+ *
+ * RETURNS
+ * Size in bytes
+ */
+ULONGLONG WINAPI DPA_GetSize(HDPA hdpa)
+{
+ TRACE("(%p)\n", hdpa);
+
+ if (!hdpa) return 0;
+
+ return sizeof(DPA) + hdpa->nMaxCount*sizeof(PVOID);
+}
Modified: trunk/reactos/dll/win32/comctl32/header.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/header.…
==============================================================================
--- trunk/reactos/dll/win32/comctl32/header.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/comctl32/header.c [iso-8859-1] Sat Sep 26 12:45:59 2009
@@ -216,6 +216,14 @@
HEADER_PrevItem(const HEADER_INFO *infoPtr, INT iItem)
{
return HEADER_OrderToIndex(infoPtr, HEADER_IndexToOrder(infoPtr, iItem)-1);
+}
+
+/* TRUE when item is not resizable with dividers,
+ note that valid index should be supplied */
+static inline BOOL
+HEADER_IsItemFixed(const HEADER_INFO *infoPtr, INT iItem)
+{
+ return (infoPtr->dwStyle & HDS_NOSIZING) || (infoPtr->items[iItem].fmt
& HDF_FIXEDWIDTH);
}
static void
@@ -624,6 +632,13 @@
rcTest = rect;
rcTest.right = rcTest.left + DIVIDER_WIDTH;
if (PtInRect (&rcTest, *lpPt)) {
+ if (HEADER_IsItemFixed(infoPtr, HEADER_PrevItem(infoPtr, iCount)))
+ {
+ *pFlags |= HHT_ONHEADER;
+ *pItem = iCount;
+ TRACE("ON HEADER %d\n", *pItem);
+ return;
+ }
if (bNoWidth) {
*pFlags |= HHT_ONDIVOPEN;
*pItem = HEADER_PrevItem(infoPtr, iCount);
@@ -640,7 +655,8 @@
}
rcTest = rect;
rcTest.left = rcTest.right - DIVIDER_WIDTH;
- if (PtInRect (&rcTest, *lpPt)) {
+ if (!HEADER_IsItemFixed(infoPtr, iCount) && PtInRect (&rcTest, *lpPt))
+ {
*pFlags |= HHT_ONDIVIDER;
*pItem = iCount;
TRACE("ON DIVIDER %d\n", *pItem);
@@ -655,21 +671,24 @@
}
/* check for last divider part (on nowhere) */
- rect = infoPtr->items[infoPtr->uNumItem-1].rect;
- rect.left = rect.right;
- rect.right += DIVIDER_WIDTH;
- if (PtInRect (&rect, *lpPt)) {
- if (bNoWidth) {
- *pFlags |= HHT_ONDIVOPEN;
- *pItem = infoPtr->uNumItem - 1;
- TRACE("ON DIVOPEN %d\n", *pItem);
- return;
- }
- else {
- *pFlags |= HHT_ONDIVIDER;
- *pItem = infoPtr->uNumItem-1;
- TRACE("ON DIVIDER %d\n", *pItem);
- return;
+ if (!HEADER_IsItemFixed(infoPtr, infoPtr->uNumItem - 1))
+ {
+ rect = infoPtr->items[infoPtr->uNumItem-1].rect;
+ rect.left = rect.right;
+ rect.right += DIVIDER_WIDTH;
+ if (PtInRect (&rect, *lpPt)) {
+ if (bNoWidth) {
+ *pFlags |= HHT_ONDIVOPEN;
+ *pItem = infoPtr->uNumItem - 1;
+ TRACE("ON DIVOPEN %d\n", *pItem);
+ return;
+ }
+ else {
+ *pFlags |= HHT_ONDIVIDER;
+ *pItem = infoPtr->uNumItem - 1;
+ TRACE("ON DIVIDER %d\n", *pItem);
+ return;
+ }
}
}
Modified: trunk/reactos/dll/win32/comctl32/listview.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/listvie…
==============================================================================
--- trunk/reactos/dll/win32/comctl32/listview.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/comctl32/listview.c [iso-8859-1] Sat Sep 26 12:45:59 2009
@@ -176,7 +176,8 @@
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 @@
if (lpColumn->mask & LVCF_SUBITEM)
lpColumn->iSubItem = hdi.lParam;
+ if (lpColumn->mask & LVCF_MINWIDTH)
+ lpColumn->cxMin = lpColumnInfo->cxMin;
+
return TRUE;
}
@@ -7299,7 +7303,10 @@
if (clrBk == CLR_NONE)
infoPtr->hBkBrush = (HBRUSH)GetClassLongPtrW(infoPtr->hwndSelf,
GCLP_HBRBACKGROUND);
else
+ {
infoPtr->hBkBrush = CreateSolidBrush(clrBk);
+ infoPtr->dwLvExStyle &= ~LVS_EX_TRANSPARENTBKGND;
+ }
LISTVIEW_InvalidateList(infoPtr);
}
@@ -7333,6 +7340,9 @@
lphdi->fmt |= HDF_IMAGE;
lphdi->iImage = I_IMAGECALLBACK;
}
+
+ if (lpColumn->fmt & LVCFMT_FIXED_WIDTH)
+ lphdi->fmt |= HDF_FIXEDWIDTH;
}
if (lpColumn->mask & LVCF_WIDTH)
@@ -7450,6 +7460,7 @@
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;
@@ -7529,7 +7540,7 @@
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))
@@ -7537,6 +7548,9 @@
if (infoPtr->uView == LV_VIEW_DETAILS) LISTVIEW_InvalidateColumn(infoPtr,
nColumn);
}
}
+
+ if (lpColumn->mask & LVCF_MINWIDTH)
+ LISTVIEW_GetColumnInfo(infoPtr, nColumn)->cxMin = lpColumn->cxMin;
return TRUE;
}
@@ -7673,7 +7687,7 @@
/* 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);
}
@@ -7785,6 +7799,11 @@
LISTVIEW_UpdateSize(infoPtr);
}
+ if((infoPtr->dwLvExStyle ^ dwOldExStyle) & LVS_EX_TRANSPARENTBKGND)
+ {
+ if (infoPtr->dwLvExStyle & LVS_EX_TRANSPARENTBKGND)
+ LISTVIEW_SetBkColor(infoPtr, CLR_NONE);
+ }
LISTVIEW_InvalidateList(infoPtr);
return dwOldExStyle;
@@ -8800,7 +8819,13 @@
if (!GetClipBox(hdc, &rc)) return FALSE;
if (infoPtr->clrBk == CLR_NONE)
- return SendMessageW(infoPtr->hwndNotify, WM_ERASEBKGND, (WPARAM)hdc, 0);
+ {
+ if (infoPtr->dwLvExStyle & LVS_EX_TRANSPARENTBKGND)
+ return SendMessageW(infoPtr->hwndNotify, WM_PRINTCLIENT,
+ (WPARAM)hdc, PRF_ERASEBKGND);
+ else
+ return SendMessageW(infoPtr->hwndNotify, WM_ERASEBKGND, (WPARAM)hdc, 0);
+ }
/* for double buffered controls we need to do this during refresh */
if (infoPtr->dwLvExStyle & LVS_EX_DOUBLEBUFFER) return FALSE;
Modified: trunk/reactos/dll/win32/comctl32/monthcal.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/monthca…
==============================================================================
--- trunk/reactos/dll/win32/comctl32/monthcal.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/comctl32/monthcal.c [iso-8859-1] Sat Sep 26 12:45:59 2009
@@ -76,7 +76,8 @@
typedef struct
{
- HWND hwndSelf;
+ HWND hwndSelf;
+ DWORD dwStyle; /* cached GWL_STYLE */
COLORREF bk;
COLORREF txt;
COLORREF titlebk;
@@ -90,7 +91,7 @@
int height_increment;
int width_increment;
int firstDayplace; /* place of the first day of the current month */
- int delta; /* scroll rate; # of months that the */
+ INT delta; /* scroll rate; # of months that the */
/* control moves when user clicks a scroll button */
int visible; /* # of months visible */
int firstDay; /* Start month calendar with firstDay's day */
@@ -103,7 +104,7 @@
int status; /* See MC_SEL flags */
int curSelDay; /* current selected day */
int firstSelDay; /* first selected day */
- int maxSelCount;
+ INT maxSelCount;
SYSTEMTIME minSel;
SYSTEMTIME maxSel;
DWORD rangeValid;
@@ -157,9 +158,15 @@
}
}
+/* compares timestamps using date part only */
+static inline BOOL MONTHCAL_IsDateEqual(const SYSTEMTIME *first, const SYSTEMTIME
*second)
+{
+ return (first->wYear == second->wYear) && (first->wMonth ==
second->wMonth) &&
+ (first->wDay == second->wDay);
+}
/* make sure that time is valid */
-static int MONTHCAL_ValidateTime(SYSTEMTIME time)
+static BOOL MONTHCAL_ValidateTime(SYSTEMTIME time)
{
if(time.wMonth < 1 || time.wMonth > 12 ) return FALSE;
if(time.wDayOfWeek > 6) return FALSE;
@@ -270,54 +277,20 @@
/* month is the month value(1 == january, 12 == december) */
static void MONTHCAL_CircleDay(const MONTHCAL_INFO *infoPtr, HDC hdc, int day, int
month)
{
- HPEN hRedPen = CreatePen(PS_SOLID, 2, RGB(255, 0, 0));
+ HPEN hRedPen = CreatePen(PS_SOLID, 1, RGB(255, 0, 0));
HPEN hOldPen2 = SelectObject(hdc, hRedPen);
- POINT points[13];
- int x, y;
+ HBRUSH hOldBrush;
RECT day_rect;
-
MONTHCAL_CalcPosFromDay(infoPtr, day, month, &day_rect);
- x = day_rect.left;
- y = day_rect.top;
-
- points[0].x = x;
- points[0].y = y - 1;
- points[1].x = x + 0.8 * infoPtr->width_increment;
- points[1].y = y - 1;
- points[2].x = x + 0.9 * infoPtr->width_increment;
- points[2].y = y;
- points[3].x = x + infoPtr->width_increment;
- points[3].y = y + 0.5 * infoPtr->height_increment;
-
- points[4].x = x + infoPtr->width_increment;
- points[4].y = y + 0.9 * infoPtr->height_increment;
- points[5].x = x + 0.6 * infoPtr->width_increment;
- points[5].y = y + 0.9 * infoPtr->height_increment;
- points[6].x = x + 0.5 * infoPtr->width_increment;
- points[6].y = y + 0.9 * infoPtr->height_increment; /* bring the bottom up just
- a hair to fit inside the day rectangle */
-
- points[7].x = x + 0.2 * infoPtr->width_increment;
- points[7].y = y + 0.8 * infoPtr->height_increment;
- points[8].x = x + 0.1 * infoPtr->width_increment;
- points[8].y = y + 0.8 * infoPtr->height_increment;
- points[9].x = x;
- points[9].y = y + 0.5 * infoPtr->height_increment;
-
- points[10].x = x + 0.1 * infoPtr->width_increment;
- points[10].y = y + 0.2 * infoPtr->height_increment;
- points[11].x = x + 0.2 * infoPtr->width_increment;
- points[11].y = y + 0.3 * infoPtr->height_increment;
- points[12].x = x + 0.4 * infoPtr->width_increment;
- points[12].y = y + 0.2 * infoPtr->height_increment;
-
- PolyBezier(hdc, points, 13);
+ hOldBrush = SelectObject(hdc, GetStockObject(NULL_BRUSH));
+ Rectangle(hdc, day_rect.left, day_rect.top, day_rect.right, day_rect.bottom);
+
+ SelectObject(hdc, hOldBrush);
DeleteObject(hRedPen);
SelectObject(hdc, hOldPen2);
}
-
static void MONTHCAL_DrawDay(const MONTHCAL_INFO *infoPtr, HDC hdc, int day, int month,
int x, int y, int bold)
@@ -325,7 +298,7 @@
static const WCHAR fmtW[] = { '%','d',0 };
WCHAR buf[10];
RECT r;
- static int haveBoldFont, haveSelectedDay = FALSE;
+ static BOOL haveBoldFont, haveSelectedDay = FALSE;
HBRUSH hbr;
COLORREF oldCol = 0;
COLORREF oldBk = 0;
@@ -340,16 +313,14 @@
if((day>=infoPtr->minSel.wDay) && (day<=infoPtr->maxSel.wDay)
&& (month==infoPtr->currentMonth)) {
- HRGN hrgn;
RECT r2;
TRACE("%d %d %d\n",day, infoPtr->minSel.wDay, infoPtr->maxSel.wDay);
TRACE("%s\n", wine_dbgstr_rect(&r));
oldCol = SetTextColor(hdc, infoPtr->monthbk);
oldBk = SetBkColor(hdc, infoPtr->trailingtxt);
- hbr = GetSysColorBrush(COLOR_GRAYTEXT);
- hrgn = CreateEllipticRgn(r.left, r.top, r.right, r.bottom);
- FillRgn(hdc, hrgn, hbr);
+ hbr = GetSysColorBrush(COLOR_HIGHLIGHT);
+ FillRect(hdc, &r, hbr);
/* FIXME: this may need to be changed now b/c of the other
drawing changes 11/3/99 CMM */
@@ -374,13 +345,13 @@
haveBoldFont = FALSE;
}
+ SetBkMode(hdc,TRANSPARENT);
+ DrawTextW(hdc, buf, -1, &r, DT_CENTER | DT_VCENTER | DT_SINGLELINE );
+
if(haveSelectedDay) {
SetTextColor(hdc, oldCol);
SetBkColor(hdc, oldBk);
}
-
- SetBkMode(hdc,TRANSPARENT);
- DrawTextW(hdc, buf, -1, &r, DT_CENTER | DT_VCENTER | DT_SINGLELINE );
/* draw a rectangle around the currently selected days text */
if((day==infoPtr->curSelDay) && (month==infoPtr->currentMonth))
@@ -406,8 +377,7 @@
stateNum += 1;
else
{
- DWORD dwStyle = GetWindowLongW(infoPtr->hwndSelf, GWL_STYLE);
- if (dwStyle & WS_DISABLED) stateNum += 2;
+ if (infoPtr->dwStyle & WS_DISABLED) stateNum += 2;
}
DrawThemeBackground (theme, hdc, SBP_ARROWBTN, states[stateNum], r, NULL);
}
@@ -418,8 +388,7 @@
style |= DFCS_PUSHED;
else
{
- DWORD dwStyle = GetWindowLongW(infoPtr->hwndSelf, GWL_STYLE);
- if (dwStyle & WS_DISABLED) style |= DFCS_INACTIVE;
+ if (infoPtr->dwStyle & WS_DISABLED) style |= DFCS_INACTIVE;
}
DrawFrameControl(hdc, r, DFC_SCROLL, style);
@@ -450,7 +419,6 @@
WCHAR buf1[20];
WCHAR buf2[32];
COLORREF oldTextColor, oldBkColor;
- DWORD dwStyle = GetWindowLongW(infoPtr->hwndSelf, GWL_STYLE);
RECT rcTemp;
RECT rcDay; /* used in MONTHCAL_CalcDayRect() */
SYSTEMTIME localtime;
@@ -595,7 +563,7 @@
if((infoPtr->currentMonth==infoPtr->todaysDate.wMonth) &&
(day==infoPtr->todaysDate.wDay) &&
(infoPtr->currentYear == infoPtr->todaysDate.wYear)) {
- if(!(dwStyle & MCS_NOTODAYCIRCLE))
+ if(!(infoPtr->dwStyle & MCS_NOTODAYCIRCLE))
MONTHCAL_CircleDay(infoPtr, hdc, day, infoPtr->currentMonth);
}
}
@@ -617,7 +585,7 @@
if((infoPtr->currentMonth==infoPtr->todaysDate.wMonth) &&
(day==infoPtr->todaysDate.wDay) &&
(infoPtr->currentYear == infoPtr->todaysDate.wYear))
- if(!(dwStyle & MCS_NOTODAYCIRCLE))
+ if(!(infoPtr->dwStyle & MCS_NOTODAYCIRCLE))
MONTHCAL_CircleDay(infoPtr, hdc, day, infoPtr->currentMonth);
}
mask<<=1;
@@ -658,8 +626,8 @@
/* draw `today' date if style allows it, and draw a circle before today's
* date if necessary */
- if(!(dwStyle & MCS_NOTODAY)) {
- if(!(dwStyle & MCS_NOTODAYCIRCLE)) {
+ if(!(infoPtr->dwStyle & MCS_NOTODAY)) {
+ if(!(infoPtr->dwStyle & MCS_NOTODAYCIRCLE)) {
/*day is the number of days from nextmonth we put on the calendar */
MONTHCAL_CircleDay(infoPtr, hdc,
day+MONTHCAL_MonthLength(infoPtr->currentMonth,infoPtr->currentYear),
@@ -685,7 +653,7 @@
}
/*eventually draw week numbers*/
- if(dwStyle & MCS_WEEKNUMBERS) {
+ if(infoPtr->dwStyle & MCS_WEEKNUMBERS) {
/* display weeknumbers*/
int mindays;
@@ -772,21 +740,17 @@
static LRESULT
-MONTHCAL_GetMinReqRect(const MONTHCAL_INFO *infoPtr, LPARAM lParam)
-{
- LPRECT lpRect = (LPRECT) lParam;
-
+MONTHCAL_GetMinReqRect(const MONTHCAL_INFO *infoPtr, LPRECT lpRect)
+{
TRACE("rect %p\n", lpRect);
- /* validate parameters */
-
- if((infoPtr==NULL) ||(lpRect == NULL) ) return FALSE;
+ if(!lpRect) return FALSE;
lpRect->left = infoPtr->title.left;
lpRect->top = infoPtr->title.top;
lpRect->right = infoPtr->title.right;
lpRect->bottom = infoPtr->todayrect.bottom;
- AdjustWindowRect(lpRect, GetWindowLongW(infoPtr->hwndSelf, GWL_STYLE), FALSE);
+ AdjustWindowRect(lpRect, infoPtr->dwStyle, FALSE);
TRACE("%s\n", wine_dbgstr_rect(lpRect));
@@ -795,11 +759,11 @@
static LRESULT
-MONTHCAL_GetColor(const MONTHCAL_INFO *infoPtr, WPARAM wParam)
+MONTHCAL_GetColor(const MONTHCAL_INFO *infoPtr, INT index)
{
TRACE("\n");
- switch((int)wParam) {
+ switch(index) {
case MCSC_BACKGROUND:
return infoPtr->bk;
case MCSC_TEXT:
@@ -819,40 +783,40 @@
static LRESULT
-MONTHCAL_SetColor(MONTHCAL_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
-{
- int prev = -1;
-
- TRACE("%ld: color %08lx\n", wParam, lParam);
-
- switch((int)wParam) {
+MONTHCAL_SetColor(MONTHCAL_INFO *infoPtr, INT index, COLORREF color)
+{
+ COLORREF prev = -1;
+
+ TRACE("%d: color %08x\n", index, color);
+
+ switch(index) {
case MCSC_BACKGROUND:
prev = infoPtr->bk;
- infoPtr->bk = (COLORREF)lParam;
+ infoPtr->bk = color;
break;
case MCSC_TEXT:
prev = infoPtr->txt;
- infoPtr->txt = (COLORREF)lParam;
+ infoPtr->txt = color;
break;
case MCSC_TITLEBK:
prev = infoPtr->titlebk;
- infoPtr->titlebk = (COLORREF)lParam;
+ infoPtr->titlebk = color;
break;
case MCSC_TITLETEXT:
prev=infoPtr->titletxt;
- infoPtr->titletxt = (COLORREF)lParam;
+ infoPtr->titletxt = color;
break;
case MCSC_MONTHBK:
prev = infoPtr->monthbk;
- infoPtr->monthbk = (COLORREF)lParam;
+ infoPtr->monthbk = color;
break;
case MCSC_TRAILINGTEXT:
prev = infoPtr->trailingtxt;
- infoPtr->trailingtxt = (COLORREF)lParam;
+ infoPtr->trailingtxt = color;
break;
}
- InvalidateRect(infoPtr->hwndSelf, NULL, FALSE);
+ InvalidateRect(infoPtr->hwndSelf, NULL, index == MCSC_BACKGROUND ? TRUE : FALSE);
return prev;
}
@@ -870,13 +834,13 @@
static LRESULT
-MONTHCAL_SetMonthDelta(MONTHCAL_INFO *infoPtr, WPARAM wParam)
-{
- int prev = infoPtr->delta;
-
- TRACE("delta %ld\n", wParam);
-
- infoPtr->delta = (int)wParam;
+MONTHCAL_SetMonthDelta(MONTHCAL_INFO *infoPtr, INT delta)
+{
+ INT prev = infoPtr->delta;
+
+ TRACE("delta %d\n", delta);
+
+ infoPtr->delta = delta;
return prev;
}
@@ -893,32 +857,32 @@
/* FIXME: this needs to be implemented properly in MONTHCAL_Refresh() */
/* FIXME: we need more error checking here */
static LRESULT
-MONTHCAL_SetFirstDayOfWeek(MONTHCAL_INFO *infoPtr, LPARAM lParam)
+MONTHCAL_SetFirstDayOfWeek(MONTHCAL_INFO *infoPtr, INT day)
{
int prev = MAKELONG(infoPtr->firstDay, infoPtr->firstDayHighWord);
int localFirstDay;
WCHAR buf[40];
- TRACE("day %ld\n", lParam);
+ TRACE("day %d\n", day);
GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_IFIRSTDAYOFWEEK, buf, countof(buf));
TRACE("%s %d\n", debugstr_w(buf), strlenW(buf));
localFirstDay = atoiW(buf);
- if(lParam == -1)
+ if(day == -1)
{
infoPtr->firstDay = localFirstDay;
infoPtr->firstDayHighWord = FALSE;
}
- else if(lParam >= 7)
+ else if(day >= 7)
{
infoPtr->firstDay = 6; /* max first day allowed */
infoPtr->firstDayHighWord = TRUE;
}
else
{
- infoPtr->firstDay = lParam;
+ infoPtr->firstDay = day;
infoPtr->firstDayHighWord = TRUE;
}
@@ -943,25 +907,24 @@
static LRESULT
-MONTHCAL_SetRange(MONTHCAL_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
-{
- SYSTEMTIME *lprgSysTimeArray=(SYSTEMTIME *)lParam;
+MONTHCAL_SetRange(MONTHCAL_INFO *infoPtr, SHORT limits, SYSTEMTIME *range)
+{
FILETIME ft_min, ft_max;
- TRACE("%lx %lx\n", wParam, lParam);
-
- if ((wParam & GDTR_MIN && !MONTHCAL_ValidateTime(lprgSysTimeArray[0]))
||
- (wParam & GDTR_MAX && !MONTHCAL_ValidateTime(lprgSysTimeArray[1])))
+ TRACE("%x %p\n", limits, range);
+
+ if ((limits & GDTR_MIN && !MONTHCAL_ValidateTime(range[0])) ||
+ (limits & GDTR_MAX && !MONTHCAL_ValidateTime(range[1])))
return FALSE;
- if (wParam & GDTR_MIN)
+ if (limits & GDTR_MIN)
{
- MONTHCAL_CopyTime(&lprgSysTimeArray[0], &infoPtr->minDate);
+ MONTHCAL_CopyTime(&range[0], &infoPtr->minDate);
infoPtr->rangeValid |= GDTR_MIN;
}
- if (wParam & GDTR_MAX)
+ if (limits & GDTR_MAX)
{
- MONTHCAL_CopyTime(&lprgSysTimeArray[1], &infoPtr->maxDate);
+ MONTHCAL_CopyTime(&range[1], &infoPtr->maxDate);
infoPtr->rangeValid |= GDTR_MAX;
}
@@ -974,7 +937,7 @@
if (CompareFileTime(&ft_min, &ft_max) > 0)
{
- if ((wParam & (GDTR_MIN | GDTR_MAX)) == (GDTR_MIN | GDTR_MAX))
+ if ((limits & (GDTR_MIN | GDTR_MAX)) == (GDTR_MIN | GDTR_MAX))
{
/* Native swaps limits only when both limits are being set. */
SYSTEMTIME st_tmp = infoPtr->minDate;
@@ -985,7 +948,7 @@
{
/* Reset the other limit. */
/* FIXME: native sets date&time to 0. Should we do this too? */
- infoPtr->rangeValid &= wParam & GDTR_MIN ? ~GDTR_MAX : ~GDTR_MIN
;
+ infoPtr->rangeValid &= limits & GDTR_MIN ? ~GDTR_MAX : ~GDTR_MIN
;
}
}
@@ -994,69 +957,66 @@
static LRESULT
-MONTHCAL_GetRange(HWND hwnd, LPARAM lParam)
-{
- MONTHCAL_INFO *infoPtr = MONTHCAL_GetInfoPtr(hwnd);
- SYSTEMTIME *lprgSysTimeArray = (SYSTEMTIME *)lParam;
-
- /* validate parameters */
-
- if((infoPtr==NULL) || (lprgSysTimeArray==NULL)) return FALSE;
-
- MONTHCAL_CopyTime(&infoPtr->maxDate, &lprgSysTimeArray[1]);
- MONTHCAL_CopyTime(&infoPtr->minDate, &lprgSysTimeArray[0]);
+MONTHCAL_GetRange(const MONTHCAL_INFO *infoPtr, SYSTEMTIME *range)
+{
+ TRACE("%p\n", range);
+
+ if(!range) return FALSE;
+
+ MONTHCAL_CopyTime(&infoPtr->maxDate, &range[1]);
+ MONTHCAL_CopyTime(&infoPtr->minDate, &range[0]);
return infoPtr->rangeValid;
}
static LRESULT
-MONTHCAL_SetDayState(const MONTHCAL_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
-
-{
- int i, iMonths = (int)wParam;
- MONTHDAYSTATE *dayStates = (LPMONTHDAYSTATE)lParam;
-
- TRACE("%lx %lx\n", wParam, lParam);
- if(iMonths!=infoPtr->monthRange) return 0;
-
- for(i=0; i<iMonths; i++)
- infoPtr->monthdayState[i] = dayStates[i];
+MONTHCAL_SetDayState(const MONTHCAL_INFO *infoPtr, INT months, MONTHDAYSTATE *states)
+{
+ int i;
+
+ TRACE("%d %p\n", months, states);
+ if(months != infoPtr->monthRange) return 0;
+
+ for(i = 0; i < months; i++)
+ infoPtr->monthdayState[i] = states[i];
+
return 1;
}
static LRESULT
-MONTHCAL_GetCurSel(const MONTHCAL_INFO *infoPtr, LPARAM lParam)
-{
- SYSTEMTIME *lpSel = (SYSTEMTIME *) lParam;
-
- TRACE("%lx\n", lParam);
- if((infoPtr==NULL) ||(lpSel==NULL)) return FALSE;
- if(GetWindowLongW(infoPtr->hwndSelf, GWL_STYLE) & MCS_MULTISELECT) return
FALSE;
-
- MONTHCAL_CopyTime(&infoPtr->minSel, lpSel);
- TRACE("%d/%d/%d\n", lpSel->wYear, lpSel->wMonth, lpSel->wDay);
+MONTHCAL_GetCurSel(const MONTHCAL_INFO *infoPtr, SYSTEMTIME *curSel)
+{
+ TRACE("%p\n", curSel);
+ if(!curSel) return FALSE;
+ if(infoPtr->dwStyle & MCS_MULTISELECT) return FALSE;
+
+ MONTHCAL_CopyTime(&infoPtr->minSel, curSel);
+ TRACE("%d/%d/%d\n", curSel->wYear, curSel->wMonth, curSel->wDay);
return TRUE;
}
/* FIXME: if the specified date is not visible, make it visible */
/* FIXME: redraw? */
static LRESULT
-MONTHCAL_SetCurSel(MONTHCAL_INFO *infoPtr, LPARAM lParam)
-{
- SYSTEMTIME *lpSel = (SYSTEMTIME *)lParam;
-
- TRACE("%lx\n", lParam);
- if((infoPtr==NULL) ||(lpSel==NULL)) return FALSE;
- if(GetWindowLongW(infoPtr->hwndSelf, GWL_STYLE) & MCS_MULTISELECT) return
FALSE;
-
- if(!MONTHCAL_ValidateTime(*lpSel)) return FALSE;
-
- infoPtr->currentMonth=lpSel->wMonth;
- infoPtr->currentYear=lpSel->wYear;
-
- MONTHCAL_CopyTime(lpSel, &infoPtr->minSel);
- MONTHCAL_CopyTime(lpSel, &infoPtr->maxSel);
+MONTHCAL_SetCurSel(MONTHCAL_INFO *infoPtr, SYSTEMTIME *curSel)
+{
+ TRACE("%p\n", curSel);
+ if(!curSel) return FALSE;
+ if(infoPtr->dwStyle & MCS_MULTISELECT) return FALSE;
+
+ if(!MONTHCAL_ValidateTime(*curSel)) return FALSE;
+
+ MONTHCAL_CopyTime(curSel, &infoPtr->minSel);
+ MONTHCAL_CopyTime(curSel, &infoPtr->maxSel);
+
+ /* exit earlier if selection equals current */
+ if (infoPtr->currentMonth == curSel->wMonth &&
+ infoPtr->currentYear == curSel->wYear &&
+ infoPtr->curSelDay == curSel->wDay) return TRUE;
+
+ infoPtr->currentMonth = curSel->wMonth;
+ infoPtr->currentYear = curSel->wYear;
InvalidateRect(infoPtr->hwndSelf, NULL, FALSE);
@@ -1072,12 +1032,12 @@
static LRESULT
-MONTHCAL_SetMaxSelCount(MONTHCAL_INFO *infoPtr, WPARAM wParam)
-{
- TRACE("%lx\n", wParam);
-
- if(GetWindowLongW(infoPtr->hwndSelf, GWL_STYLE) & MCS_MULTISELECT) {
- infoPtr->maxSelCount = wParam;
+MONTHCAL_SetMaxSelCount(MONTHCAL_INFO *infoPtr, INT max)
+{
+ TRACE("%d\n", max);
+
+ if(infoPtr->dwStyle & MCS_MULTISELECT) {
+ infoPtr->maxSelCount = max;
}
return TRUE;
@@ -1085,20 +1045,16 @@
static LRESULT
-MONTHCAL_GetSelRange(const MONTHCAL_INFO *infoPtr, LPARAM lParam)
-{
- SYSTEMTIME *lprgSysTimeArray = (SYSTEMTIME *) lParam;
-
- TRACE("%lx\n", lParam);
-
- /* validate parameters */
-
- if((infoPtr==NULL) ||(lprgSysTimeArray==NULL)) return FALSE;
-
- if(GetWindowLongW(infoPtr->hwndSelf, GWL_STYLE) & MCS_MULTISELECT)
+MONTHCAL_GetSelRange(const MONTHCAL_INFO *infoPtr, SYSTEMTIME *range)
+{
+ TRACE("%p\n", range);
+
+ if(!range) return FALSE;
+
+ if(infoPtr->dwStyle & MCS_MULTISELECT)
{
- MONTHCAL_CopyTime(&infoPtr->maxSel, &lprgSysTimeArray[1]);
- MONTHCAL_CopyTime(&infoPtr->minSel, &lprgSysTimeArray[0]);
+ MONTHCAL_CopyTime(&infoPtr->maxSel, &range[1]);
+ MONTHCAL_CopyTime(&infoPtr->minSel, &range[0]);
TRACE("[min,max]=[%d %d]\n", infoPtr->minSel.wDay,
infoPtr->maxSel.wDay);
return TRUE;
}
@@ -1108,20 +1064,16 @@
static LRESULT
-MONTHCAL_SetSelRange(MONTHCAL_INFO *infoPtr, LPARAM lParam)
-{
- SYSTEMTIME *lprgSysTimeArray = (SYSTEMTIME *) lParam;
-
- TRACE("%lx\n", lParam);
-
- /* validate parameters */
-
- if((infoPtr==NULL) ||(lprgSysTimeArray==NULL)) return FALSE;
-
- if(GetWindowLongW(infoPtr->hwndSelf, GWL_STYLE) & MCS_MULTISELECT)
+MONTHCAL_SetSelRange(MONTHCAL_INFO *infoPtr, SYSTEMTIME *range)
+{
+ TRACE("%p\n", range);
+
+ if(!range) return FALSE;
+
+ if(infoPtr->dwStyle & MCS_MULTISELECT)
{
- MONTHCAL_CopyTime(&lprgSysTimeArray[1], &infoPtr->maxSel);
- MONTHCAL_CopyTime(&lprgSysTimeArray[0], &infoPtr->minSel);
+ MONTHCAL_CopyTime(&range[1], &infoPtr->maxSel);
+ MONTHCAL_CopyTime(&range[0], &infoPtr->minSel);
TRACE("[min,max]=[%d %d]\n", infoPtr->minSel.wDay,
infoPtr->maxSel.wDay);
return TRUE;
}
@@ -1131,40 +1083,34 @@
static LRESULT
-MONTHCAL_GetToday(const MONTHCAL_INFO *infoPtr, LPARAM lParam)
-{
- SYSTEMTIME *lpToday = (SYSTEMTIME *) lParam;
-
- TRACE("%lx\n", lParam);
-
- /* validate parameters */
-
- if((infoPtr==NULL) || (lpToday==NULL)) return FALSE;
- MONTHCAL_CopyTime(&infoPtr->todaysDate, lpToday);
+MONTHCAL_GetToday(const MONTHCAL_INFO *infoPtr, SYSTEMTIME *today)
+{
+ TRACE("%p\n", today);
+
+ if(!today) return FALSE;
+ MONTHCAL_CopyTime(&infoPtr->todaysDate, today);
return TRUE;
}
static LRESULT
-MONTHCAL_SetToday(MONTHCAL_INFO *infoPtr, LPARAM lParam)
-{
- SYSTEMTIME *lpToday = (SYSTEMTIME *) lParam;
-
- TRACE("%lx\n", lParam);
-
- /* validate parameters */
-
- if((infoPtr==NULL) ||(lpToday==NULL)) return FALSE;
- MONTHCAL_CopyTime(lpToday, &infoPtr->todaysDate);
+MONTHCAL_SetToday(MONTHCAL_INFO *infoPtr, SYSTEMTIME *today)
+{
+ TRACE("%p\n", today);
+
+ if(!today) return FALSE;
+
+ if(MONTHCAL_IsDateEqual(today, &infoPtr->todaysDate)) return TRUE;
+
+ MONTHCAL_CopyTime(today, &infoPtr->todaysDate);
InvalidateRect(infoPtr->hwndSelf, NULL, FALSE);
return TRUE;
}
static LRESULT
-MONTHCAL_HitTest(const MONTHCAL_INFO *infoPtr, LPARAM lParam)
-{
- PMCHITTESTINFO lpht = (PMCHITTESTINFO)lParam;
+MONTHCAL_HitTest(const MONTHCAL_INFO *infoPtr, MCHITTESTINFO *lpht)
+{
UINT x,y;
DWORD retval;
int day,wday,wnum;
@@ -1282,8 +1228,6 @@
static void MONTHCAL_GoToNextMonth(MONTHCAL_INFO *infoPtr)
{
- DWORD dwStyle = GetWindowLongW(infoPtr->hwndSelf, GWL_STYLE);
-
TRACE("MONTHCAL_GoToNextMonth\n");
infoPtr->currentMonth++;
@@ -1292,7 +1236,7 @@
infoPtr->currentMonth = 1;
}
- if(dwStyle & MCS_DAYSTATE) {
+ if(infoPtr->dwStyle & MCS_DAYSTATE) {
NMDAYSTATE nmds;
int i;
@@ -1316,8 +1260,6 @@
static void MONTHCAL_GoToPrevMonth(MONTHCAL_INFO *infoPtr)
{
- DWORD dwStyle = GetWindowLongW(infoPtr->hwndSelf, GWL_STYLE);
-
TRACE("\n");
infoPtr->currentMonth--;
@@ -1326,7 +1268,7 @@
infoPtr->currentMonth = 12;
}
- if(dwStyle & MCS_DAYSTATE) {
+ if(infoPtr->dwStyle & MCS_DAYSTATE) {
NMDAYSTATE nmds;
int i;
@@ -1410,7 +1352,7 @@
ht.pt.x = (short)LOWORD(lParam);
ht.pt.y = (short)HIWORD(lParam);
- hit = MONTHCAL_HitTest(infoPtr, (LPARAM)&ht);
+ hit = MONTHCAL_HitTest(infoPtr, &ht);
/* FIXME: these flags should be checked by */
/*((hit & MCHT_XXX) == MCHT_XXX) b/c some of the flags are */
@@ -1507,8 +1449,8 @@
MONTHCAL_CopyTime(&ht.st, &selArray[0]);
MONTHCAL_CopyTime(&ht.st, &selArray[1]);
- MONTHCAL_SetSelRange(infoPtr, (LPARAM)selArray);
- MONTHCAL_SetCurSel(infoPtr, (LPARAM)selArray);
+ MONTHCAL_SetSelRange(infoPtr, selArray);
+ MONTHCAL_SetCurSel(infoPtr, &selArray[0]);
TRACE("MCHT_CALENDARDATE\n");
nmsc.nmhdr.hwndFrom = infoPtr->hwndSelf;
nmsc.nmhdr.idFrom = GetWindowLongPtrW(infoPtr->hwndSelf, GWLP_ID);
@@ -1562,7 +1504,7 @@
ht.pt.x = (short)LOWORD(lParam);
ht.pt.y = (short)HIWORD(lParam);
- hit = MONTHCAL_HitTest(infoPtr, (LPARAM)&ht);
+ hit = MONTHCAL_HitTest(infoPtr, &ht);
infoPtr->status = MC_SEL_LBUTUP;
@@ -1641,7 +1583,7 @@
ht.pt.x = (short)LOWORD(lParam);
ht.pt.y = (short)HIWORD(lParam);
- hit = MONTHCAL_HitTest(infoPtr, (LPARAM)&ht);
+ hit = MONTHCAL_HitTest(infoPtr, &ht);
/* not on the calendar date numbers? bail out */
TRACE("hit:%x\n",hit);
@@ -1652,11 +1594,11 @@
infoPtr->curSelDay = selday;
MONTHCAL_CalcPosFromDay(infoPtr, selday, ht.st. wMonth, &r);
- if(GetWindowLongW(infoPtr->hwndSelf, GWL_STYLE) & MCS_MULTISELECT) {
+ if(infoPtr->dwStyle & MCS_MULTISELECT) {
SYSTEMTIME selArray[2];
int i;
- MONTHCAL_GetSelRange(infoPtr, (LPARAM)selArray);
+ MONTHCAL_GetSelRange(infoPtr, selArray);
i = 0;
if(infoPtr->firstSelDay==selArray[0].wDay) i=1;
TRACE("oldRange:%d %d %d %d\n", infoPtr->firstSelDay, selArray[0].wDay,
selArray[1].wDay, i);
@@ -1686,7 +1628,7 @@
selArray[0].wDay = tempday;
}
- MONTHCAL_SetSelRange(infoPtr, (LPARAM)selArray);
+ MONTHCAL_SetSelRange(infoPtr, selArray);
}
}
@@ -1703,21 +1645,21 @@
static LRESULT
-MONTHCAL_Paint(MONTHCAL_INFO *infoPtr, WPARAM wParam)
+MONTHCAL_Paint(MONTHCAL_INFO *infoPtr, HDC hdc_paint)
{
HDC hdc;
PAINTSTRUCT ps;
- if (wParam)
+ if (hdc_paint)
{
GetClientRect(infoPtr->hwndSelf, &ps.rcPaint);
- hdc = (HDC)wParam;
+ hdc = hdc_paint;
}
else
hdc = BeginPaint(infoPtr->hwndSelf, &ps);
MONTHCAL_Refresh(infoPtr, hdc, &ps);
- if (!wParam) EndPaint(infoPtr->hwndSelf, &ps);
+ if (!hdc_paint) EndPaint(infoPtr->hwndSelf, &ps);
return 0;
}
@@ -1763,7 +1705,6 @@
RECT *todayrect=&infoPtr->todayrect;
SIZE size;
TEXTMETRICW tm;
- DWORD dwStyle = GetWindowLongW(infoPtr->hwndSelf, GWL_STYLE);
HFONT currentFont;
int xdiv, left_offset;
RECT rcClient;
@@ -1781,7 +1722,7 @@
/* recalculate the height and width increments and offsets */
GetTextExtentPoint32W(hdc, O0W, 2, &size);
- xdiv = (dwStyle & MCS_WEEKNUMBERS) ? 8 : 7;
+ xdiv = (infoPtr->dwStyle & MCS_WEEKNUMBERS) ? 8 : 7;
infoPtr->width_increment = size.cx * 2 + 4;
infoPtr->height_increment = infoPtr->textHeight;
@@ -1811,7 +1752,7 @@
/* setup the dimensions of the rectangle we draw the names of the */
/* days of the week in */
weeknumrect->left = left_offset;
- if(dwStyle & MCS_WEEKNUMBERS)
+ if(infoPtr->dwStyle & MCS_WEEKNUMBERS)
weeknumrect->right=prev->right;
else
weeknumrect->right=weeknumrect->left;
@@ -1890,9 +1831,22 @@
return 0;
}
+static INT MONTHCAL_StyleChanged(MONTHCAL_INFO *infoPtr, WPARAM wStyleType,
+ const STYLESTRUCT *lpss)
+{
+ TRACE("(styletype=%lx, styleOld=0x%08x, styleNew=0x%08x)\n",
+ wStyleType, lpss->styleOld, lpss->styleNew);
+
+ if (wStyleType != GWL_STYLE) return 0;
+
+ infoPtr->dwStyle = lpss->styleNew;
+
+ return 0;
+}
+
/* FIXME: check whether dateMin/dateMax need to be adjusted. */
static LRESULT
-MONTHCAL_Create(HWND hwnd, LPARAM lParam)
+MONTHCAL_Create(HWND hwnd, LPCREATESTRUCTW lpcs)
{
MONTHCAL_INFO *infoPtr;
@@ -1906,7 +1860,8 @@
}
infoPtr->hwndSelf = hwnd;
- infoPtr->hwndNotify = ((LPCREATESTRUCTW)lParam)->hwndParent;
+ infoPtr->hwndNotify = lpcs->hwndParent;
+ infoPtr->dwStyle = GetWindowLongW(hwnd, GWL_STYLE);
MONTHCAL_SetFont(infoPtr, GetStockObject(DEFAULT_GUI_FONT), FALSE);
@@ -1915,7 +1870,7 @@
GetLocalTime(&infoPtr->todaysDate);
infoPtr->firstDayHighWord = FALSE;
- MONTHCAL_SetFirstDayOfWeek(infoPtr, (LPARAM)-1);
+ MONTHCAL_SetFirstDayOfWeek(infoPtr, -1);
infoPtr->currentMonth = infoPtr->todaysDate.wMonth;
infoPtr->currentYear = infoPtr->todaysDate.wYear;
MONTHCAL_CopyTime(&infoPtr->todaysDate, &infoPtr->minDate);
@@ -1974,10 +1929,10 @@
switch(uMsg)
{
case MCM_GETCURSEL:
- return MONTHCAL_GetCurSel(infoPtr, lParam);
+ return MONTHCAL_GetCurSel(infoPtr, (LPSYSTEMTIME)lParam);
case MCM_SETCURSEL:
- return MONTHCAL_SetCurSel(infoPtr, lParam);
+ return MONTHCAL_SetCurSel(infoPtr, (LPSYSTEMTIME)lParam);
case MCM_GETMAXSELCOUNT:
return MONTHCAL_GetMaxSelCount(infoPtr);
@@ -1986,46 +1941,46 @@
return MONTHCAL_SetMaxSelCount(infoPtr, wParam);
case MCM_GETSELRANGE:
- return MONTHCAL_GetSelRange(infoPtr, lParam);
+ return MONTHCAL_GetSelRange(infoPtr, (LPSYSTEMTIME)lParam);
case MCM_SETSELRANGE:
- return MONTHCAL_SetSelRange(infoPtr, lParam);
+ return MONTHCAL_SetSelRange(infoPtr, (LPSYSTEMTIME)lParam);
case MCM_GETMONTHRANGE:
return MONTHCAL_GetMonthRange(infoPtr);
case MCM_SETDAYSTATE:
- return MONTHCAL_SetDayState(infoPtr, wParam, lParam);
+ return MONTHCAL_SetDayState(infoPtr, (INT)wParam, (LPMONTHDAYSTATE)lParam);
case MCM_GETMINREQRECT:
- return MONTHCAL_GetMinReqRect(infoPtr, lParam);
+ return MONTHCAL_GetMinReqRect(infoPtr, (LPRECT)lParam);
case MCM_GETCOLOR:
return MONTHCAL_GetColor(infoPtr, wParam);
case MCM_SETCOLOR:
- return MONTHCAL_SetColor(infoPtr, wParam, lParam);
+ return MONTHCAL_SetColor(infoPtr, wParam, (COLORREF)lParam);
case MCM_GETTODAY:
- return MONTHCAL_GetToday(infoPtr, lParam);
+ return MONTHCAL_GetToday(infoPtr, (LPSYSTEMTIME)lParam);
case MCM_SETTODAY:
- return MONTHCAL_SetToday(infoPtr, lParam);
+ return MONTHCAL_SetToday(infoPtr, (LPSYSTEMTIME)lParam);
case MCM_HITTEST:
- return MONTHCAL_HitTest(infoPtr, lParam);
+ return MONTHCAL_HitTest(infoPtr, (PMCHITTESTINFO)lParam);
case MCM_GETFIRSTDAYOFWEEK:
return MONTHCAL_GetFirstDayOfWeek(infoPtr);
case MCM_SETFIRSTDAYOFWEEK:
- return MONTHCAL_SetFirstDayOfWeek(infoPtr, lParam);
+ return MONTHCAL_SetFirstDayOfWeek(infoPtr, (INT)lParam);
case MCM_GETRANGE:
- return MONTHCAL_GetRange(hwnd, lParam);
+ return MONTHCAL_GetRange(infoPtr, (LPSYSTEMTIME)lParam);
case MCM_SETRANGE:
- return MONTHCAL_SetRange(infoPtr, wParam, lParam);
+ return MONTHCAL_SetRange(infoPtr, (SHORT)wParam, (LPSYSTEMTIME)lParam);
case MCM_GETMONTHDELTA:
return MONTHCAL_GetMonthDelta(infoPtr);
@@ -2056,7 +2011,7 @@
case WM_PRINTCLIENT:
case WM_PAINT:
- return MONTHCAL_Paint(infoPtr, wParam);
+ return MONTHCAL_Paint(infoPtr, (HDC)wParam);
case WM_SETFOCUS:
return MONTHCAL_SetFocus(infoPtr);
@@ -2065,7 +2020,7 @@
return MONTHCAL_Size(infoPtr, (SHORT)LOWORD(lParam), (SHORT)HIWORD(lParam));
case WM_CREATE:
- return MONTHCAL_Create(hwnd, lParam);
+ return MONTHCAL_Create(hwnd, (LPCREATESTRUCTW)lParam);
case WM_SETFONT:
return MONTHCAL_SetFont(infoPtr, (HFONT)wParam, (BOOL)lParam);
@@ -2085,6 +2040,9 @@
case WM_SYSCOLORCHANGE:
COMCTL32_RefreshSysColors();
return 0;
+
+ case WM_STYLECHANGED:
+ return MONTHCAL_StyleChanged(infoPtr, wParam, (LPSTYLESTRUCT)lParam);
default:
if ((uMsg >= WM_USER) && (uMsg < WM_APP) &&
!COMCTL32_IsReflectedMessage(uMsg))
Modified: trunk/reactos/dll/win32/comctl32/trackbar.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/trackba…
==============================================================================
--- trunk/reactos/dll/win32/comctl32/trackbar.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/comctl32/trackbar.c [iso-8859-1] Sat Sep 26 12:45:59 2009
@@ -155,7 +155,7 @@
if (infoPtr->uTicFreq && infoPtr->lRangeMax >=
infoPtr->lRangeMin) {
nrTics=(infoPtr->lRangeMax - infoPtr->lRangeMin)/infoPtr->uTicFreq;
/* don't add extra tic if there's no remainder */
- if ((infoPtr->lRangeMax - infoPtr->lRangeMin) % infoPtr->uTicFreq == 0)
+ if (nrTics && ((infoPtr->lRangeMax - infoPtr->lRangeMin) %
infoPtr->uTicFreq == 0))
nrTics--;
}
else {
@@ -1294,9 +1294,6 @@
static inline LRESULT
TRACKBAR_SetTic (TRACKBAR_INFO *infoPtr, LONG lPos)
{
- if (infoPtr->dwStyle & TBS_AUTOTICKS)
- return FALSE;
-
if ((lPos < infoPtr->lRangeMin) || (lPos> infoPtr->lRangeMax))
return FALSE;
@@ -1408,7 +1405,7 @@
infoPtr->lSelMin = 0;
infoPtr->lSelMax = 0;
infoPtr->lPos = 0;
- infoPtr->fLocation = -1;
+ infoPtr->fLocation = TBTS_TOP;
infoPtr->uNumTics = 0; /* start and end tic are not included in count*/
infoPtr->uTicFreq = 1;
infoPtr->tics = NULL;
Modified: trunk/reactos/dll/win32/comctl32/updown.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/updown.…
==============================================================================
--- trunk/reactos/dll/win32/comctl32/updown.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/comctl32/updown.c [iso-8859-1] Sat Sep 26 12:45:59 2009
@@ -86,6 +86,7 @@
#define FLAG_DECR 0x02
#define FLAG_MOUSEIN 0x04
#define FLAG_PRESSED 0x08
+#define FLAG_BUDDYINT 0x10 /* UDS_SETBUDDYINT was set on creation */
#define FLAG_ARROW (FLAG_INCR | FLAG_DECR)
#define BUDDY_TYPE_UNKNOWN 0
@@ -267,7 +268,7 @@
WCHAR txt[20], sep, *src, *dst;
int newVal;
- if (!((infoPtr->dwStyle & UDS_SETBUDDYINT) &&
IsWindow(infoPtr->Buddy)))
+ if (!((infoPtr->Flags & FLAG_BUDDYINT) &&
IsWindow(infoPtr->Buddy)))
return FALSE;
/*if the buddy is a list window, we must set curr index */
@@ -312,7 +313,7 @@
WCHAR txt[20];
int len;
- if (!((infoPtr->dwStyle & UDS_SETBUDDYINT) &&
IsWindow(infoPtr->Buddy)))
+ if (!((infoPtr->Flags & FLAG_BUDDYINT) &&
IsWindow(infoPtr->Buddy)))
return FALSE;
TRACE("set new value(%d) to buddy.\n", infoPtr->CurVal);
@@ -328,7 +329,7 @@
/* Do thousands separation if necessary */
- if (!(infoPtr->dwStyle & UDS_NOTHOUSANDS) && (len > 3)) {
+ if ((infoPtr->Base == 10) && !(infoPtr->dwStyle & UDS_NOTHOUSANDS)
&& (len > 3)) {
WCHAR tmp[COUNT_OF(txt)], *src = tmp, *dst = txt;
WCHAR sep = UPDOWN_GetThousandSep();
int start = len % 3;
@@ -520,20 +521,25 @@
UPDOWN_Buddy_SubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
WNDPROC superClassWndProc = (WNDPROC)GetPropW(hwnd, BUDDY_SUPERCLASS_WNDPROC);
+ HWND upDownHwnd = GetPropW(hwnd, BUDDY_UPDOWN_HWND);
+ UPDOWN_INFO *infoPtr = UPDOWN_GetInfoPtr(upDownHwnd);
TRACE("hwnd=%p, wndProc=%p, uMsg=%04x, wParam=%08lx, lParam=%08lx\n",
hwnd, superClassWndProc, uMsg, wParam, lParam);
- if (uMsg == WM_KEYDOWN) {
- HWND upDownHwnd = GetPropW(hwnd, BUDDY_UPDOWN_HWND);
-
- UPDOWN_KeyPressed(UPDOWN_GetInfoPtr(upDownHwnd), (int)wParam);
+ switch(uMsg)
+ {
+ case WM_KEYDOWN:
+ UPDOWN_KeyPressed(infoPtr, (int)wParam);
if ((wParam == VK_UP) || (wParam == VK_DOWN)) return 0;
- }
- else if (uMsg == WM_MOUSEWHEEL) {
- HWND upDownHwnd = GetPropW(hwnd, BUDDY_UPDOWN_HWND);
-
- UPDOWN_MouseWheel(UPDOWN_GetInfoPtr(upDownHwnd), (int)wParam);
+ break;
+
+ case WM_MOUSEWHEEL:
+ UPDOWN_MouseWheel(infoPtr, (int)wParam);
+ break;
+
+ default:
+ break;
}
return CallWindowProcW( superClassWndProc, hwnd, uMsg, wParam, lParam);
@@ -586,7 +592,7 @@
infoPtr->BuddyType = BUDDY_TYPE_LISTBOX;
}
- if(infoPtr->dwStyle & UDS_ARROWKEYS){
+ if (infoPtr->dwStyle & UDS_ARROWKEYS) {
/* Note that I don't clear the BUDDY_SUPERCLASS_WNDPROC property
when we reset the upDown ctrl buddy to another buddy because it is not
good to break the window proc chain. */
@@ -865,7 +871,7 @@
infoPtr->MaxVal = 0;
infoPtr->Base = 10; /* Default to base 10 */
infoPtr->Buddy = 0; /* No buddy window yet */
- infoPtr->Flags = 0; /* And no flags */
+ infoPtr->Flags = (infoPtr->dwStyle & UDS_SETBUDDYINT) ? FLAG_BUDDYINT :
0;
SetWindowLongW (hwnd, GWL_STYLE, infoPtr->dwStyle & ~WS_BORDER);
@@ -1031,9 +1037,13 @@
case UDM_SETBASE:
TRACE("UpDown Ctrl new base(%ld), hwnd=%p\n", wParam, hwnd);
if (wParam==10 || wParam==16) {
- WPARAM temp = infoPtr->Base;
+ WPARAM old_base = infoPtr->Base;
infoPtr->Base = wParam;
- return temp;
+
+ if (old_base != infoPtr->Base)
+ UPDOWN_SetBuddyInt(infoPtr);
+
+ return old_base;
}
break;
@@ -1045,8 +1055,8 @@
case UDM_GETPOS:
{
- int temp = UPDOWN_GetBuddyInt (infoPtr);
- return MAKELONG(infoPtr->CurVal, temp ? 0 : 1);
+ BOOL ret = UPDOWN_GetBuddyInt (infoPtr);
+ return MAKELONG(infoPtr->CurVal, ret ? 0 : 1);
}
case UDM_SETPOS:
{
@@ -1083,9 +1093,11 @@
break;
case UDM_GETPOS32:
- if ((LPBOOL)lParam != NULL) *((LPBOOL)lParam) = TRUE;
+ {
+ BOOL ret = UPDOWN_GetBuddyInt (infoPtr);
+ if ((LPBOOL)lParam) *((LPBOOL)lParam) = !ret;
return infoPtr->CurVal;
-
+ }
case UDM_SETPOS32:
{
int temp;
Modified: trunk/reactos/dll/win32/comdlg32/filedlg.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comdlg32/filedlg…
==============================================================================
--- trunk/reactos/dll/win32/comdlg32/filedlg.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/comdlg32/filedlg.c [iso-8859-1] Sat Sep 26 12:45:59 2009
@@ -910,7 +910,7 @@
WideCharToMultiByte(CP_ACP, 0, lpstrPath, -1,
(LPSTR)lParam, (int)wParam, NULL, NULL);
}
- retval = lstrlenW(lpstrPath);
+ retval = lstrlenW(lpstrPath) + 1;
break;
case CDM_GETFOLDERIDLIST: