Autosyncing with Wine HEAD

svn path=/trunk/; revision=34327
This commit is contained in:
Aleksey Bragin 2008-07-06 12:41:23 +00:00
parent 1cf2a0e35c
commit e1786e8952
18 changed files with 285 additions and 110 deletions

View file

@ -530,13 +530,11 @@ static UINT COMBOEX_GetListboxText(COMBOEX_INFO *infoPtr, int n, LPWSTR buf)
static INT COMBOEX_DeleteItem (COMBOEX_INFO *infoPtr, INT index) static INT COMBOEX_DeleteItem (COMBOEX_INFO *infoPtr, INT index)
{ {
CBE_ITEMDATA const *item;
TRACE("(index=%d)\n", index); TRACE("(index=%d)\n", index);
/* if item number requested does not exist then return failure */ /* if item number requested does not exist then return failure */
if ((index >= infoPtr->nb_items) || (index < 0)) return CB_ERR; 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 */ /* doing this will result in WM_DELETEITEM being issued */
SendMessageW (infoPtr->hwndCombo, CB_DELETESTRING, (WPARAM)index, 0); 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); InvalidateRect (infoPtr->hwndCombo, 0, 0);
return 0; return 0;
case CBN_SETFOCUS:
return SendMessageW (parent, WM_COMMAND, wParam, (LPARAM)infoPtr->hwndSelf);
default: default:
/* /*
* We have to change the handle since we are the control * 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) if (infoPtr->defaultFont)
DeleteObject (infoPtr->defaultFont); DeleteObject (infoPtr->defaultFont);
SetWindowLongPtrW (infoPtr->hwndSelf, 0, 0);
/* free comboex info data */ /* free comboex info data */
Free (infoPtr); Free (infoPtr);
SetWindowLongPtrW (infoPtr->hwndSelf, 0, 0);
return 0; return 0;
} }
@ -1635,7 +1638,7 @@ static LRESULT COMBOEX_NCCreate (HWND hwnd)
oldstyle = (DWORD)GetWindowLongW (hwnd, GWL_STYLE); oldstyle = (DWORD)GetWindowLongW (hwnd, GWL_STYLE);
newstyle = oldstyle & ~(WS_VSCROLL | WS_HSCROLL | WS_BORDER); newstyle = oldstyle & ~(WS_VSCROLL | WS_HSCROLL | WS_BORDER);
if (newstyle != oldstyle) { if (newstyle != oldstyle) {
TRACE("req style %08x, reseting style %08x\n", TRACE("req style %08x, resetting style %08x\n",
oldstyle, newstyle); oldstyle, newstyle);
SetWindowLongW (hwnd, GWL_STYLE, newstyle); SetWindowLongW (hwnd, GWL_STYLE, newstyle);
} }

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * 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 IDD_PROPSHEET DIALOG DISCARDABLE 0, 0, 220, 140
STYLE DS_CONTEXTHELP | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE STYLE DS_CONTEXTHELP | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE

View file

@ -535,18 +535,27 @@ void WINAPI DrawStatusTextW (HDC hdc, LPCRECT lprc, LPCWSTR text, UINT style)
if (text) { if (text) {
int oldbkmode = SetBkMode (hdc, TRANSPARENT); int oldbkmode = SetBkMode (hdc, TRANSPARENT);
UINT align = DT_LEFT; UINT align = DT_LEFT;
if (*text == '\t') { int strCnt = 0;
text++;
align = DT_CENTER;
if (*text == '\t') {
text++;
align = DT_RIGHT;
}
}
r.left += 3;
if (style & SBT_RTLREADING) if (style & SBT_RTLREADING)
FIXME("Unsupported RTL style!\n"); FIXME("Unsupported RTL style!\n");
DrawTextW (hdc, text, -1, &r, align|DT_VCENTER|DT_SINGLELINE|DT_NOPREFIX); 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); SetBkMode(hdc, oldbkmode);
} }
} }

View file

@ -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 LRESULT HEADER_SendCtrlCustomDraw(HWND hwnd, DWORD dwDrawStage, HDC hdc, const RECT *rect);
static const WCHAR themeClass[] = {'H','e','a','d','e','r',0}; 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) 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 */ 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) if (fUnicode)
Str_SetPtrW(&lpItem->pszText, pszText); Str_SetPtrW(&lpItem->pszText, pszText);
else else
Str_SetPtrAtoW(&lpItem->pszText, (LPSTR)pszText); Str_SetPtrAtoW(&lpItem->pszText, (LPCSTR)pszText);
lpItem->callbackMask &= ~HDI_TEXT; lpItem->callbackMask &= ~HDI_TEXT;
} }
else else

View file

@ -170,6 +170,8 @@ static LRESULT IPADDRESS_Create (HWND hwnd, const CREATESTRUCTA *lpCreate)
IPADDRESS_INFO *infoPtr; IPADDRESS_INFO *infoPtr;
RECT rcClient, edit; RECT rcClient, edit;
int i, fieldsize; int i, fieldsize;
HFONT hFont, hSysFont;
LOGFONTW logFont, logSysFont;
TRACE("\n"); TRACE("\n");
@ -191,6 +193,12 @@ static LRESULT IPADDRESS_Create (HWND hwnd, const CREATESTRUCTA *lpCreate)
infoPtr->Enabled = TRUE; infoPtr->Enabled = TRUE;
infoPtr->Notify = lpCreate->hwndParent; 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++) { for (i = 0; i < 4; i++) {
IPPART_INFO* part = &infoPtr->Part[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.left, edit.top, edit.right - edit.left,
edit.bottom - edit.top, hwnd, (HMENU) 1, edit.bottom - edit.top, hwnd, (HMENU) 1,
(HINSTANCE)GetWindowLongPtrW(hwnd, GWLP_HINSTANCE), NULL); (HINSTANCE)GetWindowLongPtrW(hwnd, GWLP_HINSTANCE), NULL);
SendMessageW(part->EditHwnd, WM_SETFONT, (WPARAM) hFont, FALSE);
SetPropW(part->EditHwnd, IP_SUBCLASS_PROP, hwnd); SetPropW(part->EditHwnd, IP_SUBCLASS_PROP, hwnd);
part->OrigProc = (WNDPROC) part->OrigProc = (WNDPROC)
SetWindowLongPtrW (part->EditHwnd, GWLP_WNDPROC, SetWindowLongPtrW (part->EditHwnd, GWLP_WNDPROC,

View file

@ -91,7 +91,6 @@
* Extended Styles * Extended Styles
* -- LVS_EX_BORDERSELECT * -- LVS_EX_BORDERSELECT
* -- LVS_EX_FLATSB * -- LVS_EX_FLATSB
* -- LVS_EX_GRIDLINES
* -- LVS_EX_HEADERDRAGDROP * -- LVS_EX_HEADERDRAGDROP
* -- LVS_EX_INFOTIP * -- LVS_EX_INFOTIP
* -- LVS_EX_LABELTIP * -- LVS_EX_LABELTIP
@ -1639,6 +1638,7 @@ static void LISTVIEW_UpdateHeaderSize(const LISTVIEW_INFO *infoPtr, INT nNewScro
SetWindowPos(infoPtr->hwndHeader,0, SetWindowPos(infoPtr->hwndHeader,0,
point[0].x,point[0].y,point[1].x,point[1].y, point[0].x,point[0].y,point[1].x,point[1].y,
(infoPtr->dwStyle & LVS_NOCOLUMNHEADER) ? SWP_HIDEWINDOW : SWP_SHOWWINDOW |
SWP_NOZORDER | SWP_NOACTIVATE); SWP_NOZORDER | SWP_NOACTIVATE);
} }
@ -2495,6 +2495,8 @@ static INT LISTVIEW_CalculateItemHeight(const LISTVIEW_INFO *infoPtr)
else else
{ {
nItemHeight = infoPtr->ntmHeight; nItemHeight = infoPtr->ntmHeight;
if (uView == LVS_REPORT && infoPtr->dwLvExStyle & LVS_EX_GRIDLINES)
nItemHeight++;
if (infoPtr->himlState) if (infoPtr->himlState)
nItemHeight = max(nItemHeight, infoPtr->iconStateSize.cy); nItemHeight = max(nItemHeight, infoPtr->iconStateSize.cy);
if (infoPtr->himlSmall) if (infoPtr->himlSmall)
@ -3873,6 +3875,11 @@ static BOOL LISTVIEW_DrawItem(LISTVIEW_INFO *infoPtr, HDC hdc, INT nItem, INT nS
else rcLabel.left += LABEL_HOR_PADDING; else rcLabel.left += LABEL_HOR_PADDING;
} }
else if (uFormat & DT_RIGHT) rcLabel.right -= 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); DrawTextW(hdc, lvItem.pszText, -1, &rcLabel, uFormat);
postpaint: postpaint:
@ -4027,6 +4034,89 @@ static void LISTVIEW_RefreshReport(LISTVIEW_INFO *infoPtr, ITERATOR *i, HDC hdc,
iterator_destroy(&j); 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: * DESCRIPTION:
* Draws listview items when in list display mode. * 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); iterator_destroy(&i);
enddraw: 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) if (cdmode & CDRF_NOTIFYPOSTPAINT)
notify_postpaint(infoPtr, &nmlvcd); notify_postpaint(infoPtr, &nmlvcd);
@ -4362,7 +4458,7 @@ static HIMAGELIST LISTVIEW_CreateDragImage(LISTVIEW_INFO *infoPtr, INT iItem, LP
* SUCCESS : TRUE * SUCCESS : TRUE
* FAILURE : FALSE * FAILURE : FALSE
*/ */
static BOOL LISTVIEW_DeleteAllItems(LISTVIEW_INFO *infoPtr) static BOOL LISTVIEW_DeleteAllItems(LISTVIEW_INFO *infoPtr, BOOL destroy)
{ {
NMLISTVIEW nmlv; NMLISTVIEW nmlv;
HDPA hdpaSubItems = NULL; HDPA hdpaSubItems = NULL;
@ -4406,8 +4502,11 @@ static BOOL LISTVIEW_DeleteAllItems(LISTVIEW_INFO *infoPtr)
infoPtr->nItemCount --; infoPtr->nItemCount --;
} }
if (!destroy)
{
LISTVIEW_Arrange(infoPtr, LVA_DEFAULT); LISTVIEW_Arrange(infoPtr, LVA_DEFAULT);
LISTVIEW_UpdateScroll(infoPtr); LISTVIEW_UpdateScroll(infoPtr);
}
LISTVIEW_InvalidateList(infoPtr); LISTVIEW_InvalidateList(infoPtr);
return TRUE; return TRUE;
@ -5125,6 +5224,9 @@ static BOOL LISTVIEW_GetColumnT(const LISTVIEW_INFO *infoPtr, INT nColumn, LPLVC
if (lpColumn->mask & LVCF_ORDER) if (lpColumn->mask & LVCF_ORDER)
hdi.mask |= HDI_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 (!SendMessageW(infoPtr->hwndHeader, isW ? HDM_GETITEMW : HDM_GETITEMA, nColumn, (LPARAM)&hdi)) return FALSE;
if (lpColumn->mask & LVCF_FMT) 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) if (lpColumn->mask & LVCF_ORDER)
lpColumn->iOrder = hdi.iOrder; lpColumn->iOrder = hdi.iOrder;
if (lpColumn->mask & LVCF_SUBITEM)
lpColumn->iSubItem = hdi.lParam;
return TRUE; return TRUE;
} }
@ -7039,6 +7144,13 @@ static DWORD LISTVIEW_SetExtendedListViewStyle(LISTVIEW_INFO *infoPtr, DWORD dwM
SetWindowLongW(infoPtr->hwndHeader, GWL_STYLE, dwStyle); 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); LISTVIEW_InvalidateList(infoPtr);
return dwOldExStyle; 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) && if (bResult && (lvItem.state & lvItem.stateMask & LVIS_SELECTED) &&
((infoPtr->nSelectionMark == -1) || (lvItem.iItem <= infoPtr->nSelectionMark))) (infoPtr->nSelectionMark == -1))
{ {
int i; int i;
infoPtr->nSelectionMark = -1;
for (i = 0; i < infoPtr->nItemCount; i++) for (i = 0; i < infoPtr->nItemCount; i++)
{ {
if (infoPtr->uCallbackMask & LVIS_SELECTED) 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); LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)GetWindowLongPtrW(hwnd, 0);
UINT uView = lpcs->style & LVS_TYPEMASK; UINT uView = lpcs->style & LVS_TYPEMASK;
DWORD dFlags = WS_CHILD | HDS_HORZ | HDS_FULLDRAG | HDS_DRAGDROP;
TRACE("(lpcs=%p)\n", lpcs); 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, infoPtr->notifyFormat = SendMessageW(infoPtr->hwndNotify, WM_NOTIFYFORMAT,
(WPARAM)infoPtr->hwndSelf, (LPARAM)NF_QUERY); (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 */ /* create header */
infoPtr->hwndHeader = CreateWindowW(WC_HEADERW, NULL, infoPtr->hwndHeader = CreateWindowW(WC_HEADERW, NULL, dFlags,
WS_CHILD | HDS_HORZ | HDS_FULLDRAG | (DWORD)((LVS_NOSORTHEADER & lpcs->style)?0:HDS_BUTTONS),
0, 0, 0, 0, hwnd, NULL, 0, 0, 0, 0, hwnd, NULL,
lpcs->hInstance, NULL); lpcs->hInstance, NULL);
if (!infoPtr->hwndHeader) return -1; if (!infoPtr->hwndHeader) return -1;
@ -7917,12 +8032,8 @@ static LRESULT LISTVIEW_Create(HWND hwnd, const CREATESTRUCTW *lpcs)
{ {
ShowWindow(infoPtr->hwndHeader, SW_SHOWNORMAL); ShowWindow(infoPtr->hwndHeader, SW_SHOWNORMAL);
} }
else LISTVIEW_UpdateSize(infoPtr);
{ LISTVIEW_UpdateScroll(infoPtr);
/* set HDS_HIDDEN flag to hide the header bar */
SetWindowLongW(infoPtr->hwndHeader, GWL_STYLE,
GetWindowLongW(infoPtr->hwndHeader, GWL_STYLE) | HDS_HIDDEN);
}
} }
OpenThemeData(hwnd, themeClass); OpenThemeData(hwnd, themeClass);
@ -8404,7 +8515,7 @@ static LRESULT LISTVIEW_KillFocus(LISTVIEW_INFO *infoPtr)
/* set window focus flag */ /* set window focus flag */
infoPtr->bFocus = FALSE; infoPtr->bFocus = FALSE;
/* invalidate the selected items before reseting focus flag */ /* invalidate the selected items before resetting focus flag */
LISTVIEW_InvalidateSelectedItems(infoPtr); LISTVIEW_InvalidateSelectedItems(infoPtr);
return 0; return 0;
@ -8628,7 +8739,7 @@ static LRESULT LISTVIEW_NCDestroy(LISTVIEW_INFO *infoPtr)
TRACE("()\n"); TRACE("()\n");
/* delete all items */ /* delete all items */
LISTVIEW_DeleteAllItems(infoPtr); LISTVIEW_DeleteAllItems(infoPtr, TRUE);
/* destroy data structure */ /* destroy data structure */
DPA_Destroy(infoPtr->hdpaItems); 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); TRACE("(hwndFrom=%p, nCommand=%d)\n", hwndFrom, nCommand);
if (nCommand != NF_REQUERY) return 0; if (nCommand == NF_REQUERY)
infoPtr->notifyFormat = SendMessageW(hwndFrom, WM_NOTIFYFORMAT, (WPARAM)infoPtr->hwndSelf, NF_QUERY); infoPtr->notifyFormat = SendMessageW(hwndFrom, WM_NOTIFYFORMAT, (WPARAM)infoPtr->hwndSelf, NF_QUERY);
return 0; return infoPtr->notifyFormat;
} }
/*** /***
@ -9157,7 +9267,11 @@ static LRESULT LISTVIEW_SetFont(LISTVIEW_INFO *infoPtr, HFONT hFont, WORD fRedra
LISTVIEW_SaveTextMetrics(infoPtr); LISTVIEW_SaveTextMetrics(infoPtr);
if ((infoPtr->dwStyle & LVS_TYPEMASK) == LVS_REPORT) if ((infoPtr->dwStyle & LVS_TYPEMASK) == LVS_REPORT)
{
SendMessageW(infoPtr->hwndHeader, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(fRedraw, 0)); SendMessageW(infoPtr->hwndHeader, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(fRedraw, 0));
LISTVIEW_UpdateSize(infoPtr);
LISTVIEW_UpdateScroll(infoPtr);
}
if (fRedraw) LISTVIEW_InvalidateList(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 -= GetSystemMetrics(SM_CYHSCROLL);
infoPtr->rcList.bottom = max (infoPtr->rcList.bottom - 2, 0); 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; HDLAYOUT hl;
WINDOWPOS wp; WINDOWPOS wp;
@ -9276,10 +9390,14 @@ static void LISTVIEW_UpdateSize(LISTVIEW_INFO *infoPtr)
hl.prc = &infoPtr->rcList; hl.prc = &infoPtr->rcList;
hl.pwpos = &wp; hl.pwpos = &wp;
SendMessageW( infoPtr->hwndHeader, HDM_LAYOUT, 0, (LPARAM)&hl ); SendMessageW( infoPtr->hwndHeader, HDM_LAYOUT, 0, (LPARAM)&hl );
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); 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 = max(wp.cy, 0);
infoPtr->rcList.top += (infoPtr->dwLvExStyle & LVS_EX_GRIDLINES) ? 2 : 0;
} }
TRACE(" rcList=%s\n", wine_dbgstr_rect(&infoPtr->rcList)); 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 uNewView = lpss->styleNew & LVS_TYPEMASK;
UINT uOldView = lpss->styleOld & LVS_TYPEMASK; UINT uOldView = lpss->styleOld & LVS_TYPEMASK;
UINT style;
TRACE("(styletype=%lx, styleOld=0x%08x, styleNew=0x%08x)\n", TRACE("(styletype=%lx, styleOld=0x%08x, styleNew=0x%08x)\n",
wStyleType, lpss->styleOld, lpss->styleNew); wStyleType, lpss->styleOld, lpss->styleNew);
@ -9354,14 +9473,34 @@ static INT LISTVIEW_StyleChanged(LISTVIEW_INFO *infoPtr, WPARAM wStyleType,
hl.prc = &infoPtr->rcList; hl.prc = &infoPtr->rcList;
hl.pwpos = &wp; hl.pwpos = &wp;
SendMessageW( infoPtr->hwndHeader, HDM_LAYOUT, 0, (LPARAM)&hl ); 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); LISTVIEW_UpdateItemSize(infoPtr);
} }
if (uNewView == LVS_REPORT) 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) && if ( (uNewView == LVS_ICON || uNewView == LVS_SMALLICON) &&
(uNewView != uOldView || ((lpss->styleNew ^ lpss->styleOld) & LVS_ALIGNMASK)) ) (uNewView != uOldView || ((lpss->styleNew ^ lpss->styleOld) & LVS_ALIGNMASK)) )
@ -9408,7 +9547,7 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return (LRESULT)LISTVIEW_CreateDragImage(infoPtr, (INT)wParam, (LPPOINT)lParam); return (LRESULT)LISTVIEW_CreateDragImage(infoPtr, (INT)wParam, (LPPOINT)lParam);
case LVM_DELETEALLITEMS: case LVM_DELETEALLITEMS:
return LISTVIEW_DeleteAllItems(infoPtr); return LISTVIEW_DeleteAllItems(infoPtr, FALSE);
case LVM_DELETECOLUMN: case LVM_DELETECOLUMN:
return LISTVIEW_DeleteColumn(infoPtr, (INT)wParam); return LISTVIEW_DeleteColumn(infoPtr, (INT)wParam);
@ -9528,6 +9667,8 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case LVM_GETORIGIN: case LVM_GETORIGIN:
if (!lParam) return FALSE; if (!lParam) return FALSE;
if ((infoPtr->dwStyle & LVS_TYPEMASK) == LVS_REPORT ||
(infoPtr->dwStyle & LVS_TYPEMASK) == LVS_LIST) return FALSE;
LISTVIEW_GetOrigin(infoPtr, (LPPOINT)lParam); LISTVIEW_GetOrigin(infoPtr, (LPPOINT)lParam);
return TRUE; return TRUE;
@ -9968,10 +10109,9 @@ static LRESULT LISTVIEW_Command(const LISTVIEW_INFO *infoPtr, WPARAM wParam, LPA
HFONT hFont, hOldFont = 0; HFONT hFont, hOldFont = 0;
RECT rect; RECT rect;
SIZE sz; SIZE sz;
int len;
if (!infoPtr->hwndEdit || !hdc) return 0; 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); GetWindowRect(infoPtr->hwndEdit, &rect);
/* Select font to get the right dimension of the string */ /* Select font to get the right dimension of the string */

View file

@ -442,7 +442,7 @@ static void MONTHCAL_Refresh(MONTHCAL_INFO *infoPtr, HDC hdc, const PAINTSTRUCT
RECT *days=&dayrect; RECT *days=&dayrect;
RECT rtoday; RECT rtoday;
int i, j, m, mask, day, firstDay, weeknum, weeknum1,prevMonth; int i, j, m, mask, day, firstDay, weeknum, weeknum1,prevMonth;
int textHeight = infoPtr->textHeight, textWidth = infoPtr->textWidth; int textHeight = infoPtr->textHeight;
SIZE size; SIZE size;
HBRUSH hbr; HBRUSH hbr;
HFONT currentFont; HFONT currentFont;
@ -659,13 +659,11 @@ static void MONTHCAL_Refresh(MONTHCAL_INFO *infoPtr, HDC hdc, const PAINTSTRUCT
* date if necessary */ * date if necessary */
if(!(dwStyle & MCS_NOTODAY)) { if(!(dwStyle & MCS_NOTODAY)) {
int offset = 0;
if(!(dwStyle & MCS_NOTODAYCIRCLE)) { if(!(dwStyle & MCS_NOTODAYCIRCLE)) {
/*day is the number of days from nextmonth we put on the calendar */ /*day is the number of days from nextmonth we put on the calendar */
MONTHCAL_CircleDay(infoPtr, hdc, MONTHCAL_CircleDay(infoPtr, hdc,
day+MONTHCAL_MonthLength(infoPtr->currentMonth,infoPtr->currentYear), day+MONTHCAL_MonthLength(infoPtr->currentMonth,infoPtr->currentYear),
infoPtr->currentMonth); infoPtr->currentMonth);
offset+=textWidth;
} }
if (!LoadStringW(COMCTL32_hModule,IDM_TODAY,buf1,countof(buf1))) if (!LoadStringW(COMCTL32_hModule,IDM_TODAY,buf1,countof(buf1)))
{ {

View file

@ -555,8 +555,8 @@ static INT
PAGER_SetFixedWidth(PAGER_INFO* infoPtr) PAGER_SetFixedWidth(PAGER_INFO* infoPtr)
{ {
/* Must set the non-scrollable dimension to be less than the full height/width /* 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 * so that NCCalcSize is called. The Microsoft docs mention 3/4 factor for button
* size, and experimentation shows that affect is almost right. */ * size, and experimentation shows that the effect is almost right. */
RECT wndRect; RECT wndRect;
INT delta, h; INT delta, h;
@ -586,8 +586,8 @@ static INT
PAGER_SetFixedHeight(PAGER_INFO* infoPtr) PAGER_SetFixedHeight(PAGER_INFO* infoPtr)
{ {
/* Must set the non-scrollable dimension to be less than the full height/width /* 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 * so that NCCalcSize is called. The Microsoft docs mention 3/4 factor for button
* size, and experimentation shows that affect is almost right. */ * size, and experimentation shows that the effect is almost right. */
RECT wndRect; RECT wndRect;
INT delta, w; INT delta, w;

View file

@ -3449,7 +3449,6 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
PropSheetInfo* psInfo = (PropSheetInfo*) lParam; PropSheetInfo* psInfo = (PropSheetInfo*) lParam;
WCHAR* strCaption = (WCHAR*)Alloc(MAX_CAPTION_LENGTH*sizeof(WCHAR)); WCHAR* strCaption = (WCHAR*)Alloc(MAX_CAPTION_LENGTH*sizeof(WCHAR));
HWND hwndTabCtrl = GetDlgItem(hwnd, IDC_TABCONTROL); HWND hwndTabCtrl = GetDlgItem(hwnd, IDC_TABCONTROL);
LPCPROPSHEETPAGEW ppshpage;
int idx; int idx;
LOGFONTW logFont; LOGFONTW logFont;
@ -3545,7 +3544,6 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
PSCB_INITIALIZED, (LPARAM)0); PSCB_INITIALIZED, (LPARAM)0);
idx = psInfo->active_page; idx = psInfo->active_page;
ppshpage = (LPCPROPSHEETPAGEW)psInfo->proppage[idx].hpage;
psInfo->active_page = -1; psInfo->active_page = -1;
PROPSHEET_SetCurSel(hwnd, idx, 1, psInfo->proppage[idx].hpage); PROPSHEET_SetCurSel(hwnd, idx, 1, psInfo->proppage[idx].hpage);

View file

@ -2848,7 +2848,6 @@ REBAR_Create (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
{ {
LPCREATESTRUCTW cs = (LPCREATESTRUCTW) lParam; LPCREATESTRUCTW cs = (LPCREATESTRUCTW) lParam;
RECT wnrc1, clrc1; RECT wnrc1, clrc1;
HTHEME theme;
if (TRACE_ON(rebar)) { if (TRACE_ON(rebar)) {
GetWindowRect(infoPtr->hwndSelf, &wnrc1); GetWindowRect(infoPtr->hwndSelf, &wnrc1);
@ -2860,7 +2859,7 @@ REBAR_Create (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
TRACE("created!\n"); TRACE("created!\n");
if ((theme = OpenThemeData (infoPtr->hwndSelf, themeClass))) if (OpenThemeData (infoPtr->hwndSelf, themeClass))
{ {
/* native seems to clear WS_BORDER when themed */ /* native seems to clear WS_BORDER when themed */
infoPtr->dwStyle &= ~WS_BORDER; infoPtr->dwStyle &= ~WS_BORDER;

View file

@ -984,12 +984,6 @@ STATUSBAR_WMCreate (HWND hwnd, const CREATESTRUCTA *lpCreate)
dwStyle = GetWindowLongW (hwnd, GWL_STYLE); dwStyle = GetWindowLongW (hwnd, GWL_STYLE);
/* native seems to clear WS_BORDER, too */ /* native seems to clear WS_BORDER, too */
dwStyle &= ~WS_BORDER; 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); SetWindowLongW (hwnd, GWL_STYLE, dwStyle);
if ((hdc = GetDC (hwnd))) { if ((hdc = GetDC (hwnd))) {

View file

@ -967,12 +967,10 @@ static HFONT SYSLINK_SetFont (SYSLINK_INFO *infoPtr, HFONT hFont, BOOL bRedraw)
*/ */
static LRESULT SYSLINK_SetText (SYSLINK_INFO *infoPtr, LPCWSTR Text) static LRESULT SYSLINK_SetText (SYSLINK_INFO *infoPtr, LPCWSTR Text)
{ {
int textlen;
/* clear the document */ /* clear the document */
SYSLINK_ClearDoc(infoPtr); SYSLINK_ClearDoc(infoPtr);
if(Text == NULL || (textlen = lstrlenW(Text)) == 0) if(Text == NULL || *Text == 0)
{ {
return TRUE; return TRUE;
} }

View file

@ -1715,12 +1715,12 @@ TAB_DrawItemInterior(const TAB_INFO *infoPtr, HDC hdc, INT iItem, RECT *drawRect
if(lStyle & TCS_VERTICAL) if(lStyle & TCS_VERTICAL)
{ {
center_offset_h = ((drawRect->bottom - drawRect->top) - (cy + infoPtr->uHItemPadding + (rcText.right - rcText.left))) / 2; 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 else
{ {
center_offset_h = ((drawRect->right - drawRect->left) - (cx + infoPtr->uHItemPadding + (rcText.right - rcText.left))) / 2; 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 */ /* if an item is selected, the icon is shifted up instead of down */

View file

@ -1280,7 +1280,7 @@ TOOLBAR_WrapToolbar( HWND hwnd, DWORD dwStyle )
TBUTTON_INFO *btnPtr; TBUTTON_INFO *btnPtr;
INT x, cx, i, j; INT x, cx, i, j;
RECT rc; RECT rc;
BOOL bWrap, bButtonWrap; BOOL bButtonWrap;
/* When the toolbar window style is not TBSTYLE_WRAPABLE, */ /* When the toolbar window style is not TBSTYLE_WRAPABLE, */
/* no layout is necessary. Applications may use this style */ /* 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++ ) for (i = 0; i < infoPtr->nNumButtons; i++ )
{ {
bWrap = FALSE;
btnPtr[i].fsState &= ~TBSTATE_WRAP; btnPtr[i].fsState &= ~TBSTATE_WRAP;
if (btnPtr[i].fsState & TBSTATE_HIDDEN) if (btnPtr[i].fsState & TBSTATE_HIDDEN)
@ -4762,7 +4761,7 @@ TOOLBAR_SetHotItem (HWND hwnd, WPARAM wParam)
TRACE("hwnd = %p, nHit = %d\n", hwnd, (INT)wParam); TRACE("hwnd = %p, nHit = %d\n", hwnd, (INT)wParam);
if ((INT)wParam > infoPtr->nNumButtons) if ((INT)wParam >= infoPtr->nNumButtons)
return infoPtr->nHotItem; return infoPtr->nHotItem;
if ((INT)wParam < 0) if ((INT)wParam < 0)
@ -4985,7 +4984,7 @@ TOOLBAR_SetRows (HWND hwnd, WPARAM wParam, LPARAM lParam)
/* FIXME: Separators make this quite complex */ /* FIXME: Separators make this quite complex */
if (seps) FIXME("Separators unhandled\n"); 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; idealWrap = (infoPtr->nNumButtons - hidden + (rows-1)) / rows;
/* Calculate ideal wrap point if we are allowed to grow, but cannot /* 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; POINT pt;
INT nHit; INT nHit;
INT nOldIndex = -1; INT nOldIndex = -1;
BOOL bSendMessage = TRUE;
NMHDR hdr; NMHDR hdr;
NMMOUSE nmmouse; NMMOUSE nmmouse;
NMTOOLBARA nmtb; NMTOOLBARA nmtb;
@ -5866,8 +5864,6 @@ TOOLBAR_LButtonUp (HWND hwnd, WPARAM wParam, LPARAM lParam)
if (btnPtr->fsStyle & BTNS_GROUP) { if (btnPtr->fsStyle & BTNS_GROUP) {
nOldIndex = TOOLBAR_GetCheckedGroupButtonIndex (infoPtr, nOldIndex = TOOLBAR_GetCheckedGroupButtonIndex (infoPtr,
nHit); nHit);
if (nOldIndex == nHit)
bSendMessage = FALSE;
if ((nOldIndex != nHit) && if ((nOldIndex != nHit) &&
(nOldIndex != -1)) (nOldIndex != -1))
infoPtr->buttons[nOldIndex].fsState &= ~TBSTATE_CHECKED; infoPtr->buttons[nOldIndex].fsState &= ~TBSTATE_CHECKED;

View file

@ -883,7 +883,7 @@ static INT
TOOLTIPS_GetToolFromInfoA (const TOOLTIPS_INFO *infoPtr, const TTTOOLINFOA *lpToolInfo) TOOLTIPS_GetToolFromInfoA (const TOOLTIPS_INFO *infoPtr, const TTTOOLINFOA *lpToolInfo)
{ {
TTTOOL_INFO *toolPtr; TTTOOL_INFO *toolPtr;
INT nTool; UINT nTool;
for (nTool = 0; nTool < infoPtr->uNumTools; nTool++) { for (nTool = 0; nTool < infoPtr->uNumTools; nTool++) {
toolPtr = &infoPtr->tools[nTool]; toolPtr = &infoPtr->tools[nTool];
@ -910,7 +910,7 @@ static INT
TOOLTIPS_GetToolFromInfoW (const TOOLTIPS_INFO *infoPtr, const TTTOOLINFOW *lpToolInfo) TOOLTIPS_GetToolFromInfoW (const TOOLTIPS_INFO *infoPtr, const TTTOOLINFOW *lpToolInfo)
{ {
TTTOOL_INFO *toolPtr; TTTOOL_INFO *toolPtr;
INT nTool; UINT nTool;
for (nTool = 0; nTool < infoPtr->uNumTools; nTool++) { for (nTool = 0; nTool < infoPtr->uNumTools; nTool++) {
toolPtr = &infoPtr->tools[nTool]; toolPtr = &infoPtr->tools[nTool];
@ -937,7 +937,7 @@ static INT
TOOLTIPS_GetToolFromPoint (const TOOLTIPS_INFO *infoPtr, HWND hwnd, const POINT *lpPt) TOOLTIPS_GetToolFromPoint (const TOOLTIPS_INFO *infoPtr, HWND hwnd, const POINT *lpPt)
{ {
TTTOOL_INFO *toolPtr; TTTOOL_INFO *toolPtr;
INT nTool; UINT nTool;
for (nTool = 0; nTool < infoPtr->uNumTools; nTool++) { for (nTool = 0; nTool < infoPtr->uNumTools; nTool++) {
toolPtr = &infoPtr->tools[nTool]; toolPtr = &infoPtr->tools[nTool];

View file

@ -822,7 +822,6 @@ TRACKBAR_Refresh (TRACKBAR_INFO *infoPtr, HDC hdcDst)
HBITMAP hOldBmp = 0, hOffScreenBmp = 0; HBITMAP hOldBmp = 0, hOffScreenBmp = 0;
NMCUSTOMDRAW nmcd; NMCUSTOMDRAW nmcd;
int gcdrf, icdrf; int gcdrf, icdrf;
HTHEME theme;
if (infoPtr->flags & TB_THUMBCHANGED) { if (infoPtr->flags & TB_THUMBCHANGED) {
TRACKBAR_UpdateThumb (infoPtr); TRACKBAR_UpdateThumb (infoPtr);
@ -867,7 +866,7 @@ TRACKBAR_Refresh (TRACKBAR_INFO *infoPtr, HDC hdcDst)
/* Erase background */ /* Erase background */
if (gcdrf == CDRF_DODEFAULT || if (gcdrf == CDRF_DODEFAULT ||
notify_customdraw(infoPtr, &nmcd, CDDS_PREERASE) != CDRF_SKIPDEFAULT) { notify_customdraw(infoPtr, &nmcd, CDDS_PREERASE) != CDRF_SKIPDEFAULT) {
if ((theme = GetWindowTheme (infoPtr->hwndSelf))) { if (GetWindowTheme (infoPtr->hwndSelf)) {
DrawThemeParentBackground (infoPtr->hwndSelf, hdc, 0); DrawThemeParentBackground (infoPtr->hwndSelf, hdc, 0);
} }
else else
@ -1453,9 +1452,10 @@ TRACKBAR_Destroy (TRACKBAR_INFO *infoPtr)
if (infoPtr->hwndToolTip) if (infoPtr->hwndToolTip)
DestroyWindow (infoPtr->hwndToolTip); DestroyWindow (infoPtr->hwndToolTip);
Free (infoPtr);
SetWindowLongPtrW (infoPtr->hwndSelf, 0, 0); SetWindowLongPtrW (infoPtr->hwndSelf, 0, 0);
CloseThemeData (GetWindowTheme (infoPtr->hwndSelf)); CloseThemeData (GetWindowTheme (infoPtr->hwndSelf));
Free (infoPtr);
return 0; return 0;
} }

View file

@ -1019,7 +1019,6 @@ static void
TREEVIEW_FreeItem(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *item) TREEVIEW_FreeItem(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *item)
{ {
DPA_DeletePtr(infoPtr->items, DPA_GetPtrIndex(infoPtr->items, item)); DPA_DeletePtr(infoPtr->items, DPA_GetPtrIndex(infoPtr->items, item));
Free(item);
if (infoPtr->selectedItem == item) if (infoPtr->selectedItem == item)
infoPtr->selectedItem = NULL; infoPtr->selectedItem = NULL;
if (infoPtr->hotItem == item) if (infoPtr->hotItem == item)
@ -1032,6 +1031,7 @@ TREEVIEW_FreeItem(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *item)
infoPtr->dropItem = NULL; infoPtr->dropItem = NULL;
if (infoPtr->insertMarkItem == item) if (infoPtr->insertMarkItem == item)
infoPtr->insertMarkItem = NULL; infoPtr->insertMarkItem = NULL;
Free(item);
} }
@ -3292,7 +3292,7 @@ TREEVIEW_Expand(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem,
scrollDist = nextItem->rect.top - orgNextTop; scrollDist = nextItem->rect.top - orgNextTop;
scrollRect.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); NULL, NULL, SW_ERASE | SW_INVALIDATE);
TREEVIEW_Invalidate (infoPtr, wineItem); TREEVIEW_Invalidate (infoPtr, wineItem);
} else { } else {
@ -3573,12 +3573,11 @@ TREEVIEW_Command(TREEVIEW_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
TREEVIEW_ITEM *editItem = infoPtr->selectedItem; TREEVIEW_ITEM *editItem = infoPtr->selectedItem;
HDC hdc = GetDC(infoPtr->hwndEdit); HDC hdc = GetDC(infoPtr->hwndEdit);
SIZE sz; SIZE sz;
int len;
HFONT hFont, hOldFont = 0; HFONT hFont, hOldFont = 0;
infoPtr->bLabelChanged = TRUE; 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 */ /* Select font to get the right dimension of the string */
hFont = (HFONT)SendMessageW(infoPtr->hwndEdit, WM_GETFONT, 0, 0); hFont = (HFONT)SendMessageW(infoPtr->hwndEdit, WM_GETFONT, 0, 0);

View file

@ -469,6 +469,28 @@ static LRESULT UPDOWN_KeyPressed(UPDOWN_INFO *infoPtr, int key)
return 0; 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 * UPDOWN_Buddy_SubclassProc used to handle messages sent to the buddy
* control. * control.
@ -486,6 +508,11 @@ UPDOWN_Buddy_SubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
UPDOWN_KeyPressed(UPDOWN_GetInfoPtr(upDownHwnd), (int)wParam); 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); 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)); UPDOWN_HandleMouseEvent (infoPtr, message, (SHORT)LOWORD(lParam), (SHORT)HIWORD(lParam));
break; break;
case WM_MOUSEWHEEL:
UPDOWN_MouseWheel(infoPtr, wParam);
break;
case WM_KEYDOWN: case WM_KEYDOWN:
if((infoPtr->dwStyle & UDS_ARROWKEYS) && UPDOWN_IsEnabled(infoPtr)) if((infoPtr->dwStyle & UDS_ARROWKEYS) && UPDOWN_IsEnabled(infoPtr))
return UPDOWN_KeyPressed(infoPtr, (int)wParam); return UPDOWN_KeyPressed(infoPtr, (int)wParam);