diff --git a/reactos/dll/win32/comctl32/comboex.c b/reactos/dll/win32/comctl32/comboex.c index a98243d1472..afd4f824d6a 100644 --- a/reactos/dll/win32/comctl32/comboex.c +++ b/reactos/dll/win32/comctl32/comboex.c @@ -530,13 +530,11 @@ static UINT COMBOEX_GetListboxText(COMBOEX_INFO *infoPtr, int n, LPWSTR buf) static INT COMBOEX_DeleteItem (COMBOEX_INFO *infoPtr, INT index) { - CBE_ITEMDATA const *item; - TRACE("(index=%d)\n", index); /* if item number requested does not exist then return failure */ if ((index >= infoPtr->nb_items) || (index < 0)) return CB_ERR; - if (!(item = COMBOEX_FindItem(infoPtr, index))) return CB_ERR; + if (!COMBOEX_FindItem(infoPtr, index)) return CB_ERR; /* doing this will result in WM_DELETEITEM being issued */ SendMessageW (infoPtr->hwndCombo, CB_DELETESTRING, (WPARAM)index, 0); @@ -1269,6 +1267,9 @@ static LRESULT COMBOEX_Command (COMBOEX_INFO *infoPtr, WPARAM wParam, LPARAM lPa InvalidateRect (infoPtr->hwndCombo, 0, 0); return 0; + case CBN_SETFOCUS: + return SendMessageW (parent, WM_COMMAND, wParam, (LPARAM)infoPtr->hwndSelf); + default: /* * We have to change the handle since we are the control @@ -1602,9 +1603,11 @@ static LRESULT COMBOEX_Destroy (COMBOEX_INFO *infoPtr) if (infoPtr->defaultFont) DeleteObject (infoPtr->defaultFont); + SetWindowLongPtrW (infoPtr->hwndSelf, 0, 0); + /* free comboex info data */ Free (infoPtr); - SetWindowLongPtrW (infoPtr->hwndSelf, 0, 0); + return 0; } @@ -1635,7 +1638,7 @@ static LRESULT COMBOEX_NCCreate (HWND hwnd) oldstyle = (DWORD)GetWindowLongW (hwnd, GWL_STYLE); newstyle = oldstyle & ~(WS_VSCROLL | WS_HSCROLL | WS_BORDER); if (newstyle != oldstyle) { - TRACE("req style %08x, reseting style %08x\n", + TRACE("req style %08x, resetting style %08x\n", oldstyle, newstyle); SetWindowLongW (hwnd, GWL_STYLE, newstyle); } diff --git a/reactos/dll/win32/comctl32/comctl_Sv.rc b/reactos/dll/win32/comctl32/comctl_Sv.rc index fb4673abd85..2037d797c24 100644 --- a/reactos/dll/win32/comctl32/comctl_Sv.rc +++ b/reactos/dll/win32/comctl32/comctl_Sv.rc @@ -16,7 +16,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -LANGUAGE LANG_SWEDISH, SUBLANG_DEFAULT +LANGUAGE LANG_SWEDISH, SUBLANG_NEUTRAL IDD_PROPSHEET DIALOG DISCARDABLE 0, 0, 220, 140 STYLE DS_CONTEXTHELP | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE diff --git a/reactos/dll/win32/comctl32/commctrl.c b/reactos/dll/win32/comctl32/commctrl.c index 554eb4dde9f..4ff20753020 100644 --- a/reactos/dll/win32/comctl32/commctrl.c +++ b/reactos/dll/win32/comctl32/commctrl.c @@ -535,18 +535,27 @@ void WINAPI DrawStatusTextW (HDC hdc, LPCRECT lprc, LPCWSTR text, UINT style) if (text) { int oldbkmode = SetBkMode (hdc, TRANSPARENT); UINT align = DT_LEFT; - if (*text == '\t') { - text++; - align = DT_CENTER; - if (*text == '\t') { - text++; - align = DT_RIGHT; - } - } - r.left += 3; + int strCnt = 0; + if (style & SBT_RTLREADING) - FIXME("Unsupported RTL style!\n"); - DrawTextW (hdc, text, -1, &r, align|DT_VCENTER|DT_SINGLELINE|DT_NOPREFIX); + FIXME("Unsupported RTL style!\n"); + r.left += 3; + do { + if (*text == '\t') { + if (strCnt) { + DrawTextW (hdc, text - strCnt, strCnt, &r, align|DT_VCENTER|DT_SINGLELINE|DT_NOPREFIX); + strCnt = 0; + } + if (align==DT_RIGHT) { + break; + } + align = (align==DT_LEFT ? DT_CENTER : DT_RIGHT); + } else { + strCnt++; + } + } while(*text++); + + if (strCnt) DrawTextW (hdc, text - strCnt, -1, &r, align|DT_VCENTER|DT_SINGLELINE|DT_NOPREFIX); SetBkMode(hdc, oldbkmode); } } diff --git a/reactos/dll/win32/comctl32/header.c b/reactos/dll/win32/comctl32/header.c index 5757f7a664a..af1923ce6e7 100644 --- a/reactos/dll/win32/comctl32/header.c +++ b/reactos/dll/win32/comctl32/header.c @@ -111,7 +111,6 @@ static LRESULT HEADER_SendNotify(HWND hwnd, UINT code, NMHDR *hdr); static LRESULT HEADER_SendCtrlCustomDraw(HWND hwnd, DWORD dwDrawStage, HDC hdc, const RECT *rect); static const WCHAR themeClass[] = {'H','e','a','d','e','r',0}; -static WCHAR emptyString[] = {0}; static void HEADER_StoreHDItemInHeader(HEADER_ITEM *lpItem, UINT mask, const HDITEMW *phdi, BOOL fUnicode) { @@ -146,11 +145,13 @@ static void HEADER_StoreHDItemInHeader(HEADER_ITEM *lpItem, UINT mask, const HDI if (phdi->pszText != LPSTR_TEXTCALLBACKW) /* covers != TEXTCALLBACKA too */ { - LPWSTR pszText = (phdi->pszText != NULL ? phdi->pszText : emptyString); + static const WCHAR emptyString[] = {0}; + + LPCWSTR pszText = (phdi->pszText != NULL ? phdi->pszText : emptyString); if (fUnicode) Str_SetPtrW(&lpItem->pszText, pszText); else - Str_SetPtrAtoW(&lpItem->pszText, (LPSTR)pszText); + Str_SetPtrAtoW(&lpItem->pszText, (LPCSTR)pszText); lpItem->callbackMask &= ~HDI_TEXT; } else diff --git a/reactos/dll/win32/comctl32/ipaddress.c b/reactos/dll/win32/comctl32/ipaddress.c index a9e980b462b..c29406fd186 100644 --- a/reactos/dll/win32/comctl32/ipaddress.c +++ b/reactos/dll/win32/comctl32/ipaddress.c @@ -170,6 +170,8 @@ static LRESULT IPADDRESS_Create (HWND hwnd, const CREATESTRUCTA *lpCreate) IPADDRESS_INFO *infoPtr; RECT rcClient, edit; int i, fieldsize; + HFONT hFont, hSysFont; + LOGFONTW logFont, logSysFont; TRACE("\n"); @@ -191,6 +193,12 @@ static LRESULT IPADDRESS_Create (HWND hwnd, const CREATESTRUCTA *lpCreate) infoPtr->Enabled = TRUE; infoPtr->Notify = lpCreate->hwndParent; + hSysFont = (HFONT) GetStockObject(ANSI_VAR_FONT); + GetObjectW(hSysFont, sizeof(LOGFONTW), &logSysFont); + SystemParametersInfoW(SPI_GETICONTITLELOGFONT, 0, &logFont, 0); + strcpyW(logFont.lfFaceName, logSysFont.lfFaceName); + hFont = CreateFontIndirectW(&logFont); + for (i = 0; i < 4; i++) { IPPART_INFO* part = &infoPtr->Part[i]; @@ -203,6 +211,7 @@ static LRESULT IPADDRESS_Create (HWND hwnd, const CREATESTRUCTA *lpCreate) edit.left, edit.top, edit.right - edit.left, edit.bottom - edit.top, hwnd, (HMENU) 1, (HINSTANCE)GetWindowLongPtrW(hwnd, GWLP_HINSTANCE), NULL); + SendMessageW(part->EditHwnd, WM_SETFONT, (WPARAM) hFont, FALSE); SetPropW(part->EditHwnd, IP_SUBCLASS_PROP, hwnd); part->OrigProc = (WNDPROC) SetWindowLongPtrW (part->EditHwnd, GWLP_WNDPROC, diff --git a/reactos/dll/win32/comctl32/listview.c b/reactos/dll/win32/comctl32/listview.c index abe1470e9b5..6b16a7bbab7 100644 --- a/reactos/dll/win32/comctl32/listview.c +++ b/reactos/dll/win32/comctl32/listview.c @@ -91,7 +91,6 @@ * Extended Styles * -- LVS_EX_BORDERSELECT * -- LVS_EX_FLATSB - * -- LVS_EX_GRIDLINES * -- LVS_EX_HEADERDRAGDROP * -- LVS_EX_INFOTIP * -- LVS_EX_LABELTIP @@ -1639,6 +1638,7 @@ static void LISTVIEW_UpdateHeaderSize(const LISTVIEW_INFO *infoPtr, INT nNewScro SetWindowPos(infoPtr->hwndHeader,0, point[0].x,point[0].y,point[1].x,point[1].y, + (infoPtr->dwStyle & LVS_NOCOLUMNHEADER) ? SWP_HIDEWINDOW : SWP_SHOWWINDOW | SWP_NOZORDER | SWP_NOACTIVATE); } @@ -2495,6 +2495,8 @@ static INT LISTVIEW_CalculateItemHeight(const LISTVIEW_INFO *infoPtr) else { nItemHeight = infoPtr->ntmHeight; + if (uView == LVS_REPORT && infoPtr->dwLvExStyle & LVS_EX_GRIDLINES) + nItemHeight++; if (infoPtr->himlState) nItemHeight = max(nItemHeight, infoPtr->iconStateSize.cy); if (infoPtr->himlSmall) @@ -3338,26 +3340,26 @@ static LRESULT LISTVIEW_MouseMove(LISTVIEW_INFO *infoPtr, WORD fwKeys, INT x, IN else infoPtr->bLButtonDown = FALSE; - /* see if we are supposed to be tracking mouse hovering */ - if(infoPtr->dwLvExStyle & LVS_EX_TRACKSELECT) { - /* fill in the trackinfo struct */ - trackinfo.cbSize = sizeof(TRACKMOUSEEVENT); - trackinfo.dwFlags = TME_QUERY; - trackinfo.hwndTrack = infoPtr->hwndSelf; - trackinfo.dwHoverTime = infoPtr->dwHoverTime; + /* see if we are supposed to be tracking mouse hovering */ + if(infoPtr->dwLvExStyle & LVS_EX_TRACKSELECT) { + /* fill in the trackinfo struct */ + trackinfo.cbSize = sizeof(TRACKMOUSEEVENT); + trackinfo.dwFlags = TME_QUERY; + trackinfo.hwndTrack = infoPtr->hwndSelf; + trackinfo.dwHoverTime = infoPtr->dwHoverTime; - /* see if we are already tracking this hwnd */ - _TrackMouseEvent(&trackinfo); + /* see if we are already tracking this hwnd */ + _TrackMouseEvent(&trackinfo); - if(!(trackinfo.dwFlags & TME_HOVER)) { - trackinfo.dwFlags = TME_HOVER; + if(!(trackinfo.dwFlags & TME_HOVER)) { + trackinfo.dwFlags = TME_HOVER; - /* call TRACKMOUSEEVENT so we receive WM_MOUSEHOVER messages */ - _TrackMouseEvent(&trackinfo); + /* call TRACKMOUSEEVENT so we receive WM_MOUSEHOVER messages */ + _TrackMouseEvent(&trackinfo); + } } - } - return 0; + return 0; } @@ -3873,6 +3875,11 @@ static BOOL LISTVIEW_DrawItem(LISTVIEW_INFO *infoPtr, HDC hdc, INT nItem, INT nS else rcLabel.left += LABEL_HOR_PADDING; } else if (uFormat & DT_RIGHT) rcLabel.right -= LABEL_HOR_PADDING; + + /* for GRIDLINES reduce the bottom so the text formats correctly */ + if (uView == LVS_REPORT && infoPtr->dwLvExStyle & LVS_EX_GRIDLINES) + rcLabel.bottom--; + DrawTextW(hdc, lvItem.pszText, -1, &rcLabel, uFormat); postpaint: @@ -4027,6 +4034,89 @@ static void LISTVIEW_RefreshReport(LISTVIEW_INFO *infoPtr, ITERATOR *i, HDC hdc, iterator_destroy(&j); } +/*** + * DESCRIPTION: + * Draws the gridlines if necessary when in report display mode. + * + * PARAMETER(S): + * [I] infoPtr : valid pointer to the listview structure + * [I] hdc : device context handle + * + * RETURN: + * None + */ +static void LISTVIEW_RefreshReportGrid(LISTVIEW_INFO *infoPtr, HDC hdc) +{ + INT rgntype; + INT y, itemheight; + HPEN hPen, hOldPen; + RECT rcClip, rcItem; + POINT Origin; + RANGE colRange; + ITERATOR j; + + TRACE("()\n"); + + /* figure out what to draw */ + rgntype = GetClipBox(hdc, &rcClip); + if (rgntype == NULLREGION) return; + + /* Get scroll info once before loop */ + LISTVIEW_GetOrigin(infoPtr, &Origin); + + /* narrow down the columns we need to paint */ + for(colRange.lower = 0; colRange.lower < DPA_GetPtrCount(infoPtr->hdpaColumns); colRange.lower++) + { + LISTVIEW_GetHeaderRect(infoPtr, colRange.lower, &rcItem); + if (rcItem.right + Origin.x >= rcClip.left) break; + } + for(colRange.upper = DPA_GetPtrCount(infoPtr->hdpaColumns); colRange.upper > 0; colRange.upper--) + { + LISTVIEW_GetHeaderRect(infoPtr, colRange.upper - 1, &rcItem); + if (rcItem.left + Origin.x < rcClip.right) break; + } + iterator_rangeitems(&j, colRange); + + if ((hPen = CreatePen( PS_SOLID, 1, comctl32_color.clr3dFace ))) + { + hOldPen = SelectObject ( hdc, hPen ); + + /* draw the vertical lines for the columns */ + iterator_rangeitems(&j, colRange); + while(iterator_next(&j)) + { + LISTVIEW_GetHeaderRect(infoPtr, j.nItem, &rcItem); + if (rcItem.left == 0) continue; /* skip first column */ + rcItem.left += Origin.x; + rcItem.right += Origin.x; + rcItem.top = infoPtr->rcList.top; + rcItem.bottom = infoPtr->rcList.bottom; + TRACE("vert col=%d, rcItem=%s\n", j.nItem, wine_dbgstr_rect(&rcItem)); + MoveToEx (hdc, rcItem.left, rcItem.top, NULL); + LineTo (hdc, rcItem.left, rcItem.bottom); + } + iterator_destroy(&j); + + /* draw the horizontial lines for the rows */ + itemheight = LISTVIEW_CalculateItemHeight(infoPtr); + rcItem.left = infoPtr->rcList.left + Origin.x; + rcItem.right = infoPtr->rcList.right + Origin.x; + rcItem.bottom = rcItem.top = Origin.y - 1; + MoveToEx(hdc, rcItem.left, rcItem.top, NULL); + LineTo(hdc, rcItem.right, rcItem.top); + for(y=itemheight-1+Origin.y; y<=infoPtr->rcList.bottom; y+=itemheight) + { + rcItem.bottom = rcItem.top = y; + TRACE("horz rcItem=%s\n", wine_dbgstr_rect(&rcItem)); + MoveToEx (hdc, rcItem.left, rcItem.top, NULL); + LineTo (hdc, rcItem.right, rcItem.top); + } + + SelectObject( hdc, hOldPen ); + DeleteObject( hPen ); + } +} + /*** * DESCRIPTION: * Draws listview items when in list display mode. @@ -4175,6 +4265,12 @@ static void LISTVIEW_Refresh(LISTVIEW_INFO *infoPtr, HDC hdc, const RECT *prcEra iterator_destroy(&i); enddraw: + /* For LVS_EX_GRIDLINES go and draw lines */ + /* This includes the case where there were *no* items */ + if ((infoPtr->dwStyle & LVS_TYPEMASK) == LVS_REPORT && + infoPtr->dwLvExStyle & LVS_EX_GRIDLINES) + LISTVIEW_RefreshReportGrid(infoPtr, hdc); + if (cdmode & CDRF_NOTIFYPOSTPAINT) notify_postpaint(infoPtr, &nmlvcd); @@ -4362,7 +4458,7 @@ static HIMAGELIST LISTVIEW_CreateDragImage(LISTVIEW_INFO *infoPtr, INT iItem, LP * SUCCESS : TRUE * FAILURE : FALSE */ -static BOOL LISTVIEW_DeleteAllItems(LISTVIEW_INFO *infoPtr) +static BOOL LISTVIEW_DeleteAllItems(LISTVIEW_INFO *infoPtr, BOOL destroy) { NMLISTVIEW nmlv; HDPA hdpaSubItems = NULL; @@ -4406,8 +4502,11 @@ static BOOL LISTVIEW_DeleteAllItems(LISTVIEW_INFO *infoPtr) infoPtr->nItemCount --; } - LISTVIEW_Arrange(infoPtr, LVA_DEFAULT); - LISTVIEW_UpdateScroll(infoPtr); + if (!destroy) + { + LISTVIEW_Arrange(infoPtr, LVA_DEFAULT); + LISTVIEW_UpdateScroll(infoPtr); + } LISTVIEW_InvalidateList(infoPtr); return TRUE; @@ -5125,6 +5224,9 @@ static BOOL LISTVIEW_GetColumnT(const LISTVIEW_INFO *infoPtr, INT nColumn, LPLVC if (lpColumn->mask & LVCF_ORDER) hdi.mask |= HDI_ORDER; + if (lpColumn->mask & LVCF_SUBITEM) + hdi.mask |= HDI_LPARAM; + if (!SendMessageW(infoPtr->hwndHeader, isW ? HDM_GETITEMW : HDM_GETITEMA, nColumn, (LPARAM)&hdi)) return FALSE; if (lpColumn->mask & LVCF_FMT) @@ -5139,6 +5241,9 @@ static BOOL LISTVIEW_GetColumnT(const LISTVIEW_INFO *infoPtr, INT nColumn, LPLVC if (lpColumn->mask & LVCF_ORDER) lpColumn->iOrder = hdi.iOrder; + if (lpColumn->mask & LVCF_SUBITEM) + lpColumn->iSubItem = hdi.lParam; + return TRUE; } @@ -7039,6 +7144,13 @@ static DWORD LISTVIEW_SetExtendedListViewStyle(LISTVIEW_INFO *infoPtr, DWORD dwM SetWindowLongW(infoPtr->hwndHeader, GWL_STYLE, dwStyle); } + /* GRIDLINES adds decoration at top so changes sizes */ + if((infoPtr->dwLvExStyle ^ dwOldExStyle) & LVS_EX_GRIDLINES) + { + LISTVIEW_UpdateSize(infoPtr); + } + + LISTVIEW_InvalidateList(infoPtr); return dwOldExStyle; } @@ -7419,10 +7531,9 @@ static BOOL LISTVIEW_SetItemState(LISTVIEW_INFO *infoPtr, INT nItem, const LVITE */ if (bResult && (lvItem.state & lvItem.stateMask & LVIS_SELECTED) && - ((infoPtr->nSelectionMark == -1) || (lvItem.iItem <= infoPtr->nSelectionMark))) + (infoPtr->nSelectionMark == -1)) { int i; - infoPtr->nSelectionMark = -1; for (i = 0; i < infoPtr->nItemCount; i++) { if (infoPtr->uCallbackMask & LVIS_SELECTED) @@ -7888,6 +7999,7 @@ static LRESULT LISTVIEW_Create(HWND hwnd, const CREATESTRUCTW *lpcs) { LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)GetWindowLongPtrW(hwnd, 0); UINT uView = lpcs->style & LVS_TYPEMASK; + DWORD dFlags = WS_CHILD | HDS_HORZ | HDS_FULLDRAG | HDS_DRAGDROP; TRACE("(lpcs=%p)\n", lpcs); @@ -7895,9 +8007,12 @@ static LRESULT LISTVIEW_Create(HWND hwnd, const CREATESTRUCTW *lpcs) infoPtr->notifyFormat = SendMessageW(infoPtr->hwndNotify, WM_NOTIFYFORMAT, (WPARAM)infoPtr->hwndSelf, (LPARAM)NF_QUERY); + /* setup creation flags */ + dFlags |= (LVS_NOSORTHEADER & lpcs->style) ? 0 : HDS_BUTTONS; + dFlags |= (LVS_NOCOLUMNHEADER & lpcs->style) ? HDS_HIDDEN : 0; + /* create header */ - infoPtr->hwndHeader = CreateWindowW(WC_HEADERW, NULL, - WS_CHILD | HDS_HORZ | HDS_FULLDRAG | (DWORD)((LVS_NOSORTHEADER & lpcs->style)?0:HDS_BUTTONS), + infoPtr->hwndHeader = CreateWindowW(WC_HEADERW, NULL, dFlags, 0, 0, 0, 0, hwnd, NULL, lpcs->hInstance, NULL); if (!infoPtr->hwndHeader) return -1; @@ -7917,12 +8032,8 @@ static LRESULT LISTVIEW_Create(HWND hwnd, const CREATESTRUCTW *lpcs) { ShowWindow(infoPtr->hwndHeader, SW_SHOWNORMAL); } - else - { - /* set HDS_HIDDEN flag to hide the header bar */ - SetWindowLongW(infoPtr->hwndHeader, GWL_STYLE, - GetWindowLongW(infoPtr->hwndHeader, GWL_STYLE) | HDS_HIDDEN); - } + LISTVIEW_UpdateSize(infoPtr); + LISTVIEW_UpdateScroll(infoPtr); } OpenThemeData(hwnd, themeClass); @@ -8404,7 +8515,7 @@ static LRESULT LISTVIEW_KillFocus(LISTVIEW_INFO *infoPtr) /* set window focus flag */ infoPtr->bFocus = FALSE; - /* invalidate the selected items before reseting focus flag */ + /* invalidate the selected items before resetting focus flag */ LISTVIEW_InvalidateSelectedItems(infoPtr); return 0; @@ -8628,7 +8739,7 @@ static LRESULT LISTVIEW_NCDestroy(LISTVIEW_INFO *infoPtr) TRACE("()\n"); /* delete all items */ - LISTVIEW_DeleteAllItems(infoPtr); + LISTVIEW_DeleteAllItems(infoPtr, TRUE); /* destroy data structure */ DPA_Destroy(infoPtr->hdpaItems); @@ -8870,11 +8981,10 @@ static LRESULT LISTVIEW_NotifyFormat(LISTVIEW_INFO *infoPtr, HWND hwndFrom, INT { TRACE("(hwndFrom=%p, nCommand=%d)\n", hwndFrom, nCommand); - if (nCommand != NF_REQUERY) return 0; - - infoPtr->notifyFormat = SendMessageW(hwndFrom, WM_NOTIFYFORMAT, (WPARAM)infoPtr->hwndSelf, NF_QUERY); - - return 0; + if (nCommand == NF_REQUERY) + infoPtr->notifyFormat = SendMessageW(hwndFrom, WM_NOTIFYFORMAT, (WPARAM)infoPtr->hwndSelf, NF_QUERY); + + return infoPtr->notifyFormat; } /*** @@ -9157,7 +9267,11 @@ static LRESULT LISTVIEW_SetFont(LISTVIEW_INFO *infoPtr, HFONT hFont, WORD fRedra LISTVIEW_SaveTextMetrics(infoPtr); if ((infoPtr->dwStyle & LVS_TYPEMASK) == LVS_REPORT) + { SendMessageW(infoPtr->hwndHeader, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(fRedraw, 0)); + LISTVIEW_UpdateSize(infoPtr); + LISTVIEW_UpdateScroll(infoPtr); + } if (fRedraw) LISTVIEW_InvalidateList(infoPtr); @@ -9268,7 +9382,7 @@ static void LISTVIEW_UpdateSize(LISTVIEW_INFO *infoPtr) infoPtr->rcList.bottom -= GetSystemMetrics(SM_CYHSCROLL); infoPtr->rcList.bottom = max (infoPtr->rcList.bottom - 2, 0); } - else if (uView == LVS_REPORT && !(infoPtr->dwStyle & LVS_NOCOLUMNHEADER)) + else if (uView == LVS_REPORT) { HDLAYOUT hl; WINDOWPOS wp; @@ -9276,10 +9390,14 @@ static void LISTVIEW_UpdateSize(LISTVIEW_INFO *infoPtr) hl.prc = &infoPtr->rcList; hl.pwpos = ℘ SendMessageW( infoPtr->hwndHeader, HDM_LAYOUT, 0, (LPARAM)&hl ); - - SetWindowPos(wp.hwnd, wp.hwndInsertAfter, wp.x, wp.y, wp.cx, wp.cy, wp.flags); + TRACE(" wp.flags=0x%08x, wp=%d,%d (%dx%d)\n", wp.flags, wp.x, wp.y, wp.cx, wp.cy); + SetWindowPos(wp.hwnd, wp.hwndInsertAfter, wp.x, wp.y, wp.cx, wp.cy, + wp.flags | ((infoPtr->dwStyle & LVS_NOCOLUMNHEADER) + ? SWP_HIDEWINDOW : SWP_SHOWWINDOW)); + TRACE(" after SWP wp=%d,%d (%dx%d)\n", wp.x, wp.y, wp.cx, wp.cy); infoPtr->rcList.top = max(wp.cy, 0); + infoPtr->rcList.top += (infoPtr->dwLvExStyle & LVS_EX_GRIDLINES) ? 2 : 0; } TRACE(" rcList=%s\n", wine_dbgstr_rect(&infoPtr->rcList)); @@ -9302,6 +9420,7 @@ static INT LISTVIEW_StyleChanged(LISTVIEW_INFO *infoPtr, WPARAM wStyleType, { UINT uNewView = lpss->styleNew & LVS_TYPEMASK; UINT uOldView = lpss->styleOld & LVS_TYPEMASK; + UINT style; TRACE("(styletype=%lx, styleOld=0x%08x, styleNew=0x%08x)\n", wStyleType, lpss->styleOld, lpss->styleNew); @@ -9354,15 +9473,35 @@ static INT LISTVIEW_StyleChanged(LISTVIEW_INFO *infoPtr, WPARAM wStyleType, hl.prc = &infoPtr->rcList; hl.pwpos = ℘ SendMessageW( infoPtr->hwndHeader, HDM_LAYOUT, 0, (LPARAM)&hl ); - SetWindowPos(infoPtr->hwndHeader, infoPtr->hwndSelf, wp.x, wp.y, wp.cx, wp.cy, wp.flags); + SetWindowPos(infoPtr->hwndHeader, infoPtr->hwndSelf, wp.x, wp.y, wp.cx, wp.cy, + wp.flags | ((infoPtr->dwStyle & LVS_NOCOLUMNHEADER) + ? SWP_HIDEWINDOW : SWP_SHOWWINDOW)); } LISTVIEW_UpdateItemSize(infoPtr); } if (uNewView == LVS_REPORT) - ShowWindow(infoPtr->hwndHeader, (lpss->styleNew & LVS_NOCOLUMNHEADER) ? SW_HIDE : SW_SHOWNORMAL); - + { + if ((lpss->styleOld ^ lpss->styleNew) & LVS_NOCOLUMNHEADER) + { + if (lpss->styleNew & LVS_NOCOLUMNHEADER) + { + /* Turn off the header control */ + style = GetWindowLongW(infoPtr->hwndHeader, GWL_STYLE); + TRACE("Hide header control, was 0x%08x\n", style); + SetWindowLongW(infoPtr->hwndHeader, GWL_STYLE, style | HDS_HIDDEN); + } else { + /* Turn on the header control */ + if ((style = GetWindowLongW(infoPtr->hwndHeader, GWL_STYLE)) & HDS_HIDDEN) + { + TRACE("Show header control, was 0x%08x\n", style); + SetWindowLongW(infoPtr->hwndHeader, GWL_STYLE, (style & ~HDS_HIDDEN) | WS_VISIBLE); + } + } + } + } + if ( (uNewView == LVS_ICON || uNewView == LVS_SMALLICON) && (uNewView != uOldView || ((lpss->styleNew ^ lpss->styleOld) & LVS_ALIGNMASK)) ) LISTVIEW_Arrange(infoPtr, LVA_DEFAULT); @@ -9408,7 +9547,7 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) return (LRESULT)LISTVIEW_CreateDragImage(infoPtr, (INT)wParam, (LPPOINT)lParam); case LVM_DELETEALLITEMS: - return LISTVIEW_DeleteAllItems(infoPtr); + return LISTVIEW_DeleteAllItems(infoPtr, FALSE); case LVM_DELETECOLUMN: return LISTVIEW_DeleteColumn(infoPtr, (INT)wParam); @@ -9528,6 +9667,8 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) case LVM_GETORIGIN: if (!lParam) return FALSE; + if ((infoPtr->dwStyle & LVS_TYPEMASK) == LVS_REPORT || + (infoPtr->dwStyle & LVS_TYPEMASK) == LVS_LIST) return FALSE; LISTVIEW_GetOrigin(infoPtr, (LPPOINT)lParam); return TRUE; @@ -9968,10 +10109,9 @@ static LRESULT LISTVIEW_Command(const LISTVIEW_INFO *infoPtr, WPARAM wParam, LPA HFONT hFont, hOldFont = 0; RECT rect; SIZE sz; - int len; if (!infoPtr->hwndEdit || !hdc) return 0; - len = GetWindowTextW(infoPtr->hwndEdit, buffer, sizeof(buffer)/sizeof(buffer[0])); + GetWindowTextW(infoPtr->hwndEdit, buffer, sizeof(buffer)/sizeof(buffer[0])); GetWindowRect(infoPtr->hwndEdit, &rect); /* Select font to get the right dimension of the string */ diff --git a/reactos/dll/win32/comctl32/monthcal.c b/reactos/dll/win32/comctl32/monthcal.c index 1c325de4508..a9647cd74a6 100644 --- a/reactos/dll/win32/comctl32/monthcal.c +++ b/reactos/dll/win32/comctl32/monthcal.c @@ -442,7 +442,7 @@ static void MONTHCAL_Refresh(MONTHCAL_INFO *infoPtr, HDC hdc, const PAINTSTRUCT RECT *days=&dayrect; RECT rtoday; int i, j, m, mask, day, firstDay, weeknum, weeknum1,prevMonth; - int textHeight = infoPtr->textHeight, textWidth = infoPtr->textWidth; + int textHeight = infoPtr->textHeight; SIZE size; HBRUSH hbr; HFONT currentFont; @@ -659,13 +659,11 @@ static void MONTHCAL_Refresh(MONTHCAL_INFO *infoPtr, HDC hdc, const PAINTSTRUCT * date if necessary */ if(!(dwStyle & MCS_NOTODAY)) { - int offset = 0; if(!(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), infoPtr->currentMonth); - offset+=textWidth; } if (!LoadStringW(COMCTL32_hModule,IDM_TODAY,buf1,countof(buf1))) { diff --git a/reactos/dll/win32/comctl32/pager.c b/reactos/dll/win32/comctl32/pager.c index 2150c438d57..11a78a93d55 100644 --- a/reactos/dll/win32/comctl32/pager.c +++ b/reactos/dll/win32/comctl32/pager.c @@ -555,8 +555,8 @@ static INT PAGER_SetFixedWidth(PAGER_INFO* infoPtr) { /* Must set the non-scrollable dimension to be less than the full height/width - * so that NCCalcSize is called. The Msoft docs mention 3/4 factor for button - * size, and experimentation shows that affect is almost right. */ + * so that NCCalcSize is called. The Microsoft docs mention 3/4 factor for button + * size, and experimentation shows that the effect is almost right. */ RECT wndRect; INT delta, h; @@ -586,8 +586,8 @@ static INT PAGER_SetFixedHeight(PAGER_INFO* infoPtr) { /* Must set the non-scrollable dimension to be less than the full height/width - * so that NCCalcSize is called. The Msoft docs mention 3/4 factor for button - * size, and experimentation shows that affect is almost right. */ + * so that NCCalcSize is called. The Microsoft docs mention 3/4 factor for button + * size, and experimentation shows that the effect is almost right. */ RECT wndRect; INT delta, w; diff --git a/reactos/dll/win32/comctl32/propsheet.c b/reactos/dll/win32/comctl32/propsheet.c index 80afe83be94..09c32777565 100644 --- a/reactos/dll/win32/comctl32/propsheet.c +++ b/reactos/dll/win32/comctl32/propsheet.c @@ -3449,7 +3449,6 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) PropSheetInfo* psInfo = (PropSheetInfo*) lParam; WCHAR* strCaption = (WCHAR*)Alloc(MAX_CAPTION_LENGTH*sizeof(WCHAR)); HWND hwndTabCtrl = GetDlgItem(hwnd, IDC_TABCONTROL); - LPCPROPSHEETPAGEW ppshpage; int idx; LOGFONTW logFont; @@ -3545,7 +3544,6 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) PSCB_INITIALIZED, (LPARAM)0); idx = psInfo->active_page; - ppshpage = (LPCPROPSHEETPAGEW)psInfo->proppage[idx].hpage; psInfo->active_page = -1; PROPSHEET_SetCurSel(hwnd, idx, 1, psInfo->proppage[idx].hpage); diff --git a/reactos/dll/win32/comctl32/rebar.c b/reactos/dll/win32/comctl32/rebar.c index 033b47489bb..638acea20f1 100644 --- a/reactos/dll/win32/comctl32/rebar.c +++ b/reactos/dll/win32/comctl32/rebar.c @@ -2848,7 +2848,6 @@ REBAR_Create (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) { LPCREATESTRUCTW cs = (LPCREATESTRUCTW) lParam; RECT wnrc1, clrc1; - HTHEME theme; if (TRACE_ON(rebar)) { GetWindowRect(infoPtr->hwndSelf, &wnrc1); @@ -2859,8 +2858,8 @@ REBAR_Create (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) } TRACE("created!\n"); - - if ((theme = OpenThemeData (infoPtr->hwndSelf, themeClass))) + + if (OpenThemeData (infoPtr->hwndSelf, themeClass)) { /* native seems to clear WS_BORDER when themed */ infoPtr->dwStyle &= ~WS_BORDER; diff --git a/reactos/dll/win32/comctl32/status.c b/reactos/dll/win32/comctl32/status.c index e704635d043..464e650855d 100644 --- a/reactos/dll/win32/comctl32/status.c +++ b/reactos/dll/win32/comctl32/status.c @@ -984,12 +984,6 @@ STATUSBAR_WMCreate (HWND hwnd, const CREATESTRUCTA *lpCreate) dwStyle = GetWindowLongW (hwnd, GWL_STYLE); /* native seems to clear WS_BORDER, too */ dwStyle &= ~WS_BORDER; - - /* statusbars on managed windows should not have SIZEGRIP style */ - if ((dwStyle & SBARS_SIZEGRIP) && lpCreate->hwndParent && - GetPropA( lpCreate->hwndParent, "__wine_x11_managed" )) - dwStyle &= ~SBARS_SIZEGRIP; - SetWindowLongW (hwnd, GWL_STYLE, dwStyle); if ((hdc = GetDC (hwnd))) { diff --git a/reactos/dll/win32/comctl32/syslink.c b/reactos/dll/win32/comctl32/syslink.c index 02a0385b2ec..a1b8aff1e3f 100644 --- a/reactos/dll/win32/comctl32/syslink.c +++ b/reactos/dll/win32/comctl32/syslink.c @@ -967,16 +967,14 @@ static HFONT SYSLINK_SetFont (SYSLINK_INFO *infoPtr, HFONT hFont, BOOL bRedraw) */ static LRESULT SYSLINK_SetText (SYSLINK_INFO *infoPtr, LPCWSTR Text) { - int textlen; - /* clear the document */ SYSLINK_ClearDoc(infoPtr); - - if(Text == NULL || (textlen = lstrlenW(Text)) == 0) + + if(Text == NULL || *Text == 0) { return TRUE; } - + /* let's parse the string and create a document */ if(SYSLINK_ParseText(infoPtr, Text) > 0) { diff --git a/reactos/dll/win32/comctl32/tab.c b/reactos/dll/win32/comctl32/tab.c index 4b1673a6a87..62047e5a08f 100644 --- a/reactos/dll/win32/comctl32/tab.c +++ b/reactos/dll/win32/comctl32/tab.c @@ -1715,12 +1715,12 @@ TAB_DrawItemInterior(const TAB_INFO *infoPtr, HDC hdc, INT iItem, RECT *drawRect if(lStyle & TCS_VERTICAL) { center_offset_h = ((drawRect->bottom - drawRect->top) - (cy + infoPtr->uHItemPadding + (rcText.right - rcText.left))) / 2; - center_offset_v = (drawRect->left + (drawRect->right - drawRect->left) - cx) / 2; + center_offset_v = ((drawRect->right - drawRect->left) - cx) / 2; } else { center_offset_h = ((drawRect->right - drawRect->left) - (cx + infoPtr->uHItemPadding + (rcText.right - rcText.left))) / 2; - center_offset_v = (drawRect->top + (drawRect->bottom - drawRect->top) - cy) / 2; + center_offset_v = ((drawRect->bottom - drawRect->top) - cy) / 2; } /* if an item is selected, the icon is shifted up instead of down */ diff --git a/reactos/dll/win32/comctl32/toolbar.c b/reactos/dll/win32/comctl32/toolbar.c index 1bda0ccca63..bd37e193aab 100644 --- a/reactos/dll/win32/comctl32/toolbar.c +++ b/reactos/dll/win32/comctl32/toolbar.c @@ -1280,7 +1280,7 @@ TOOLBAR_WrapToolbar( HWND hwnd, DWORD dwStyle ) TBUTTON_INFO *btnPtr; INT x, cx, i, j; RECT rc; - BOOL bWrap, bButtonWrap; + BOOL bButtonWrap; /* When the toolbar window style is not TBSTYLE_WRAPABLE, */ /* no layout is necessary. Applications may use this style */ @@ -1314,7 +1314,6 @@ TOOLBAR_WrapToolbar( HWND hwnd, DWORD dwStyle ) for (i = 0; i < infoPtr->nNumButtons; i++ ) { - bWrap = FALSE; btnPtr[i].fsState &= ~TBSTATE_WRAP; if (btnPtr[i].fsState & TBSTATE_HIDDEN) @@ -2406,8 +2405,8 @@ TOOLBAR_CustomizeDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) SendDlgItemMessageW (hwnd, IDC_TOOLBARBTN_LBOX, LB_SETCURSEL, index, 0); SendDlgItemMessageW (hwnd, IDC_TOOLBARBTN_LBOX, LB_SETTOPINDEX, index, 0); - MakeDragList(GetDlgItem(hwnd, IDC_TOOLBARBTN_LBOX)); - MakeDragList(GetDlgItem(hwnd, IDC_AVAILBTN_LBOX)); + MakeDragList(GetDlgItem(hwnd, IDC_TOOLBARBTN_LBOX)); + MakeDragList(GetDlgItem(hwnd, IDC_AVAILBTN_LBOX)); /* set focus and disable buttons */ PostMessageW (hwnd, WM_USER, 0, 0); @@ -4762,7 +4761,7 @@ TOOLBAR_SetHotItem (HWND hwnd, WPARAM wParam) TRACE("hwnd = %p, nHit = %d\n", hwnd, (INT)wParam); - if ((INT)wParam > infoPtr->nNumButtons) + if ((INT)wParam >= infoPtr->nNumButtons) return infoPtr->nHotItem; if ((INT)wParam < 0) @@ -4985,7 +4984,7 @@ TOOLBAR_SetRows (HWND hwnd, WPARAM wParam, LPARAM lParam) /* FIXME: Separators make this quite complex */ if (seps) FIXME("Separators unhandled\n"); - /* Round up so more per line, ie less rows */ + /* Round up so more per line, i.e., less rows */ idealWrap = (infoPtr->nNumButtons - hidden + (rows-1)) / rows; /* Calculate ideal wrap point if we are allowed to grow, but cannot @@ -5779,7 +5778,6 @@ TOOLBAR_LButtonUp (HWND hwnd, WPARAM wParam, LPARAM lParam) POINT pt; INT nHit; INT nOldIndex = -1; - BOOL bSendMessage = TRUE; NMHDR hdr; NMMOUSE nmmouse; NMTOOLBARA nmtb; @@ -5866,8 +5864,6 @@ TOOLBAR_LButtonUp (HWND hwnd, WPARAM wParam, LPARAM lParam) if (btnPtr->fsStyle & BTNS_GROUP) { nOldIndex = TOOLBAR_GetCheckedGroupButtonIndex (infoPtr, nHit); - if (nOldIndex == nHit) - bSendMessage = FALSE; if ((nOldIndex != nHit) && (nOldIndex != -1)) infoPtr->buttons[nOldIndex].fsState &= ~TBSTATE_CHECKED; @@ -6075,7 +6071,7 @@ TOOLBAR_MouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam) /* call TRACKMOUSEEVENT so we receive a WM_MOUSELEAVE message */ /* and can properly deactivate the hot toolbar button */ _TrackMouseEvent(&trackinfo); - } + } } if (infoPtr->hwndToolTip) diff --git a/reactos/dll/win32/comctl32/tooltips.c b/reactos/dll/win32/comctl32/tooltips.c index efdc41e49e1..de9376faebf 100644 --- a/reactos/dll/win32/comctl32/tooltips.c +++ b/reactos/dll/win32/comctl32/tooltips.c @@ -883,7 +883,7 @@ static INT TOOLTIPS_GetToolFromInfoA (const TOOLTIPS_INFO *infoPtr, const TTTOOLINFOA *lpToolInfo) { TTTOOL_INFO *toolPtr; - INT nTool; + UINT nTool; for (nTool = 0; nTool < infoPtr->uNumTools; nTool++) { toolPtr = &infoPtr->tools[nTool]; @@ -910,7 +910,7 @@ static INT TOOLTIPS_GetToolFromInfoW (const TOOLTIPS_INFO *infoPtr, const TTTOOLINFOW *lpToolInfo) { TTTOOL_INFO *toolPtr; - INT nTool; + UINT nTool; for (nTool = 0; nTool < infoPtr->uNumTools; nTool++) { toolPtr = &infoPtr->tools[nTool]; @@ -937,7 +937,7 @@ static INT TOOLTIPS_GetToolFromPoint (const TOOLTIPS_INFO *infoPtr, HWND hwnd, const POINT *lpPt) { TTTOOL_INFO *toolPtr; - INT nTool; + UINT nTool; for (nTool = 0; nTool < infoPtr->uNumTools; nTool++) { toolPtr = &infoPtr->tools[nTool]; diff --git a/reactos/dll/win32/comctl32/trackbar.c b/reactos/dll/win32/comctl32/trackbar.c index 7cdfe71c606..a25f81ebdc9 100644 --- a/reactos/dll/win32/comctl32/trackbar.c +++ b/reactos/dll/win32/comctl32/trackbar.c @@ -822,7 +822,6 @@ TRACKBAR_Refresh (TRACKBAR_INFO *infoPtr, HDC hdcDst) HBITMAP hOldBmp = 0, hOffScreenBmp = 0; NMCUSTOMDRAW nmcd; int gcdrf, icdrf; - HTHEME theme; if (infoPtr->flags & TB_THUMBCHANGED) { TRACKBAR_UpdateThumb (infoPtr); @@ -867,7 +866,7 @@ TRACKBAR_Refresh (TRACKBAR_INFO *infoPtr, HDC hdcDst) /* Erase background */ if (gcdrf == CDRF_DODEFAULT || notify_customdraw(infoPtr, &nmcd, CDDS_PREERASE) != CDRF_SKIPDEFAULT) { - if ((theme = GetWindowTheme (infoPtr->hwndSelf))) { + if (GetWindowTheme (infoPtr->hwndSelf)) { DrawThemeParentBackground (infoPtr->hwndSelf, hdc, 0); } else @@ -1453,9 +1452,10 @@ TRACKBAR_Destroy (TRACKBAR_INFO *infoPtr) if (infoPtr->hwndToolTip) DestroyWindow (infoPtr->hwndToolTip); - Free (infoPtr); SetWindowLongPtrW (infoPtr->hwndSelf, 0, 0); CloseThemeData (GetWindowTheme (infoPtr->hwndSelf)); + Free (infoPtr); + return 0; } diff --git a/reactos/dll/win32/comctl32/treeview.c b/reactos/dll/win32/comctl32/treeview.c index e242880f199..dd3e0ee842e 100644 --- a/reactos/dll/win32/comctl32/treeview.c +++ b/reactos/dll/win32/comctl32/treeview.c @@ -1019,7 +1019,6 @@ static void TREEVIEW_FreeItem(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *item) { DPA_DeletePtr(infoPtr->items, DPA_GetPtrIndex(infoPtr->items, item)); - Free(item); if (infoPtr->selectedItem == item) infoPtr->selectedItem = NULL; if (infoPtr->hotItem == item) @@ -1032,6 +1031,7 @@ TREEVIEW_FreeItem(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *item) infoPtr->dropItem = NULL; if (infoPtr->insertMarkItem == item) infoPtr->insertMarkItem = NULL; + Free(item); } @@ -3292,7 +3292,7 @@ TREEVIEW_Expand(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem, scrollDist = nextItem->rect.top - orgNextTop; scrollRect.top = orgNextTop; - ScrollWindowEx (infoPtr->hwnd, 0, scrollDist, &scrollRect, NULL, + ScrollWindowEx (infoPtr->hwnd, 0, scrollDist, &scrollRect, &scrollRect, NULL, NULL, SW_ERASE | SW_INVALIDATE); TREEVIEW_Invalidate (infoPtr, wineItem); } else { @@ -3573,12 +3573,11 @@ TREEVIEW_Command(TREEVIEW_INFO *infoPtr, WPARAM wParam, LPARAM lParam) TREEVIEW_ITEM *editItem = infoPtr->selectedItem; HDC hdc = GetDC(infoPtr->hwndEdit); SIZE sz; - int len; HFONT hFont, hOldFont = 0; infoPtr->bLabelChanged = TRUE; - len = GetWindowTextW(infoPtr->hwndEdit, buffer, sizeof(buffer)/sizeof(buffer[0])); + GetWindowTextW(infoPtr->hwndEdit, buffer, sizeof(buffer)/sizeof(buffer[0])); /* Select font to get the right dimension of the string */ hFont = (HFONT)SendMessageW(infoPtr->hwndEdit, WM_GETFONT, 0, 0); diff --git a/reactos/dll/win32/comctl32/updown.c b/reactos/dll/win32/comctl32/updown.c index 74a96f652dd..a62e22134bd 100644 --- a/reactos/dll/win32/comctl32/updown.c +++ b/reactos/dll/win32/comctl32/updown.c @@ -469,6 +469,28 @@ static LRESULT UPDOWN_KeyPressed(UPDOWN_INFO *infoPtr, int key) return 0; } +/*********************************************************************** + * UPDOWN_MouseWheel + * + * Handle mouse wheel scrolling + */ +static LRESULT UPDOWN_MouseWheel(UPDOWN_INFO *infoPtr, WPARAM wParam) +{ + int iWheelDelta = GET_WHEEL_DELTA_WPARAM(wParam) / WHEEL_DELTA; + + if (wParam & (MK_SHIFT | MK_CONTROL)) + return 0; + + if (iWheelDelta != 0) + { + UPDOWN_GetBuddyInt(infoPtr); + UPDOWN_DoAction(infoPtr, abs(iWheelDelta), iWheelDelta > 0 ? FLAG_INCR : FLAG_DECR); + } + + return 1; +} + + /*********************************************************************** * UPDOWN_Buddy_SubclassProc used to handle messages sent to the buddy * control. @@ -486,6 +508,11 @@ UPDOWN_Buddy_SubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) UPDOWN_KeyPressed(UPDOWN_GetInfoPtr(upDownHwnd), (int)wParam); } + else if (uMsg == WM_MOUSEWHEEL) { + HWND upDownHwnd = GetPropW(hwnd, BUDDY_UPDOWN_HWND); + + UPDOWN_MouseWheel(UPDOWN_GetInfoPtr(upDownHwnd), (int)wParam); + } return CallWindowProcW( superClassWndProc, hwnd, uMsg, wParam, lParam); } @@ -929,6 +956,10 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam, L UPDOWN_HandleMouseEvent (infoPtr, message, (SHORT)LOWORD(lParam), (SHORT)HIWORD(lParam)); break; + case WM_MOUSEWHEEL: + UPDOWN_MouseWheel(infoPtr, wParam); + break; + case WM_KEYDOWN: if((infoPtr->dwStyle & UDS_ARROWKEYS) && UPDOWN_IsEnabled(infoPtr)) return UPDOWN_KeyPressed(infoPtr, (int)wParam);