mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 16:12:58 +00:00
[COMCTL32] Sync with Wine Staging 1.7.47. CORE-9924
svn path=/trunk/; revision=68553
This commit is contained in:
parent
300237adee
commit
3b13364f05
14 changed files with 1557 additions and 1092 deletions
File diff suppressed because it is too large
Load diff
|
@ -426,3 +426,59 @@ void WINAPI DSA_DestroyCallback (HDSA hdsa, PFNDSAENUMCALLBACK enumProc,
|
||||||
DSA_EnumCallback (hdsa, enumProc, lParam);
|
DSA_EnumCallback (hdsa, enumProc, lParam);
|
||||||
DSA_Destroy (hdsa);
|
DSA_Destroy (hdsa);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
* DSA_Clone [COMCTL32.@]
|
||||||
|
*
|
||||||
|
* Creates a copy of a dsa
|
||||||
|
*
|
||||||
|
* PARAMS
|
||||||
|
* hdsa [I] handle to the dynamic storage array
|
||||||
|
*
|
||||||
|
* RETURNS
|
||||||
|
* Cloned dsa
|
||||||
|
*/
|
||||||
|
HDSA WINAPI DSA_Clone(HDSA hdsa)
|
||||||
|
{
|
||||||
|
HDSA dest;
|
||||||
|
INT i;
|
||||||
|
|
||||||
|
TRACE("(%p)\n", hdsa);
|
||||||
|
|
||||||
|
if (!hdsa)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
dest = DSA_Create (hdsa->nItemSize, hdsa->nGrow);
|
||||||
|
if (!dest)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
for (i = 0; i < hdsa->nItemCount; i++) {
|
||||||
|
void *ptr = DSA_GetItemPtr (hdsa, i);
|
||||||
|
if (DSA_InsertItem (dest, DA_LAST, ptr) == -1) {
|
||||||
|
DSA_Destroy (dest);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return dest;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
* DSA_GetSize [COMCTL32.@]
|
||||||
|
*
|
||||||
|
* Returns allocated memory size for this array
|
||||||
|
*
|
||||||
|
* PARAMS
|
||||||
|
* hdsa [I] handle to the dynamic storage array
|
||||||
|
*
|
||||||
|
* RETURNS
|
||||||
|
* Size
|
||||||
|
*/
|
||||||
|
ULONGLONG WINAPI DSA_GetSize(HDSA hdsa)
|
||||||
|
{
|
||||||
|
TRACE("(%p)\n", hdsa);
|
||||||
|
|
||||||
|
if (!hdsa) return 0;
|
||||||
|
|
||||||
|
return sizeof(*hdsa) + (ULONGLONG)hdsa->nMaxCount*hdsa->nItemSize;
|
||||||
|
}
|
||||||
|
|
|
@ -55,7 +55,7 @@ typedef struct
|
||||||
BOOL WINAPI InitializeFlatSB(HWND hwnd)
|
BOOL WINAPI InitializeFlatSB(HWND hwnd)
|
||||||
{
|
{
|
||||||
TRACE("[%p]\n", hwnd);
|
TRACE("[%p]\n", hwnd);
|
||||||
return FALSE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
|
|
@ -319,6 +319,7 @@ HEADER_DrawItem (HEADER_INFO *infoPtr, HDC hdc, INT iItem, BOOL bHotTrack, LRESU
|
||||||
INT oldBkMode;
|
INT oldBkMode;
|
||||||
HTHEME theme = GetWindowTheme (infoPtr->hwndSelf);
|
HTHEME theme = GetWindowTheme (infoPtr->hwndSelf);
|
||||||
NMCUSTOMDRAW nmcd;
|
NMCUSTOMDRAW nmcd;
|
||||||
|
int state = 0;
|
||||||
|
|
||||||
TRACE("DrawItem(iItem %d bHotTrack %d unicode flag %d)\n", iItem, bHotTrack, (infoPtr->nNotifyFormat == NFR_UNICODE));
|
TRACE("DrawItem(iItem %d bHotTrack %d unicode flag %d)\n", iItem, bHotTrack, (infoPtr->nNotifyFormat == NFR_UNICODE));
|
||||||
|
|
||||||
|
@ -326,6 +327,9 @@ HEADER_DrawItem (HEADER_INFO *infoPtr, HDC hdc, INT iItem, BOOL bHotTrack, LRESU
|
||||||
if (r.right - r.left == 0)
|
if (r.right - r.left == 0)
|
||||||
return phdi->rect.right;
|
return phdi->rect.right;
|
||||||
|
|
||||||
|
if (theme)
|
||||||
|
state = (phdi->bDown) ? HIS_PRESSED : (bHotTrack ? HIS_HOT : HIS_NORMAL);
|
||||||
|
|
||||||
/* Set the colors before sending NM_CUSTOMDRAW so that it can change them */
|
/* Set the colors before sending NM_CUSTOMDRAW so that it can change them */
|
||||||
SetTextColor(hdc, (bHotTrack && !theme) ? COLOR_HIGHLIGHT : COLOR_BTNTEXT);
|
SetTextColor(hdc, (bHotTrack && !theme) ? COLOR_HIGHLIGHT : COLOR_BTNTEXT);
|
||||||
SetBkColor(hdc, comctl32_color.clr3dFace);
|
SetBkColor(hdc, comctl32_color.clr3dFace);
|
||||||
|
@ -404,8 +408,14 @@ HEADER_DrawItem (HEADER_INFO *infoPtr, HDC hdc, INT iItem, BOOL bHotTrack, LRESU
|
||||||
RECT textRect;
|
RECT textRect;
|
||||||
|
|
||||||
SetRectEmpty(&textRect);
|
SetRectEmpty(&textRect);
|
||||||
DrawTextW (hdc, phdi->pszText, -1,
|
|
||||||
&textRect, DT_LEFT|DT_VCENTER|DT_SINGLELINE|DT_CALCRECT);
|
if (theme) {
|
||||||
|
GetThemeTextExtent(theme, hdc, HP_HEADERITEM, state, phdi->pszText, -1,
|
||||||
|
DT_LEFT|DT_VCENTER|DT_SINGLELINE, NULL, &textRect);
|
||||||
|
} else {
|
||||||
|
DrawTextW (hdc, phdi->pszText, -1,
|
||||||
|
&textRect, DT_LEFT|DT_VCENTER|DT_SINGLELINE|DT_CALCRECT);
|
||||||
|
}
|
||||||
cw = textRect.right - textRect.left + 2 * infoPtr->iMargin;
|
cw = textRect.right - textRect.left + 2 * infoPtr->iMargin;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -498,8 +508,14 @@ HEADER_DrawItem (HEADER_INFO *infoPtr, HDC hdc, INT iItem, BOOL bHotTrack, LRESU
|
||||||
oldBkMode = SetBkMode(hdc, TRANSPARENT);
|
oldBkMode = SetBkMode(hdc, TRANSPARENT);
|
||||||
r.left = tx;
|
r.left = tx;
|
||||||
r.right = tx + tw;
|
r.right = tx + tw;
|
||||||
DrawTextW (hdc, phdi->pszText, -1,
|
if (theme) {
|
||||||
&r, DT_LEFT|DT_END_ELLIPSIS|DT_VCENTER|DT_SINGLELINE);
|
DrawThemeText(theme, hdc, HP_HEADERITEM, state, phdi->pszText,
|
||||||
|
-1, DT_LEFT|DT_END_ELLIPSIS|DT_VCENTER|DT_SINGLELINE,
|
||||||
|
0, &r);
|
||||||
|
} else {
|
||||||
|
DrawTextW (hdc, phdi->pszText, -1,
|
||||||
|
&r, DT_LEFT|DT_END_ELLIPSIS|DT_VCENTER|DT_SINGLELINE);
|
||||||
|
}
|
||||||
if (oldBkMode != TRANSPARENT)
|
if (oldBkMode != TRANSPARENT)
|
||||||
SetBkMode(hdc, oldBkMode);
|
SetBkMode(hdc, oldBkMode);
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
* Copyright 2000 Jason Mawdsley
|
* Copyright 2000 Jason Mawdsley
|
||||||
* Copyright 2001 CodeWeavers Inc.
|
* Copyright 2001 CodeWeavers Inc.
|
||||||
* Copyright 2002 Dimitrie O. Paun
|
* Copyright 2002 Dimitrie O. Paun
|
||||||
* Copyright 2009-2014 Nikolay Sivov
|
* Copyright 2009-2015 Nikolay Sivov
|
||||||
* Copyright 2009 Owen Rudge for CodeWeavers
|
* Copyright 2009 Owen Rudge for CodeWeavers
|
||||||
* Copyright 2012-2013 Daniel Jelinski
|
* Copyright 2012-2013 Daniel Jelinski
|
||||||
*
|
*
|
||||||
|
@ -54,7 +54,6 @@
|
||||||
* -- Support CustomDraw options for _WIN32_IE >= 0x560 (see NMLVCUSTOMDRAW docs).
|
* -- Support CustomDraw options for _WIN32_IE >= 0x560 (see NMLVCUSTOMDRAW docs).
|
||||||
* -- LVA_SNAPTOGRID not implemented
|
* -- LVA_SNAPTOGRID not implemented
|
||||||
* -- LISTVIEW_ApproximateViewRect partially implemented
|
* -- LISTVIEW_ApproximateViewRect partially implemented
|
||||||
* -- LISTVIEW_SetColumnWidth ignores header images & bitmap
|
|
||||||
* -- LISTVIEW_StyleChanged doesn't handle some changes too well
|
* -- LISTVIEW_StyleChanged doesn't handle some changes too well
|
||||||
*
|
*
|
||||||
* Speedups
|
* Speedups
|
||||||
|
@ -288,7 +287,9 @@ typedef struct tagLISTVIEW_INFO
|
||||||
COLORREF clrBk;
|
COLORREF clrBk;
|
||||||
COLORREF clrText;
|
COLORREF clrText;
|
||||||
COLORREF clrTextBk;
|
COLORREF clrTextBk;
|
||||||
|
#ifdef __REACTOS__
|
||||||
BOOL bDefaultBkColor;
|
BOOL bDefaultBkColor;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* font */
|
/* font */
|
||||||
HFONT hDefaultFont;
|
HFONT hDefaultFont;
|
||||||
|
@ -1681,6 +1682,7 @@ static inline BOOL LISTVIEW_GetItemW(const LISTVIEW_INFO *infoPtr, LPLVITEMW lpL
|
||||||
/* used to handle collapse main item column case */
|
/* used to handle collapse main item column case */
|
||||||
static inline BOOL LISTVIEW_DrawFocusRect(const LISTVIEW_INFO *infoPtr, HDC hdc)
|
static inline BOOL LISTVIEW_DrawFocusRect(const LISTVIEW_INFO *infoPtr, HDC hdc)
|
||||||
{
|
{
|
||||||
|
#ifdef __REACTOS__
|
||||||
BOOL Ret = FALSE;
|
BOOL Ret = FALSE;
|
||||||
|
|
||||||
if (infoPtr->rcFocus.left < infoPtr->rcFocus.right)
|
if (infoPtr->rcFocus.left < infoPtr->rcFocus.right)
|
||||||
|
@ -1694,6 +1696,10 @@ static inline BOOL LISTVIEW_DrawFocusRect(const LISTVIEW_INFO *infoPtr, HDC hdc)
|
||||||
SetBkColor(hdc, dwOldTextColor);
|
SetBkColor(hdc, dwOldTextColor);
|
||||||
}
|
}
|
||||||
return Ret;
|
return Ret;
|
||||||
|
#else
|
||||||
|
return (infoPtr->rcFocus.left < infoPtr->rcFocus.right) ?
|
||||||
|
DrawFocusRect(hdc, &infoPtr->rcFocus) : FALSE;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Listview invalidation functions: use _only_ these functions to invalidate */
|
/* Listview invalidation functions: use _only_ these functions to invalidate */
|
||||||
|
@ -4543,6 +4549,7 @@ static inline BOOL LISTVIEW_FillBkgnd(const LISTVIEW_INFO *infoPtr, HDC hdc, con
|
||||||
static void LISTVIEW_DrawItemPart(LISTVIEW_INFO *infoPtr, LVITEMW *item, const NMLVCUSTOMDRAW *nmlvcd, const POINT *pos)
|
static void LISTVIEW_DrawItemPart(LISTVIEW_INFO *infoPtr, LVITEMW *item, const NMLVCUSTOMDRAW *nmlvcd, const POINT *pos)
|
||||||
{
|
{
|
||||||
RECT rcSelect, rcLabel, rcBox, rcStateIcon, rcIcon;
|
RECT rcSelect, rcLabel, rcBox, rcStateIcon, rcIcon;
|
||||||
|
const RECT *background;
|
||||||
HIMAGELIST himl;
|
HIMAGELIST himl;
|
||||||
UINT format;
|
UINT format;
|
||||||
RECT *focus;
|
RECT *focus;
|
||||||
|
@ -4557,13 +4564,22 @@ static void LISTVIEW_DrawItemPart(LISTVIEW_INFO *infoPtr, LVITEMW *item, const N
|
||||||
OffsetRect(&rcIcon, pos->x, pos->y);
|
OffsetRect(&rcIcon, pos->x, pos->y);
|
||||||
OffsetRect(&rcStateIcon, pos->x, pos->y);
|
OffsetRect(&rcStateIcon, pos->x, pos->y);
|
||||||
OffsetRect(&rcLabel, pos->x, pos->y);
|
OffsetRect(&rcLabel, pos->x, pos->y);
|
||||||
TRACE(" rcBox=%s, rcSelect=%s, rcIcon=%s. rcLabel=%s\n",
|
TRACE("%d: box=%s, select=%s, icon=%s. label=%s\n", item->iSubItem,
|
||||||
wine_dbgstr_rect(&rcBox), wine_dbgstr_rect(&rcSelect),
|
wine_dbgstr_rect(&rcBox), wine_dbgstr_rect(&rcSelect),
|
||||||
wine_dbgstr_rect(&rcIcon), wine_dbgstr_rect(&rcLabel));
|
wine_dbgstr_rect(&rcIcon), wine_dbgstr_rect(&rcLabel));
|
||||||
|
|
||||||
/* FIXME: temporary hack */
|
/* FIXME: temporary hack */
|
||||||
rcSelect.left = rcLabel.left;
|
rcSelect.left = rcLabel.left;
|
||||||
|
|
||||||
|
if (infoPtr->uView == LV_VIEW_DETAILS && item->iSubItem == 0)
|
||||||
|
{
|
||||||
|
if (!(infoPtr->dwLvExStyle & LVS_EX_FULLROWSELECT))
|
||||||
|
OffsetRect(&rcSelect, LISTVIEW_GetColumnInfo(infoPtr, 0)->rcHeader.left, 0);
|
||||||
|
OffsetRect(&rcIcon, LISTVIEW_GetColumnInfo(infoPtr, 0)->rcHeader.left, 0);
|
||||||
|
OffsetRect(&rcStateIcon, LISTVIEW_GetColumnInfo(infoPtr, 0)->rcHeader.left, 0);
|
||||||
|
OffsetRect(&rcLabel, LISTVIEW_GetColumnInfo(infoPtr, 0)->rcHeader.left, 0);
|
||||||
|
}
|
||||||
|
|
||||||
/* in icon mode, the label rect is really what we want to draw the
|
/* in icon mode, the label rect is really what we want to draw the
|
||||||
* background for */
|
* background for */
|
||||||
/* in detail mode, we want to paint background for label rect when
|
/* in detail mode, we want to paint background for label rect when
|
||||||
|
@ -4572,37 +4588,41 @@ static void LISTVIEW_DrawItemPart(LISTVIEW_INFO *infoPtr, LVITEMW *item, const N
|
||||||
if ( infoPtr->uView == LV_VIEW_ICON ||
|
if ( infoPtr->uView == LV_VIEW_ICON ||
|
||||||
(infoPtr->uView == LV_VIEW_DETAILS && (!(item->state & LVIS_SELECTED) ||
|
(infoPtr->uView == LV_VIEW_DETAILS && (!(item->state & LVIS_SELECTED) ||
|
||||||
(infoPtr->dwLvExStyle & LVS_EX_FULLROWSELECT))))
|
(infoPtr->dwLvExStyle & LVS_EX_FULLROWSELECT))))
|
||||||
rcSelect = rcLabel;
|
background = &rcLabel;
|
||||||
|
else
|
||||||
|
background = &rcSelect;
|
||||||
|
|
||||||
if (nmlvcd->clrTextBk != CLR_NONE)
|
if (nmlvcd->clrTextBk != CLR_NONE)
|
||||||
ExtTextOutW(nmlvcd->nmcd.hdc, rcSelect.left, rcSelect.top, ETO_OPAQUE, &rcSelect, NULL, 0, NULL);
|
ExtTextOutW(nmlvcd->nmcd.hdc, background->left, background->top, ETO_OPAQUE, background, NULL, 0, NULL);
|
||||||
|
|
||||||
if (item->state & LVIS_FOCUSED)
|
if (item->state & LVIS_FOCUSED)
|
||||||
{
|
{
|
||||||
if (infoPtr->uView == LV_VIEW_DETAILS && (infoPtr->dwLvExStyle & LVS_EX_FULLROWSELECT))
|
if (infoPtr->uView == LV_VIEW_DETAILS)
|
||||||
{
|
{
|
||||||
/* we have to update left focus bound too if item isn't in leftmost column
|
if (infoPtr->dwLvExStyle & LVS_EX_FULLROWSELECT)
|
||||||
and reduce right box bound */
|
{
|
||||||
if (DPA_GetPtrCount(infoPtr->hdpaColumns) > 0)
|
/* we have to update left focus bound too if item isn't in leftmost column
|
||||||
{
|
and reduce right box bound */
|
||||||
INT leftmost;
|
if (DPA_GetPtrCount(infoPtr->hdpaColumns) > 0)
|
||||||
|
{
|
||||||
|
INT leftmost;
|
||||||
|
|
||||||
if ((leftmost = SendMessageW(infoPtr->hwndHeader, HDM_ORDERTOINDEX, 0, 0)))
|
if ((leftmost = SendMessageW(infoPtr->hwndHeader, HDM_ORDERTOINDEX, 0, 0)))
|
||||||
{
|
{
|
||||||
INT Originx = pos->x - LISTVIEW_GetColumnInfo(infoPtr, 0)->rcHeader.left;
|
INT Originx = pos->x - LISTVIEW_GetColumnInfo(infoPtr, leftmost)->rcHeader.left;
|
||||||
INT index = SendMessageW(infoPtr->hwndHeader, HDM_ORDERTOINDEX,
|
INT rightmost = SendMessageW(infoPtr->hwndHeader, HDM_ORDERTOINDEX,
|
||||||
DPA_GetPtrCount(infoPtr->hdpaColumns) - 1, 0);
|
DPA_GetPtrCount(infoPtr->hdpaColumns) - 1, 0);
|
||||||
|
|
||||||
rcBox.right = LISTVIEW_GetColumnInfo(infoPtr, index)->rcHeader.right + Originx;
|
rcBox.right = LISTVIEW_GetColumnInfo(infoPtr, rightmost)->rcHeader.right + Originx;
|
||||||
rcSelect.left = LISTVIEW_GetColumnInfo(infoPtr, leftmost)->rcHeader.left + Originx;
|
rcSelect.left = LISTVIEW_GetColumnInfo(infoPtr, leftmost)->rcHeader.left + Originx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
rcSelect.right = rcBox.right;
|
||||||
rcSelect.right = rcBox.right;
|
}
|
||||||
}
|
infoPtr->rcFocus = rcSelect;
|
||||||
|
}
|
||||||
/* store new focus rectangle */
|
else
|
||||||
infoPtr->rcFocus = rcSelect;
|
infoPtr->rcFocus = rcLabel;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* state icons */
|
/* state icons */
|
||||||
|
@ -4893,9 +4913,9 @@ static void LISTVIEW_RefreshReport(LISTVIEW_INFO *infoPtr, ITERATOR *i, HDC hdc,
|
||||||
{
|
{
|
||||||
INT rgntype;
|
INT rgntype;
|
||||||
RECT rcClip, rcItem;
|
RECT rcClip, rcItem;
|
||||||
POINT Origin, Position;
|
POINT Origin;
|
||||||
RANGES colRanges;
|
RANGES colRanges;
|
||||||
INT col, index;
|
INT col;
|
||||||
ITERATOR j;
|
ITERATOR j;
|
||||||
|
|
||||||
TRACE("()\n");
|
TRACE("()\n");
|
||||||
|
@ -4912,7 +4932,7 @@ static void LISTVIEW_RefreshReport(LISTVIEW_INFO *infoPtr, ITERATOR *i, HDC hdc,
|
||||||
/* narrow down the columns we need to paint */
|
/* narrow down the columns we need to paint */
|
||||||
for(col = 0; col < DPA_GetPtrCount(infoPtr->hdpaColumns); col++)
|
for(col = 0; col < DPA_GetPtrCount(infoPtr->hdpaColumns); col++)
|
||||||
{
|
{
|
||||||
index = SendMessageW(infoPtr->hwndHeader, HDM_ORDERTOINDEX, col, 0);
|
INT index = SendMessageW(infoPtr->hwndHeader, HDM_ORDERTOINDEX, col, 0);
|
||||||
|
|
||||||
LISTVIEW_GetHeaderRect(infoPtr, index, &rcItem);
|
LISTVIEW_GetHeaderRect(infoPtr, index, &rcItem);
|
||||||
if ((rcItem.right + Origin.x >= rcClip.left) && (rcItem.left + Origin.x < rcClip.right))
|
if ((rcItem.right + Origin.x >= rcClip.left) && (rcItem.left + Origin.x < rcClip.right))
|
||||||
|
@ -4928,10 +4948,12 @@ static void LISTVIEW_RefreshReport(LISTVIEW_INFO *infoPtr, ITERATOR *i, HDC hdc,
|
||||||
while(iterator_next(i))
|
while(iterator_next(i))
|
||||||
{
|
{
|
||||||
RANGES subitems;
|
RANGES subitems;
|
||||||
|
POINT Position;
|
||||||
ITERATOR k;
|
ITERATOR k;
|
||||||
|
|
||||||
SelectObject(hdc, infoPtr->hFont);
|
SelectObject(hdc, infoPtr->hFont);
|
||||||
LISTVIEW_GetItemOrigin(infoPtr, i->nItem, &Position);
|
LISTVIEW_GetItemOrigin(infoPtr, i->nItem, &Position);
|
||||||
|
Position.x = Origin.x;
|
||||||
Position.y += Origin.y;
|
Position.y += Origin.y;
|
||||||
|
|
||||||
subitems = ranges_create(DPA_GetPtrCount(infoPtr->hdpaColumns));
|
subitems = ranges_create(DPA_GetPtrCount(infoPtr->hdpaColumns));
|
||||||
|
@ -4940,7 +4962,6 @@ static void LISTVIEW_RefreshReport(LISTVIEW_INFO *infoPtr, ITERATOR *i, HDC hdc,
|
||||||
while(iterator_next(&j))
|
while(iterator_next(&j))
|
||||||
{
|
{
|
||||||
LISTVIEW_GetHeaderRect(infoPtr, j.nItem, &rcItem);
|
LISTVIEW_GetHeaderRect(infoPtr, j.nItem, &rcItem);
|
||||||
Position.x = (j.nItem == 0) ? rcItem.left + Origin.x : Origin.x;
|
|
||||||
|
|
||||||
if (rgntype == COMPLEXREGION && !((infoPtr->dwLvExStyle & LVS_EX_FULLROWSELECT) && j.nItem == 0))
|
if (rgntype == COMPLEXREGION && !((infoPtr->dwLvExStyle & LVS_EX_FULLROWSELECT) && j.nItem == 0))
|
||||||
{
|
{
|
||||||
|
@ -6489,14 +6510,9 @@ static BOOL LISTVIEW_GetColumnT(const LISTVIEW_INFO *infoPtr, INT nColumn, LPLVC
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline BOOL LISTVIEW_GetColumnOrderArray(const LISTVIEW_INFO *infoPtr, INT iCount, LPINT lpiArray)
|
||||||
static BOOL LISTVIEW_GetColumnOrderArray(const LISTVIEW_INFO *infoPtr, INT iCount, LPINT lpiArray)
|
|
||||||
{
|
{
|
||||||
TRACE("iCount=%d, lpiArray=%p\n", iCount, lpiArray);
|
if (!infoPtr->hwndHeader) return FALSE;
|
||||||
|
|
||||||
if (!lpiArray)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
return SendMessageW(infoPtr->hwndHeader, HDM_GETORDERARRAY, iCount, (LPARAM)lpiArray);
|
return SendMessageW(infoPtr->hwndHeader, HDM_GETORDERARRAY, iCount, (LPARAM)lpiArray);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6529,8 +6545,6 @@ static INT LISTVIEW_GetColumnWidth(const LISTVIEW_INFO *infoPtr, INT nColumn)
|
||||||
/* We are not using LISTVIEW_GetHeaderRect as this data is updated only after a HDN_ITEMCHANGED.
|
/* We are not using LISTVIEW_GetHeaderRect as this data is updated only after a HDN_ITEMCHANGED.
|
||||||
* There is an application that subclasses the listview, calls LVM_GETCOLUMNWIDTH in the
|
* There is an application that subclasses the listview, calls LVM_GETCOLUMNWIDTH in the
|
||||||
* HDN_ITEMCHANGED handler and goes into infinite recursion if it receives old data.
|
* HDN_ITEMCHANGED handler and goes into infinite recursion if it receives old data.
|
||||||
*
|
|
||||||
* TODO: should we do the same in LVM_GETCOLUMN?
|
|
||||||
*/
|
*/
|
||||||
hdItem.mask = HDI_WIDTH;
|
hdItem.mask = HDI_WIDTH;
|
||||||
if (!SendMessageW(infoPtr->hwndHeader, HDM_GETITEMW, nColumn, (LPARAM)&hdItem))
|
if (!SendMessageW(infoPtr->hwndHeader, HDM_GETITEMW, nColumn, (LPARAM)&hdItem))
|
||||||
|
@ -8019,7 +8033,9 @@ static BOOL LISTVIEW_SetBkColor(LISTVIEW_INFO *infoPtr, COLORREF color)
|
||||||
{
|
{
|
||||||
TRACE("(color=%x)\n", color);
|
TRACE("(color=%x)\n", color);
|
||||||
|
|
||||||
|
#ifdef __REACTOS__
|
||||||
infoPtr->bDefaultBkColor = FALSE;
|
infoPtr->bDefaultBkColor = FALSE;
|
||||||
|
#endif
|
||||||
if(infoPtr->clrBk != color) {
|
if(infoPtr->clrBk != color) {
|
||||||
if (infoPtr->clrBk != CLR_NONE) DeleteObject(infoPtr->hBkBrush);
|
if (infoPtr->clrBk != CLR_NONE) DeleteObject(infoPtr->hBkBrush);
|
||||||
infoPtr->clrBk = color;
|
infoPtr->clrBk = color;
|
||||||
|
@ -8303,12 +8319,8 @@ static BOOL LISTVIEW_SetColumnT(const LISTVIEW_INFO *infoPtr, INT nColumn,
|
||||||
*/
|
*/
|
||||||
static BOOL LISTVIEW_SetColumnOrderArray(LISTVIEW_INFO *infoPtr, INT iCount, const INT *lpiArray)
|
static BOOL LISTVIEW_SetColumnOrderArray(LISTVIEW_INFO *infoPtr, INT iCount, const INT *lpiArray)
|
||||||
{
|
{
|
||||||
TRACE("iCount %d lpiArray %p\n", iCount, lpiArray);
|
if (!infoPtr->hwndHeader) return FALSE;
|
||||||
|
|
||||||
if (!lpiArray || !IsWindow(infoPtr->hwndHeader)) return FALSE;
|
|
||||||
|
|
||||||
infoPtr->colRectsDirty = TRUE;
|
infoPtr->colRectsDirty = TRUE;
|
||||||
|
|
||||||
return SendMessageW(infoPtr->hwndHeader, HDM_SETORDERARRAY, iCount, (LPARAM)lpiArray);
|
return SendMessageW(infoPtr->hwndHeader, HDM_SETORDERARRAY, iCount, (LPARAM)lpiArray);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8336,9 +8348,10 @@ static BOOL LISTVIEW_SetColumnWidth(LISTVIEW_INFO *infoPtr, INT nColumn, INT cx)
|
||||||
/* set column width only if in report or list mode */
|
/* set column width only if in report or list mode */
|
||||||
if (infoPtr->uView != LV_VIEW_DETAILS && infoPtr->uView != LV_VIEW_LIST) return FALSE;
|
if (infoPtr->uView != LV_VIEW_DETAILS && infoPtr->uView != LV_VIEW_LIST) return FALSE;
|
||||||
|
|
||||||
/* take care of invalid cx values */
|
/* take care of invalid cx values - LVSCW_AUTOSIZE_* values are negative,
|
||||||
if(infoPtr->uView == LV_VIEW_DETAILS && cx < -2) cx = LVSCW_AUTOSIZE;
|
with _USEHEADER being the lowest */
|
||||||
else if (infoPtr->uView == LV_VIEW_LIST && cx < 1) return FALSE;
|
if (infoPtr->uView == LV_VIEW_DETAILS && cx < LVSCW_AUTOSIZE_USEHEADER) cx = LVSCW_AUTOSIZE;
|
||||||
|
else if (infoPtr->uView == LV_VIEW_LIST && cx <= 0) return FALSE;
|
||||||
|
|
||||||
/* resize all columns if in LV_VIEW_LIST mode */
|
/* resize all columns if in LV_VIEW_LIST mode */
|
||||||
if(infoPtr->uView == LV_VIEW_LIST)
|
if(infoPtr->uView == LV_VIEW_LIST)
|
||||||
|
@ -8397,18 +8410,38 @@ static BOOL LISTVIEW_SetColumnWidth(LISTVIEW_INFO *infoPtr, INT nColumn, INT cx)
|
||||||
cx = 0;
|
cx = 0;
|
||||||
|
|
||||||
/* retrieve header text */
|
/* retrieve header text */
|
||||||
hdi.mask = HDI_TEXT;
|
hdi.mask = HDI_TEXT|HDI_FORMAT|HDI_IMAGE|HDI_BITMAP;
|
||||||
hdi.cchTextMax = DISP_TEXT_SIZE;
|
hdi.cchTextMax = DISP_TEXT_SIZE;
|
||||||
hdi.pszText = szDispText;
|
hdi.pszText = szDispText;
|
||||||
if (SendMessageW(infoPtr->hwndHeader, HDM_GETITEMW, nColumn, (LPARAM)&hdi))
|
if (SendMessageW(infoPtr->hwndHeader, HDM_GETITEMW, nColumn, (LPARAM)&hdi))
|
||||||
{
|
{
|
||||||
HDC hdc = GetDC(infoPtr->hwndSelf);
|
HDC hdc = GetDC(infoPtr->hwndSelf);
|
||||||
HFONT old_font = SelectObject(hdc, (HFONT)SendMessageW(infoPtr->hwndHeader, WM_GETFONT, 0, 0));
|
HFONT old_font = SelectObject(hdc, (HFONT)SendMessageW(infoPtr->hwndHeader, WM_GETFONT, 0, 0));
|
||||||
|
HIMAGELIST himl = (HIMAGELIST)SendMessageW(infoPtr->hwndHeader, HDM_GETIMAGELIST, 0, 0);
|
||||||
|
INT bitmap_margin = 0;
|
||||||
SIZE size;
|
SIZE size;
|
||||||
|
|
||||||
if (GetTextExtentPoint32W(hdc, hdi.pszText, lstrlenW(hdi.pszText), &size))
|
if (GetTextExtentPoint32W(hdc, hdi.pszText, lstrlenW(hdi.pszText), &size))
|
||||||
cx = size.cx + TRAILING_HEADER_PADDING;
|
cx = size.cx + TRAILING_HEADER_PADDING;
|
||||||
/* FIXME: Take into account the header image, if one is present */
|
|
||||||
|
if (hdi.fmt & (HDF_IMAGE|HDF_BITMAP))
|
||||||
|
bitmap_margin = SendMessageW(infoPtr->hwndHeader, HDM_GETBITMAPMARGIN, 0, 0);
|
||||||
|
|
||||||
|
if ((hdi.fmt & HDF_IMAGE) && himl)
|
||||||
|
{
|
||||||
|
INT icon_cx, icon_cy;
|
||||||
|
|
||||||
|
if (!ImageList_GetIconSize(himl, &icon_cx, &icon_cy))
|
||||||
|
cx += icon_cx + 2*bitmap_margin;
|
||||||
|
}
|
||||||
|
else if (hdi.fmt & HDF_BITMAP)
|
||||||
|
{
|
||||||
|
BITMAP bmp;
|
||||||
|
|
||||||
|
GetObjectW(hdi.hbm, sizeof(BITMAP), &bmp);
|
||||||
|
cx += bmp.bmWidth + 2*bitmap_margin;
|
||||||
|
}
|
||||||
|
|
||||||
SelectObject(hdc, old_font);
|
SelectObject(hdc, old_font);
|
||||||
ReleaseDC(infoPtr->hwndSelf, hdc);
|
ReleaseDC(infoPtr->hwndSelf, hdc);
|
||||||
}
|
}
|
||||||
|
@ -9430,7 +9463,9 @@ static LRESULT LISTVIEW_NCCreate(HWND hwnd, const CREATESTRUCTW *lpcs)
|
||||||
infoPtr->clrText = CLR_DEFAULT;
|
infoPtr->clrText = CLR_DEFAULT;
|
||||||
infoPtr->clrTextBk = CLR_DEFAULT;
|
infoPtr->clrTextBk = CLR_DEFAULT;
|
||||||
LISTVIEW_SetBkColor(infoPtr, comctl32_color.clrWindow);
|
LISTVIEW_SetBkColor(infoPtr, comctl32_color.clrWindow);
|
||||||
|
#ifdef __REACTOS__
|
||||||
infoPtr->bDefaultBkColor = TRUE;
|
infoPtr->bDefaultBkColor = TRUE;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* set default values */
|
/* set default values */
|
||||||
infoPtr->nFocusedItem = -1;
|
infoPtr->nFocusedItem = -1;
|
||||||
|
@ -11071,7 +11106,6 @@ static INT LISTVIEW_StyleChanged(LISTVIEW_INFO *infoPtr, WPARAM wStyleType,
|
||||||
if (wStyleType != GWL_STYLE) return 0;
|
if (wStyleType != GWL_STYLE) return 0;
|
||||||
|
|
||||||
infoPtr->dwStyle = lpss->styleNew;
|
infoPtr->dwStyle = lpss->styleNew;
|
||||||
map_style_view(infoPtr);
|
|
||||||
|
|
||||||
if (((lpss->styleOld & WS_HSCROLL) != 0)&&
|
if (((lpss->styleOld & WS_HSCROLL) != 0)&&
|
||||||
((lpss->styleNew & WS_HSCROLL) == 0))
|
((lpss->styleNew & WS_HSCROLL) == 0))
|
||||||
|
@ -11084,7 +11118,10 @@ static INT LISTVIEW_StyleChanged(LISTVIEW_INFO *infoPtr, WPARAM wStyleType,
|
||||||
if (uNewView != uOldView)
|
if (uNewView != uOldView)
|
||||||
{
|
{
|
||||||
HIMAGELIST himl;
|
HIMAGELIST himl;
|
||||||
|
|
||||||
|
/* LVM_SETVIEW doesn't change window style bits within LVS_TYPEMASK,
|
||||||
|
changing style updates current view only when view bits change. */
|
||||||
|
map_style_view(infoPtr);
|
||||||
SendMessageW(infoPtr->hwndEdit, WM_KILLFOCUS, 0, 0);
|
SendMessageW(infoPtr->hwndEdit, WM_KILLFOCUS, 0, 0);
|
||||||
ShowWindow(infoPtr->hwndHeader, SW_HIDE);
|
ShowWindow(infoPtr->hwndHeader, SW_HIDE);
|
||||||
|
|
||||||
|
@ -11713,12 +11750,14 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
|
|
||||||
case WM_SYSCOLORCHANGE:
|
case WM_SYSCOLORCHANGE:
|
||||||
COMCTL32_RefreshSysColors();
|
COMCTL32_RefreshSysColors();
|
||||||
|
#ifdef __REACTOS__
|
||||||
if (infoPtr->bDefaultBkColor)
|
if (infoPtr->bDefaultBkColor)
|
||||||
{
|
{
|
||||||
LISTVIEW_SetBkColor(infoPtr, comctl32_color.clrWindow);
|
LISTVIEW_SetBkColor(infoPtr, comctl32_color.clrWindow);
|
||||||
infoPtr->bDefaultBkColor = TRUE;
|
infoPtr->bDefaultBkColor = TRUE;
|
||||||
LISTVIEW_InvalidateList(infoPtr);
|
LISTVIEW_InvalidateList(infoPtr);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* case WM_TIMER: */
|
/* case WM_TIMER: */
|
||||||
|
|
|
@ -850,10 +850,16 @@ static void MONTHCAL_PaintButton(MONTHCAL_INFO *infoPtr, HDC hdc, enum nav_direc
|
||||||
/* paint a title with buttons and month/year string */
|
/* paint a title with buttons and month/year string */
|
||||||
static void MONTHCAL_PaintTitle(MONTHCAL_INFO *infoPtr, HDC hdc, const PAINTSTRUCT *ps, INT calIdx)
|
static void MONTHCAL_PaintTitle(MONTHCAL_INFO *infoPtr, HDC hdc, const PAINTSTRUCT *ps, INT calIdx)
|
||||||
{
|
{
|
||||||
static const WCHAR fmt_monthW[] = { '%','s',' ','%','l','d',0 };
|
static const WCHAR mmmmW[] = {'M','M','M','M',0};
|
||||||
|
static const WCHAR mmmW[] = {'M','M','M',0};
|
||||||
|
static const WCHAR mmW[] = {'M','M',0};
|
||||||
|
static const WCHAR fmtyearW[] = {'%','l','d',0};
|
||||||
|
static const WCHAR fmtmmW[] = {'%','0','2','d',0};
|
||||||
|
static const WCHAR fmtmW[] = {'%','d',0};
|
||||||
RECT *title = &infoPtr->calendars[calIdx].title;
|
RECT *title = &infoPtr->calendars[calIdx].title;
|
||||||
const SYSTEMTIME *st = &infoPtr->calendars[calIdx].month;
|
const SYSTEMTIME *st = &infoPtr->calendars[calIdx].month;
|
||||||
WCHAR buf_month[80], buf_fmt[80];
|
WCHAR monthW[80], strW[80], fmtW[80], yearW[6] /* valid year range is 1601-30827 */;
|
||||||
|
int yearoffset, monthoffset, shiftX;
|
||||||
SIZE sz;
|
SIZE sz;
|
||||||
|
|
||||||
/* fill header box */
|
/* fill header box */
|
||||||
|
@ -864,21 +870,65 @@ static void MONTHCAL_PaintTitle(MONTHCAL_INFO *infoPtr, HDC hdc, const PAINTSTRU
|
||||||
SetTextColor(hdc, infoPtr->colors[MCSC_TITLETEXT]);
|
SetTextColor(hdc, infoPtr->colors[MCSC_TITLETEXT]);
|
||||||
SelectObject(hdc, infoPtr->hBoldFont);
|
SelectObject(hdc, infoPtr->hBoldFont);
|
||||||
|
|
||||||
GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SMONTHNAME1 + st->wMonth - 1,
|
/* draw formatted date string */
|
||||||
buf_month, countof(buf_month));
|
GetDateFormatW(LOCALE_USER_DEFAULT, DATE_YEARMONTH, st, NULL, strW, countof(strW));
|
||||||
|
DrawTextW(hdc, strW, strlenW(strW), title, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
|
||||||
|
|
||||||
wsprintfW(buf_fmt, fmt_monthW, buf_month, st->wYear);
|
GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SYEARMONTH, fmtW, countof(fmtW));
|
||||||
DrawTextW(hdc, buf_fmt, strlenW(buf_fmt), title,
|
wsprintfW(yearW, fmtyearW, st->wYear);
|
||||||
DT_CENTER | DT_VCENTER | DT_SINGLELINE);
|
|
||||||
|
|
||||||
/* update title rectangles with current month - used while testing hits */
|
/* month is trickier as it's possible to have different format pictures, we'll
|
||||||
GetTextExtentPoint32W(hdc, buf_fmt, strlenW(buf_fmt), &sz);
|
test for M, MM, MMM, and MMMM */
|
||||||
infoPtr->calendars[calIdx].titlemonth.left = title->right / 2 + title->left / 2 - sz.cx / 2;
|
if (strstrW(fmtW, mmmmW))
|
||||||
infoPtr->calendars[calIdx].titleyear.right = title->right / 2 + title->left / 2 + sz.cx / 2;
|
GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SMONTHNAME1+st->wMonth-1, monthW, countof(monthW));
|
||||||
|
else if (strstrW(fmtW, mmmW))
|
||||||
|
GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SABBREVMONTHNAME1+st->wMonth-1, monthW, countof(monthW));
|
||||||
|
else if (strstrW(fmtW, mmW))
|
||||||
|
wsprintfW(monthW, fmtmmW, st->wMonth);
|
||||||
|
else
|
||||||
|
wsprintfW(monthW, fmtmW, st->wMonth);
|
||||||
|
|
||||||
GetTextExtentPoint32W(hdc, buf_month, strlenW(buf_month), &sz);
|
/* update hit boxes */
|
||||||
|
yearoffset = 0;
|
||||||
|
while (strW[yearoffset])
|
||||||
|
{
|
||||||
|
if (!strncmpW(&strW[yearoffset], yearW, strlenW(yearW)))
|
||||||
|
break;
|
||||||
|
yearoffset++;
|
||||||
|
}
|
||||||
|
|
||||||
|
monthoffset = 0;
|
||||||
|
while (strW[monthoffset])
|
||||||
|
{
|
||||||
|
if (!strncmpW(&strW[monthoffset], monthW, strlenW(monthW)))
|
||||||
|
break;
|
||||||
|
monthoffset++;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* for left limits use offsets */
|
||||||
|
sz.cx = 0;
|
||||||
|
if (yearoffset)
|
||||||
|
GetTextExtentPoint32W(hdc, strW, yearoffset, &sz);
|
||||||
|
infoPtr->calendars[calIdx].titleyear.left = sz.cx;
|
||||||
|
|
||||||
|
sz.cx = 0;
|
||||||
|
if (monthoffset)
|
||||||
|
GetTextExtentPoint32W(hdc, strW, monthoffset, &sz);
|
||||||
|
infoPtr->calendars[calIdx].titlemonth.left = sz.cx;
|
||||||
|
|
||||||
|
/* for right limits use actual string parts lengths */
|
||||||
|
GetTextExtentPoint32W(hdc, &strW[yearoffset], strlenW(yearW), &sz);
|
||||||
|
infoPtr->calendars[calIdx].titleyear.right = infoPtr->calendars[calIdx].titleyear.left + sz.cx;
|
||||||
|
|
||||||
|
GetTextExtentPoint32W(hdc, monthW, strlenW(monthW), &sz);
|
||||||
infoPtr->calendars[calIdx].titlemonth.right = infoPtr->calendars[calIdx].titlemonth.left + sz.cx;
|
infoPtr->calendars[calIdx].titlemonth.right = infoPtr->calendars[calIdx].titlemonth.left + sz.cx;
|
||||||
infoPtr->calendars[calIdx].titleyear.left = infoPtr->calendars[calIdx].titlemonth.right;
|
|
||||||
|
/* Finally translate rectangles to match center aligned string,
|
||||||
|
hit rectangles are relative to title rectangle before translation. */
|
||||||
|
GetTextExtentPoint32W(hdc, strW, strlenW(strW), &sz);
|
||||||
|
shiftX = (title->right - title->left - sz.cx) / 2 + title->left;
|
||||||
|
OffsetRect(&infoPtr->calendars[calIdx].titleyear, shiftX, 0);
|
||||||
|
OffsetRect(&infoPtr->calendars[calIdx].titlemonth, shiftX, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void MONTHCAL_PaintWeeknumbers(const MONTHCAL_INFO *infoPtr, HDC hdc, const PAINTSTRUCT *ps, INT calIdx)
|
static void MONTHCAL_PaintWeeknumbers(const MONTHCAL_INFO *infoPtr, HDC hdc, const PAINTSTRUCT *ps, INT calIdx)
|
||||||
|
@ -1002,13 +1052,7 @@ static void MONTHCAL_PaintTodayTitle(const MONTHCAL_INFO *infoPtr, HDC hdc, cons
|
||||||
|
|
||||||
if(infoPtr->dwStyle & MCS_NOTODAY) return;
|
if(infoPtr->dwStyle & MCS_NOTODAY) return;
|
||||||
|
|
||||||
if (!LoadStringW(COMCTL32_hModule, IDM_TODAY, buf_todayW, countof(buf_todayW)))
|
LoadStringW(COMCTL32_hModule, IDM_TODAY, buf_todayW, countof(buf_todayW));
|
||||||
{
|
|
||||||
static const WCHAR todayW[] = { 'T','o','d','a','y',':',0 };
|
|
||||||
WARN("Can't load resource\n");
|
|
||||||
strcpyW(buf_todayW, todayW);
|
|
||||||
}
|
|
||||||
|
|
||||||
col = infoPtr->dwStyle & MCS_NOTODAYCIRCLE ? 0 : 1;
|
col = infoPtr->dwStyle & MCS_NOTODAYCIRCLE ? 0 : 1;
|
||||||
if (infoPtr->dwStyle & MCS_WEEKNUMBERS) col--;
|
if (infoPtr->dwStyle & MCS_WEEKNUMBERS) col--;
|
||||||
/* label is located below first calendar last row */
|
/* label is located below first calendar last row */
|
||||||
|
@ -1968,17 +2012,12 @@ static void MONTHCAL_GoToMonth(MONTHCAL_INFO *infoPtr, enum nav_direction direct
|
||||||
static LRESULT
|
static LRESULT
|
||||||
MONTHCAL_RButtonUp(MONTHCAL_INFO *infoPtr, LPARAM lParam)
|
MONTHCAL_RButtonUp(MONTHCAL_INFO *infoPtr, LPARAM lParam)
|
||||||
{
|
{
|
||||||
static const WCHAR todayW[] = { 'G','o',' ','t','o',' ','T','o','d','a','y',':',0 };
|
|
||||||
HMENU hMenu;
|
HMENU hMenu;
|
||||||
POINT menupoint;
|
POINT menupoint;
|
||||||
WCHAR buf[32];
|
WCHAR buf[32];
|
||||||
|
|
||||||
hMenu = CreatePopupMenu();
|
hMenu = CreatePopupMenu();
|
||||||
if (!LoadStringW(COMCTL32_hModule, IDM_GOTODAY, buf, countof(buf)))
|
LoadStringW(COMCTL32_hModule, IDM_GOTODAY, buf, countof(buf));
|
||||||
{
|
|
||||||
WARN("Can't load resource\n");
|
|
||||||
strcpyW(buf, todayW);
|
|
||||||
}
|
|
||||||
AppendMenuW(hMenu, MF_STRING|MF_ENABLED, 1, buf);
|
AppendMenuW(hMenu, MF_STRING|MF_ENABLED, 1, buf);
|
||||||
menupoint.x = (short)LOWORD(lParam);
|
menupoint.x = (short)LOWORD(lParam);
|
||||||
menupoint.y = (short)HIWORD(lParam);
|
menupoint.y = (short)HIWORD(lParam);
|
||||||
|
|
|
@ -1380,7 +1380,7 @@ REBAR_Layout(REBAR_INFO *infoPtr)
|
||||||
adjcx = get_rect_cx(infoPtr, &rcAdj);
|
adjcx = get_rect_cx(infoPtr, &rcAdj);
|
||||||
|
|
||||||
if (infoPtr->uNumBands == 0) {
|
if (infoPtr->uNumBands == 0) {
|
||||||
TRACE("No bands - setting size to (0,%d), vert: %x\n", adjcx, infoPtr->dwStyle & CCS_VERT);
|
TRACE("No bands - setting size to (0,%d), style: %x\n", adjcx, infoPtr->dwStyle);
|
||||||
infoPtr->calcSize.cx = adjcx;
|
infoPtr->calcSize.cx = adjcx;
|
||||||
/* the calcSize.cy won't change for a 0 band rebar */
|
/* the calcSize.cy won't change for a 0 band rebar */
|
||||||
infoPtr->uNumRows = 0;
|
infoPtr->uNumRows = 0;
|
||||||
|
@ -1828,11 +1828,14 @@ static LRESULT REBAR_EraseBkGnd (const REBAR_INFO *infoPtr, HDC hdc)
|
||||||
RECT cr;
|
RECT cr;
|
||||||
COLORREF old = CLR_NONE, new;
|
COLORREF old = CLR_NONE, new;
|
||||||
HTHEME theme = GetWindowTheme (infoPtr->hwndSelf);
|
HTHEME theme = GetWindowTheme (infoPtr->hwndSelf);
|
||||||
|
#ifdef __REACTOS__
|
||||||
HRGN hrgn;
|
HRGN hrgn;
|
||||||
|
#endif
|
||||||
|
|
||||||
GetClientRect (infoPtr->hwndSelf, &cr);
|
GetClientRect (infoPtr->hwndSelf, &cr);
|
||||||
|
|
||||||
#ifdef __REACTOS__
|
#ifdef __REACTOS__
|
||||||
|
|
||||||
if (theme)
|
if (theme)
|
||||||
{
|
{
|
||||||
if (IsThemeBackgroundPartiallyTransparent(theme, RP_BACKGROUND, 0))
|
if (IsThemeBackgroundPartiallyTransparent(theme, RP_BACKGROUND, 0))
|
||||||
|
@ -1841,21 +1844,26 @@ static LRESULT REBAR_EraseBkGnd (const REBAR_INFO *infoPtr, HDC hdc)
|
||||||
}
|
}
|
||||||
DrawThemeBackground (theme, hdc, 0, 0, &cr, NULL);
|
DrawThemeBackground (theme, hdc, 0, 0, &cr, NULL);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
hrgn = CreateRectRgn(cr.left, cr.top, cr.right, cr.bottom);
|
hrgn = CreateRectRgn(cr.left, cr.top, cr.right, cr.bottom);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
oldrow = -1;
|
oldrow = -1;
|
||||||
for(i=0; i<infoPtr->uNumBands; i++) {
|
for(i=0; i<infoPtr->uNumBands; i++) {
|
||||||
RECT rcBand;
|
RECT rcBand;
|
||||||
|
#ifdef __REACTOS__
|
||||||
RECT rcBandReal;
|
RECT rcBandReal;
|
||||||
HRGN hrgnBand;
|
HRGN hrgnBand;
|
||||||
|
#endif
|
||||||
|
|
||||||
lpBand = REBAR_GetBand(infoPtr, i);
|
lpBand = REBAR_GetBand(infoPtr, i);
|
||||||
|
|
||||||
if (HIDDENBAND(lpBand)) continue;
|
if (HIDDENBAND(lpBand)) continue;
|
||||||
translate_rect(infoPtr, &rcBand, &lpBand->rcBand);
|
translate_rect(infoPtr, &rcBand, &lpBand->rcBand);
|
||||||
|
|
||||||
|
#ifdef __REACTOS__
|
||||||
rcBandReal = rcBand;
|
rcBandReal = rcBand;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* draw band separator between rows */
|
/* draw band separator between rows */
|
||||||
if (lpBand->iRow != oldrow) {
|
if (lpBand->iRow != oldrow) {
|
||||||
|
@ -1881,7 +1889,9 @@ static LRESULT REBAR_EraseBkGnd (const REBAR_INFO *infoPtr, HDC hdc)
|
||||||
}
|
}
|
||||||
TRACE ("drawing band separator bottom (%s)\n",
|
TRACE ("drawing band separator bottom (%s)\n",
|
||||||
wine_dbgstr_rect(&rcRowSep));
|
wine_dbgstr_rect(&rcRowSep));
|
||||||
|
#ifdef __REACTOS__
|
||||||
rcBandReal = rcRowSep;
|
rcBandReal = rcRowSep;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1892,7 +1902,9 @@ static LRESULT REBAR_EraseBkGnd (const REBAR_INFO *infoPtr, HDC hdc)
|
||||||
if (infoPtr->dwStyle & CCS_VERT) {
|
if (infoPtr->dwStyle & CCS_VERT) {
|
||||||
rcSep.bottom = rcSep.top;
|
rcSep.bottom = rcSep.top;
|
||||||
rcSep.top -= SEP_WIDTH_SIZE;
|
rcSep.top -= SEP_WIDTH_SIZE;
|
||||||
|
#ifdef __REACTOS__
|
||||||
rcBandReal.top -= SEP_WIDTH_SIZE;
|
rcBandReal.top -= SEP_WIDTH_SIZE;
|
||||||
|
#endif
|
||||||
if (theme)
|
if (theme)
|
||||||
DrawThemeEdge (theme, hdc, RP_BAND, 0, &rcSep, EDGE_ETCHED, BF_BOTTOM, NULL);
|
DrawThemeEdge (theme, hdc, RP_BAND, 0, &rcSep, EDGE_ETCHED, BF_BOTTOM, NULL);
|
||||||
else
|
else
|
||||||
|
@ -1901,7 +1913,9 @@ static LRESULT REBAR_EraseBkGnd (const REBAR_INFO *infoPtr, HDC hdc)
|
||||||
else {
|
else {
|
||||||
rcSep.right = rcSep.left;
|
rcSep.right = rcSep.left;
|
||||||
rcSep.left -= SEP_WIDTH_SIZE;
|
rcSep.left -= SEP_WIDTH_SIZE;
|
||||||
|
#ifdef __REACTOS__
|
||||||
rcBandReal.left -= SEP_WIDTH_SIZE;
|
rcBandReal.left -= SEP_WIDTH_SIZE;
|
||||||
|
#endif
|
||||||
if (theme)
|
if (theme)
|
||||||
DrawThemeEdge (theme, hdc, RP_BAND, 0, &rcSep, EDGE_ETCHED, BF_RIGHT, NULL);
|
DrawThemeEdge (theme, hdc, RP_BAND, 0, &rcSep, EDGE_ETCHED, BF_RIGHT, NULL);
|
||||||
else
|
else
|
||||||
|
@ -1954,9 +1968,11 @@ static LRESULT REBAR_EraseBkGnd (const REBAR_INFO *infoPtr, HDC hdc)
|
||||||
SetBkColor (hdc, old);
|
SetBkColor (hdc, old);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __REACTOS__
|
||||||
hrgnBand = CreateRectRgn(rcBandReal.left, rcBandReal.top, rcBandReal.right, rcBandReal.bottom);
|
hrgnBand = CreateRectRgn(rcBandReal.left, rcBandReal.top, rcBandReal.right, rcBandReal.bottom);
|
||||||
CombineRgn(hrgn, hrgn, hrgnBand, RGN_DIFF);
|
CombineRgn(hrgn, hrgn, hrgnBand, RGN_DIFF);
|
||||||
DeleteObject(hrgnBand);
|
DeleteObject(hrgnBand);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 1
|
#if 1
|
||||||
|
|
|
@ -142,8 +142,7 @@ static void CB_draw(HTHEME theme, HWND hwnd, HDC hDC, ButtonState drawState, UIN
|
||||||
{ RBS_CHECKEDNORMAL, RBS_CHECKEDDISABLED, RBS_CHECKEDHOT, RBS_CHECKEDPRESSED, RBS_CHECKEDNORMAL }
|
{ RBS_CHECKEDNORMAL, RBS_CHECKEDDISABLED, RBS_CHECKEDHOT, RBS_CHECKEDPRESSED, RBS_CHECKEDNORMAL }
|
||||||
};
|
};
|
||||||
|
|
||||||
static const int cb_size = 13;
|
SIZE sz;
|
||||||
|
|
||||||
RECT bgRect, textRect;
|
RECT bgRect, textRect;
|
||||||
HFONT font, hPrevFont = NULL;
|
HFONT font, hPrevFont = NULL;
|
||||||
LRESULT checkState = SendMessageW(hwnd, BM_GETCHECK, 0, 0);
|
LRESULT checkState = SendMessageW(hwnd, BM_GETCHECK, 0, 0);
|
||||||
|
@ -173,15 +172,18 @@ static void CB_draw(HTHEME theme, HWND hwnd, HDC hDC, ButtonState drawState, UIN
|
||||||
hPrevFont = SelectObject(hDC, font);
|
hPrevFont = SelectObject(hDC, font);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (FAILED(GetThemePartSize(theme, hDC, part, state, NULL, TS_DRAW, &sz)))
|
||||||
|
sz.cx = sz.cy = 13;
|
||||||
|
|
||||||
GetClientRect(hwnd, &bgRect);
|
GetClientRect(hwnd, &bgRect);
|
||||||
GetThemeBackgroundContentRect(theme, hDC, part, state, &bgRect, &textRect);
|
GetThemeBackgroundContentRect(theme, hDC, part, state, &bgRect, &textRect);
|
||||||
|
|
||||||
if (dtFlags & DT_SINGLELINE) /* Center the checkbox / radio button to the text. */
|
if (dtFlags & DT_SINGLELINE) /* Center the checkbox / radio button to the text. */
|
||||||
bgRect.top = bgRect.top + (textRect.bottom - textRect.top - cb_size) / 2;
|
bgRect.top = bgRect.top + (textRect.bottom - textRect.top - sz.cy) / 2;
|
||||||
|
|
||||||
/* adjust for the check/radio marker */
|
/* adjust for the check/radio marker */
|
||||||
bgRect.bottom = bgRect.top + cb_size;
|
bgRect.bottom = bgRect.top + sz.cy;
|
||||||
bgRect.right = bgRect.left + cb_size;
|
bgRect.right = bgRect.left + sz.cx;
|
||||||
textRect.left = bgRect.right + 6;
|
textRect.left = bgRect.right + 6;
|
||||||
|
|
||||||
DrawThemeParentBackground(hwnd, hDC, NULL);
|
DrawThemeParentBackground(hwnd, hDC, NULL);
|
||||||
|
@ -367,9 +369,11 @@ LRESULT CALLBACK THEMING_ButtonSubclassProc(HWND hwnd, UINT msg,
|
||||||
|
|
||||||
case WM_ENABLE:
|
case WM_ENABLE:
|
||||||
theme = GetWindowTheme(hwnd);
|
theme = GetWindowTheme(hwnd);
|
||||||
if (theme) RedrawWindow(hwnd, NULL, NULL,
|
if (theme) {
|
||||||
RDW_FRAME | RDW_INVALIDATE | RDW_UPDATENOW);
|
RedrawWindow(hwnd, NULL, NULL, RDW_FRAME | RDW_INVALIDATE | RDW_UPDATENOW);
|
||||||
return THEMING_CallOriginalClass(hwnd, msg, wParam, lParam);
|
return 0;
|
||||||
|
} else
|
||||||
|
return THEMING_CallOriginalClass(hwnd, msg, wParam, lParam);
|
||||||
|
|
||||||
case WM_MOUSEMOVE:
|
case WM_MOUSEMOVE:
|
||||||
{
|
{
|
||||||
|
|
|
@ -23,11 +23,552 @@
|
||||||
|
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL(theme_scroll);
|
WINE_DEFAULT_DEBUG_CHANNEL(theme_scroll);
|
||||||
|
|
||||||
|
/* Minimum size of the thumb in pixels */
|
||||||
|
#define SCROLL_MIN_THUMB 6
|
||||||
|
|
||||||
|
/* Minimum size of the rectangle between the arrows */
|
||||||
|
#define SCROLL_MIN_RECT 4
|
||||||
|
|
||||||
|
enum SCROLL_HITTEST
|
||||||
|
{
|
||||||
|
SCROLL_NOWHERE, /* Outside the scroll bar */
|
||||||
|
SCROLL_TOP_ARROW, /* Top or left arrow */
|
||||||
|
SCROLL_TOP_RECT, /* Rectangle between the top arrow and the thumb */
|
||||||
|
SCROLL_THUMB, /* Thumb rectangle */
|
||||||
|
SCROLL_BOTTOM_RECT, /* Rectangle between the thumb and the bottom arrow */
|
||||||
|
SCROLL_BOTTOM_ARROW /* Bottom or right arrow */
|
||||||
|
};
|
||||||
|
|
||||||
|
static HWND tracking_win = 0;
|
||||||
|
static enum SCROLL_HITTEST tracking_hot_part = SCROLL_NOWHERE;
|
||||||
|
|
||||||
|
static void calc_thumb_dimensions(unsigned int size, SCROLLINFO *si, unsigned int *thumbpos, unsigned int *thumbsize)
|
||||||
|
{
|
||||||
|
if (size <= SCROLL_MIN_RECT)
|
||||||
|
*thumbpos = *thumbsize = 0;
|
||||||
|
else if (si->nPage > si->nMax - si->nMin)
|
||||||
|
*thumbpos = *thumbsize = 0;
|
||||||
|
else {
|
||||||
|
if (si->nPage > 0) {
|
||||||
|
*thumbsize = MulDiv(size, si->nPage, si->nMax - si->nMin + 1);
|
||||||
|
if (*thumbsize < SCROLL_MIN_THUMB) *thumbsize = SCROLL_MIN_THUMB;
|
||||||
|
}
|
||||||
|
else *thumbsize = GetSystemMetrics(SM_CXVSCROLL);
|
||||||
|
|
||||||
|
if (size < *thumbsize)
|
||||||
|
*thumbpos = *thumbsize = 0;
|
||||||
|
else {
|
||||||
|
int max = si->nMax - max(si->nPage - 1, 0);
|
||||||
|
size -= *thumbsize;
|
||||||
|
if (si->nMin >= max)
|
||||||
|
*thumbpos = 0;
|
||||||
|
else
|
||||||
|
*thumbpos = MulDiv(size, si->nTrackPos - si->nMin, max - si->nMin);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static enum SCROLL_HITTEST hit_test(HWND hwnd, HTHEME theme, POINT pt)
|
||||||
|
{
|
||||||
|
RECT r;
|
||||||
|
DWORD style = GetWindowLongW(hwnd, GWL_STYLE);
|
||||||
|
BOOL vertical = style & SBS_VERT;
|
||||||
|
SIZE sz;
|
||||||
|
SCROLLINFO si;
|
||||||
|
unsigned int offset, size, upsize, downsize, thumbpos, thumbsize;
|
||||||
|
|
||||||
|
GetWindowRect(hwnd, &r);
|
||||||
|
OffsetRect(&r, -r.left, -r.top);
|
||||||
|
|
||||||
|
if (vertical) {
|
||||||
|
offset = pt.y;
|
||||||
|
size = r.bottom;
|
||||||
|
|
||||||
|
if (FAILED(GetThemePartSize(theme, NULL, SBP_ARROWBTN, ABS_UPNORMAL, NULL, TS_DRAW, &sz))) {
|
||||||
|
WARN("Could not get up arrow size.\n");
|
||||||
|
upsize = 0;
|
||||||
|
} else
|
||||||
|
upsize = sz.cy;
|
||||||
|
|
||||||
|
if (FAILED(GetThemePartSize(theme, NULL, SBP_ARROWBTN, ABS_DOWNNORMAL, NULL, TS_DRAW, &sz))) {
|
||||||
|
WARN("Could not get down arrow size.\n");
|
||||||
|
downsize = 0;
|
||||||
|
} else
|
||||||
|
downsize = sz.cy;
|
||||||
|
} else {
|
||||||
|
offset = pt.x;
|
||||||
|
size = r.right;
|
||||||
|
|
||||||
|
if (FAILED(GetThemePartSize(theme, NULL, SBP_ARROWBTN, ABS_LEFTNORMAL, NULL, TS_DRAW, &sz))) {
|
||||||
|
WARN("Could not get left arrow size.\n");
|
||||||
|
upsize = 0;
|
||||||
|
} else
|
||||||
|
upsize = sz.cx;
|
||||||
|
|
||||||
|
if (FAILED(GetThemePartSize(theme, NULL, SBP_ARROWBTN, ABS_RIGHTNORMAL, NULL, TS_DRAW, &sz))) {
|
||||||
|
WARN("Could not get right arrow size.\n");
|
||||||
|
downsize = 0;
|
||||||
|
} else
|
||||||
|
downsize = sz.cx;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pt.x < 0 || pt.x > r.right || pt.y < 0 || pt.y > r.bottom)
|
||||||
|
return SCROLL_NOWHERE;
|
||||||
|
|
||||||
|
if (size < SCROLL_MIN_RECT + upsize + downsize)
|
||||||
|
upsize = downsize = (size - SCROLL_MIN_RECT)/2;
|
||||||
|
|
||||||
|
if (offset < upsize)
|
||||||
|
return SCROLL_TOP_ARROW;
|
||||||
|
|
||||||
|
if (offset > size - downsize)
|
||||||
|
return SCROLL_BOTTOM_ARROW;
|
||||||
|
|
||||||
|
si.cbSize = sizeof(si);
|
||||||
|
si.fMask = SIF_ALL;
|
||||||
|
if (!GetScrollInfo(hwnd, SB_CTL, &si)) {
|
||||||
|
WARN("GetScrollInfo failed.\n");
|
||||||
|
return SCROLL_NOWHERE;
|
||||||
|
}
|
||||||
|
|
||||||
|
calc_thumb_dimensions(size - upsize - downsize, &si, &thumbpos, &thumbsize);
|
||||||
|
|
||||||
|
if (offset < upsize + thumbpos)
|
||||||
|
return SCROLL_TOP_RECT;
|
||||||
|
else if (offset < upsize + thumbpos + thumbsize)
|
||||||
|
return SCROLL_THUMB;
|
||||||
|
else
|
||||||
|
return SCROLL_BOTTOM_RECT;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void redraw_part(HWND hwnd, HTHEME theme, enum SCROLL_HITTEST part)
|
||||||
|
{
|
||||||
|
DWORD style = GetWindowLongW(hwnd, GWL_STYLE);
|
||||||
|
BOOL vertical = style & SBS_VERT;
|
||||||
|
SIZE sz;
|
||||||
|
RECT r, partrect;
|
||||||
|
unsigned int size, upsize, downsize;
|
||||||
|
|
||||||
|
if (part == SCROLL_NOWHERE) { /* redraw everything */
|
||||||
|
InvalidateRect(hwnd, NULL, TRUE);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
GetWindowRect(hwnd, &r);
|
||||||
|
OffsetRect(&r, -r.left, -r.top);
|
||||||
|
|
||||||
|
if (vertical) {
|
||||||
|
size = r.bottom;
|
||||||
|
|
||||||
|
if (FAILED(GetThemePartSize(theme, NULL, SBP_ARROWBTN, ABS_UPNORMAL, NULL, TS_DRAW, &sz))) {
|
||||||
|
WARN("Could not get up arrow size.\n");
|
||||||
|
upsize = 0;
|
||||||
|
} else
|
||||||
|
upsize = sz.cy;
|
||||||
|
|
||||||
|
if (FAILED(GetThemePartSize(theme, NULL, SBP_ARROWBTN, ABS_DOWNNORMAL, NULL, TS_DRAW, &sz))) {
|
||||||
|
WARN("Could not get down arrow size.\n");
|
||||||
|
downsize = 0;
|
||||||
|
} else
|
||||||
|
downsize = sz.cy;
|
||||||
|
} else {
|
||||||
|
size = r.right;
|
||||||
|
|
||||||
|
if (FAILED(GetThemePartSize(theme, NULL, SBP_ARROWBTN, ABS_LEFTNORMAL, NULL, TS_DRAW, &sz))) {
|
||||||
|
WARN("Could not get left arrow size.\n");
|
||||||
|
upsize = 0;
|
||||||
|
} else
|
||||||
|
upsize = sz.cx;
|
||||||
|
|
||||||
|
if (FAILED(GetThemePartSize(theme, NULL, SBP_ARROWBTN, ABS_RIGHTNORMAL, NULL, TS_DRAW, &sz))) {
|
||||||
|
WARN("Could not get right arrow size.\n");
|
||||||
|
downsize = 0;
|
||||||
|
} else
|
||||||
|
downsize = sz.cx;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (size < SCROLL_MIN_RECT + upsize + downsize)
|
||||||
|
upsize = downsize = (size - SCROLL_MIN_RECT)/2;
|
||||||
|
|
||||||
|
partrect = r;
|
||||||
|
|
||||||
|
if (part == SCROLL_TOP_ARROW) {
|
||||||
|
if (vertical)
|
||||||
|
partrect.bottom = partrect.top + upsize;
|
||||||
|
else
|
||||||
|
partrect.right = partrect.left + upsize;
|
||||||
|
} else if (part == SCROLL_BOTTOM_ARROW) {
|
||||||
|
if (vertical)
|
||||||
|
partrect.top = partrect.bottom - downsize;
|
||||||
|
else
|
||||||
|
partrect.left = partrect.right - downsize;
|
||||||
|
} else {
|
||||||
|
unsigned int thumbpos, thumbsize;
|
||||||
|
SCROLLINFO si;
|
||||||
|
|
||||||
|
si.cbSize = sizeof(si);
|
||||||
|
si.fMask = SIF_ALL;
|
||||||
|
if (!GetScrollInfo(hwnd, SB_CTL, &si)) {
|
||||||
|
WARN("GetScrollInfo failed.\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
calc_thumb_dimensions(size - upsize - downsize, &si, &thumbpos, &thumbsize);
|
||||||
|
|
||||||
|
if (part == SCROLL_TOP_RECT) {
|
||||||
|
if (vertical) {
|
||||||
|
partrect.top = r.top + upsize;
|
||||||
|
partrect.bottom = partrect.top + thumbpos;
|
||||||
|
} else {
|
||||||
|
partrect.left = r.left + upsize;
|
||||||
|
partrect.right = partrect.left + thumbpos;
|
||||||
|
}
|
||||||
|
} else if (part == SCROLL_THUMB) {
|
||||||
|
if (vertical) {
|
||||||
|
partrect.top = r.top + upsize + thumbpos;
|
||||||
|
partrect.bottom = partrect.top + thumbsize;
|
||||||
|
} else {
|
||||||
|
partrect.left = r.left + upsize + thumbpos;
|
||||||
|
partrect.right = partrect.left + thumbsize;
|
||||||
|
}
|
||||||
|
} else if (part == SCROLL_BOTTOM_RECT) {
|
||||||
|
if (vertical) {
|
||||||
|
partrect.top = r.top + upsize + thumbpos + thumbsize;
|
||||||
|
partrect.bottom = r.bottom - downsize;
|
||||||
|
} else {
|
||||||
|
partrect.left = r.left + upsize + thumbpos + thumbsize;
|
||||||
|
partrect.right = r.right - downsize;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
InvalidateRect(hwnd, &partrect, TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void scroll_event(HWND hwnd, HTHEME theme, UINT msg, POINT pt)
|
||||||
|
{
|
||||||
|
enum SCROLL_HITTEST hittest;
|
||||||
|
TRACKMOUSEEVENT tme;
|
||||||
|
|
||||||
|
if (GetWindowLongW(hwnd, GWL_STYLE) & (SBS_SIZEGRIP | SBS_SIZEBOX))
|
||||||
|
return;
|
||||||
|
|
||||||
|
hittest = hit_test(hwnd, theme, pt);
|
||||||
|
|
||||||
|
switch (msg)
|
||||||
|
{
|
||||||
|
case WM_MOUSEMOVE:
|
||||||
|
hittest = hit_test(hwnd, theme, pt);
|
||||||
|
tracking_win = hwnd;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case WM_MOUSELEAVE:
|
||||||
|
if (tracking_win == hwnd) {
|
||||||
|
hittest = SCROLL_NOWHERE;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
tme.cbSize = sizeof(tme);
|
||||||
|
tme.dwFlags = TME_QUERY;
|
||||||
|
TrackMouseEvent(&tme);
|
||||||
|
|
||||||
|
if (!(tme.dwFlags & TME_LEAVE) || tme.hwndTrack != hwnd) {
|
||||||
|
tme.dwFlags = TME_LEAVE;
|
||||||
|
tme.hwndTrack = hwnd;
|
||||||
|
TrackMouseEvent(&tme);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tracking_win != hwnd && msg == WM_MOUSELEAVE) {
|
||||||
|
redraw_part(hwnd, theme, SCROLL_NOWHERE);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tracking_win == hwnd && hittest != tracking_hot_part) {
|
||||||
|
enum SCROLL_HITTEST oldhotpart = tracking_hot_part;
|
||||||
|
|
||||||
|
tracking_hot_part = hittest;
|
||||||
|
|
||||||
|
if (hittest != SCROLL_NOWHERE)
|
||||||
|
redraw_part(hwnd, theme, hittest);
|
||||||
|
else
|
||||||
|
tracking_win = 0;
|
||||||
|
|
||||||
|
if (oldhotpart != SCROLL_NOWHERE)
|
||||||
|
redraw_part(hwnd, theme, oldhotpart);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void paint_scrollbar(HWND hwnd, HTHEME theme)
|
||||||
|
{
|
||||||
|
HDC dc;
|
||||||
|
PAINTSTRUCT ps;
|
||||||
|
RECT r;
|
||||||
|
DWORD style = GetWindowLongW(hwnd, GWL_STYLE);
|
||||||
|
BOOL vertical = style & SBS_VERT;
|
||||||
|
BOOL disabled = !IsWindowEnabled(hwnd);
|
||||||
|
|
||||||
|
GetWindowRect(hwnd, &r);
|
||||||
|
OffsetRect(&r, -r.left, -r.top);
|
||||||
|
|
||||||
|
dc = BeginPaint(hwnd, &ps);
|
||||||
|
|
||||||
|
if (style & SBS_SIZEBOX || style & SBS_SIZEGRIP) {
|
||||||
|
int state;
|
||||||
|
|
||||||
|
if (style & SBS_SIZEBOXTOPLEFTALIGN)
|
||||||
|
state = SZB_TOPLEFTALIGN;
|
||||||
|
else
|
||||||
|
state = SZB_RIGHTALIGN;
|
||||||
|
|
||||||
|
DrawThemeBackground(theme, dc, SBP_SIZEBOX, state, &r, NULL);
|
||||||
|
} else {
|
||||||
|
SCROLLBARINFO sbi;
|
||||||
|
SCROLLINFO si;
|
||||||
|
unsigned int thumbpos, thumbsize;
|
||||||
|
int uppertrackstate, lowertrackstate, thumbstate;
|
||||||
|
RECT partrect, trackrect;
|
||||||
|
SIZE grippersize;
|
||||||
|
|
||||||
|
sbi.cbSize = sizeof(sbi);
|
||||||
|
GetScrollBarInfo(hwnd, OBJID_CLIENT, &sbi);
|
||||||
|
|
||||||
|
si.cbSize = sizeof(si);
|
||||||
|
si.fMask = SIF_ALL;
|
||||||
|
GetScrollInfo(hwnd, SB_CTL, &si);
|
||||||
|
|
||||||
|
trackrect = r;
|
||||||
|
|
||||||
|
if (disabled) {
|
||||||
|
uppertrackstate = SCRBS_DISABLED;
|
||||||
|
lowertrackstate = SCRBS_DISABLED;
|
||||||
|
thumbstate = SCRBS_DISABLED;
|
||||||
|
} else {
|
||||||
|
uppertrackstate = SCRBS_NORMAL;
|
||||||
|
lowertrackstate = SCRBS_NORMAL;
|
||||||
|
thumbstate = SCRBS_NORMAL;
|
||||||
|
|
||||||
|
if (tracking_win == hwnd) {
|
||||||
|
if (tracking_hot_part == SCROLL_TOP_RECT)
|
||||||
|
uppertrackstate = SCRBS_HOT;
|
||||||
|
else if (tracking_hot_part == SCROLL_BOTTOM_RECT)
|
||||||
|
lowertrackstate = SCRBS_HOT;
|
||||||
|
else if (tracking_hot_part == SCROLL_THUMB)
|
||||||
|
thumbstate = SCRBS_HOT;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (vertical) {
|
||||||
|
SIZE upsize, downsize;
|
||||||
|
int uparrowstate, downarrowstate;
|
||||||
|
|
||||||
|
if (disabled) {
|
||||||
|
uparrowstate = ABS_UPDISABLED;
|
||||||
|
downarrowstate = ABS_DOWNDISABLED;
|
||||||
|
} else {
|
||||||
|
uparrowstate = ABS_UPNORMAL;
|
||||||
|
downarrowstate = ABS_DOWNNORMAL;
|
||||||
|
|
||||||
|
if (tracking_win == hwnd) {
|
||||||
|
if (tracking_hot_part == SCROLL_TOP_ARROW)
|
||||||
|
uparrowstate = ABS_UPHOT;
|
||||||
|
else if (tracking_hot_part == SCROLL_BOTTOM_ARROW)
|
||||||
|
downarrowstate = ABS_DOWNHOT;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (FAILED(GetThemePartSize(theme, dc, SBP_ARROWBTN, uparrowstate, NULL, TS_DRAW, &upsize))) {
|
||||||
|
WARN("Could not get up arrow size.\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (FAILED(GetThemePartSize(theme, dc, SBP_ARROWBTN, downarrowstate, NULL, TS_DRAW, &downsize))) {
|
||||||
|
WARN("Could not get down arrow size.\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (r.bottom - r.top - upsize.cy - downsize.cy < SCROLL_MIN_RECT)
|
||||||
|
upsize.cy = downsize.cy = (r.bottom - r.top - SCROLL_MIN_RECT)/2;
|
||||||
|
|
||||||
|
partrect = r;
|
||||||
|
partrect.bottom = partrect.top + upsize.cy;
|
||||||
|
DrawThemeBackground(theme, dc, SBP_ARROWBTN, uparrowstate, &partrect, NULL);
|
||||||
|
|
||||||
|
trackrect.top = partrect.bottom;
|
||||||
|
|
||||||
|
partrect.bottom = r.bottom;
|
||||||
|
partrect.top = partrect.bottom - downsize.cy;
|
||||||
|
DrawThemeBackground(theme, dc, SBP_ARROWBTN, downarrowstate, &partrect, NULL);
|
||||||
|
|
||||||
|
trackrect.bottom = partrect.top;
|
||||||
|
|
||||||
|
calc_thumb_dimensions(trackrect.bottom - trackrect.top, &si, &thumbpos, &thumbsize);
|
||||||
|
|
||||||
|
if (thumbpos > 0) {
|
||||||
|
partrect.top = trackrect.top;
|
||||||
|
partrect.bottom = partrect.top + thumbpos;
|
||||||
|
|
||||||
|
DrawThemeBackground(theme, dc, SBP_UPPERTRACKVERT, uppertrackstate, &partrect, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (thumbsize > 0) {
|
||||||
|
partrect.top = trackrect.top + thumbpos;
|
||||||
|
partrect.bottom = partrect.top + thumbsize;
|
||||||
|
|
||||||
|
DrawThemeBackground(theme, dc, SBP_THUMBBTNVERT, thumbstate, &partrect, NULL);
|
||||||
|
|
||||||
|
if (SUCCEEDED(GetThemePartSize(theme, dc, SBP_GRIPPERVERT, thumbstate, NULL, TS_DRAW, &grippersize))) {
|
||||||
|
MARGINS margins;
|
||||||
|
|
||||||
|
if (SUCCEEDED(GetThemeMargins(theme, dc, SBP_THUMBBTNVERT, thumbstate, TMT_CONTENTMARGINS, &partrect, &margins))) {
|
||||||
|
if (grippersize.cy <= (thumbsize - margins.cyTopHeight - margins.cyBottomHeight))
|
||||||
|
DrawThemeBackground(theme, dc, SBP_GRIPPERVERT, thumbstate, &partrect, NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (thumbpos + thumbsize < trackrect.bottom - trackrect.top) {
|
||||||
|
partrect.bottom = trackrect.bottom;
|
||||||
|
partrect.top = trackrect.top + thumbsize + thumbpos;
|
||||||
|
|
||||||
|
DrawThemeBackground(theme, dc, SBP_LOWERTRACKVERT, lowertrackstate, &partrect, NULL);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
SIZE leftsize, rightsize;
|
||||||
|
int leftarrowstate, rightarrowstate;
|
||||||
|
|
||||||
|
if (disabled) {
|
||||||
|
leftarrowstate = ABS_LEFTDISABLED;
|
||||||
|
rightarrowstate = ABS_RIGHTDISABLED;
|
||||||
|
} else {
|
||||||
|
leftarrowstate = ABS_LEFTNORMAL;
|
||||||
|
rightarrowstate = ABS_RIGHTNORMAL;
|
||||||
|
|
||||||
|
if (tracking_win == hwnd) {
|
||||||
|
if (tracking_hot_part == SCROLL_TOP_ARROW)
|
||||||
|
leftarrowstate = ABS_LEFTHOT;
|
||||||
|
else if (tracking_hot_part == SCROLL_BOTTOM_ARROW)
|
||||||
|
rightarrowstate = ABS_RIGHTHOT;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (FAILED(GetThemePartSize(theme, dc, SBP_ARROWBTN, leftarrowstate, NULL, TS_DRAW, &leftsize))) {
|
||||||
|
WARN("Could not get left arrow size.\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (FAILED(GetThemePartSize(theme, dc, SBP_ARROWBTN, rightarrowstate, NULL, TS_DRAW, &rightsize))) {
|
||||||
|
WARN("Could not get right arrow size.\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (r.right - r.left - leftsize.cx - rightsize.cx < SCROLL_MIN_RECT)
|
||||||
|
leftsize.cx = rightsize.cx = (r.right - r.left - SCROLL_MIN_RECT)/2;
|
||||||
|
|
||||||
|
partrect = r;
|
||||||
|
partrect.right = partrect.left + leftsize.cx;
|
||||||
|
DrawThemeBackground(theme, dc, SBP_ARROWBTN, leftarrowstate, &partrect, NULL);
|
||||||
|
|
||||||
|
trackrect.left = partrect.right;
|
||||||
|
|
||||||
|
partrect.right = r.right;
|
||||||
|
partrect.left = partrect.right - rightsize.cx;
|
||||||
|
DrawThemeBackground(theme, dc, SBP_ARROWBTN, rightarrowstate, &partrect, NULL);
|
||||||
|
|
||||||
|
trackrect.right = partrect.left;
|
||||||
|
|
||||||
|
calc_thumb_dimensions(trackrect.right - trackrect.left, &si, &thumbpos, &thumbsize);
|
||||||
|
|
||||||
|
if (thumbpos > 0) {
|
||||||
|
partrect.left = trackrect.left;
|
||||||
|
partrect.right = partrect.left + thumbpos;
|
||||||
|
|
||||||
|
DrawThemeBackground(theme, dc, SBP_UPPERTRACKHORZ, uppertrackstate, &partrect, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (thumbsize > 0) {
|
||||||
|
partrect.left = trackrect.left + thumbpos;
|
||||||
|
partrect.right = partrect.left + thumbsize;
|
||||||
|
|
||||||
|
DrawThemeBackground(theme, dc, SBP_THUMBBTNHORZ, thumbstate, &partrect, NULL);
|
||||||
|
|
||||||
|
if (SUCCEEDED(GetThemePartSize(theme, dc, SBP_GRIPPERHORZ, thumbstate, NULL, TS_DRAW, &grippersize))) {
|
||||||
|
MARGINS margins;
|
||||||
|
|
||||||
|
if (SUCCEEDED(GetThemeMargins(theme, dc, SBP_THUMBBTNHORZ, thumbstate, TMT_CONTENTMARGINS, &partrect, &margins))) {
|
||||||
|
if (grippersize.cx <= (thumbsize - margins.cxLeftWidth - margins.cxRightWidth))
|
||||||
|
DrawThemeBackground(theme, dc, SBP_GRIPPERHORZ, thumbstate, &partrect, NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (thumbpos + thumbsize < trackrect.right - trackrect.left) {
|
||||||
|
partrect.right = trackrect.right;
|
||||||
|
partrect.left = trackrect.left + thumbsize + thumbpos;
|
||||||
|
|
||||||
|
DrawThemeBackground(theme, dc, SBP_LOWERTRACKHORZ, lowertrackstate, &partrect, NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
EndPaint(hwnd, &ps);
|
||||||
|
}
|
||||||
|
|
||||||
LRESULT CALLBACK THEMING_ScrollbarSubclassProc (HWND hwnd, UINT msg,
|
LRESULT CALLBACK THEMING_ScrollbarSubclassProc (HWND hwnd, UINT msg,
|
||||||
WPARAM wParam, LPARAM lParam,
|
WPARAM wParam, LPARAM lParam,
|
||||||
ULONG_PTR dwRefData)
|
ULONG_PTR dwRefData)
|
||||||
{
|
{
|
||||||
|
const WCHAR* themeClass = WC_SCROLLBARW;
|
||||||
|
HTHEME theme;
|
||||||
|
LRESULT result;
|
||||||
|
POINT pt;
|
||||||
|
|
||||||
TRACE("(%p, 0x%x, %lu, %lu, %lu)\n", hwnd, msg, wParam, lParam, dwRefData);
|
TRACE("(%p, 0x%x, %lu, %lu, %lu)\n", hwnd, msg, wParam, lParam, dwRefData);
|
||||||
|
|
||||||
return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
|
switch (msg) {
|
||||||
|
case WM_CREATE:
|
||||||
|
result = THEMING_CallOriginalClass(hwnd, msg, wParam, lParam);
|
||||||
|
OpenThemeData(hwnd, themeClass);
|
||||||
|
return result;
|
||||||
|
|
||||||
|
case WM_DESTROY:
|
||||||
|
theme = GetWindowTheme(hwnd);
|
||||||
|
CloseThemeData(theme);
|
||||||
|
return THEMING_CallOriginalClass(hwnd, msg, wParam, lParam);
|
||||||
|
|
||||||
|
case WM_THEMECHANGED:
|
||||||
|
theme = GetWindowTheme(hwnd);
|
||||||
|
CloseThemeData(theme);
|
||||||
|
OpenThemeData(hwnd, themeClass);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case WM_SYSCOLORCHANGE:
|
||||||
|
theme = GetWindowTheme(hwnd);
|
||||||
|
if (!theme) return THEMING_CallOriginalClass(hwnd, msg, wParam, lParam);
|
||||||
|
/* Do nothing. When themed, a WM_THEMECHANGED will be received, too,
|
||||||
|
* which will do the repaint. */
|
||||||
|
break;
|
||||||
|
|
||||||
|
case WM_PAINT:
|
||||||
|
theme = GetWindowTheme(hwnd);
|
||||||
|
if (!theme) return THEMING_CallOriginalClass(hwnd, msg, wParam, lParam);
|
||||||
|
|
||||||
|
paint_scrollbar(hwnd, theme);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case WM_MOUSEMOVE:
|
||||||
|
case WM_MOUSELEAVE:
|
||||||
|
theme = GetWindowTheme(hwnd);
|
||||||
|
if (!theme) return THEMING_CallOriginalClass(hwnd, msg, wParam, lParam);
|
||||||
|
|
||||||
|
pt.x = (short)LOWORD(lParam);
|
||||||
|
pt.y = (short)HIWORD(lParam);
|
||||||
|
scroll_event(hwnd, theme, msg, pt);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return THEMING_CallOriginalClass(hwnd, msg, wParam, lParam);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -98,6 +98,7 @@ static HICON hTooltipIcons[TTI_ERROR+1];
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
UINT uFlags;
|
UINT uFlags;
|
||||||
|
UINT uInternalFlags;
|
||||||
HWND hwnd;
|
HWND hwnd;
|
||||||
BOOL bNotifyUnicode;
|
BOOL bNotifyUnicode;
|
||||||
UINT_PTR uId;
|
UINT_PTR uId;
|
||||||
|
@ -471,13 +472,12 @@ TOOLTIPS_GetTipText (const TOOLTIPS_INFO *infoPtr, INT nTool, WCHAR *buffer)
|
||||||
{
|
{
|
||||||
TTTOOL_INFO *toolPtr = &infoPtr->tools[nTool];
|
TTTOOL_INFO *toolPtr = &infoPtr->tools[nTool];
|
||||||
|
|
||||||
/* always NULL-terminate the buffer, just in case we fail to load the string */
|
|
||||||
buffer[0] = '\0';
|
|
||||||
if (IS_INTRESOURCE(toolPtr->lpszText)) {
|
if (IS_INTRESOURCE(toolPtr->lpszText)) {
|
||||||
HINSTANCE hinst = toolPtr->hinst ? toolPtr->hinst : GetModuleHandleW(NULL);
|
/* load a resource */
|
||||||
/* load a resource */
|
TRACE("load res string %p %x\n",
|
||||||
TRACE("load res string %p %x\n", hinst, LOWORD(toolPtr->lpszText));
|
toolPtr->hinst, LOWORD(toolPtr->lpszText));
|
||||||
LoadStringW (hinst, LOWORD(toolPtr->lpszText), buffer, INFOTIPSIZE);
|
if (!LoadStringW (toolPtr->hinst, LOWORD(toolPtr->lpszText), buffer, INFOTIPSIZE))
|
||||||
|
buffer[0] = '\0';
|
||||||
}
|
}
|
||||||
else if (toolPtr->lpszText) {
|
else if (toolPtr->lpszText) {
|
||||||
if (toolPtr->lpszText == LPSTR_TEXTCALLBACKW) {
|
if (toolPtr->lpszText == LPSTR_TEXTCALLBACKW) {
|
||||||
|
@ -493,6 +493,7 @@ TOOLTIPS_GetTipText (const TOOLTIPS_INFO *infoPtr, INT nTool, WCHAR *buffer)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* no text available */
|
/* no text available */
|
||||||
|
buffer[0] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
TRACE("%s\n", debugstr_w(buffer));
|
TRACE("%s\n", debugstr_w(buffer));
|
||||||
|
@ -1044,11 +1045,12 @@ TOOLTIPS_AddToolT (TOOLTIPS_INFO *infoPtr, const TTTOOLINFOW *ti, BOOL isW)
|
||||||
infoPtr->uNumTools++;
|
infoPtr->uNumTools++;
|
||||||
|
|
||||||
/* copy tool data */
|
/* copy tool data */
|
||||||
toolPtr->uFlags = ti->uFlags;
|
toolPtr->uFlags = ti->uFlags;
|
||||||
toolPtr->hwnd = ti->hwnd;
|
toolPtr->uInternalFlags = (ti->uFlags & (TTF_SUBCLASS | TTF_IDISHWND));
|
||||||
toolPtr->uId = ti->uId;
|
toolPtr->hwnd = ti->hwnd;
|
||||||
toolPtr->rect = ti->rect;
|
toolPtr->uId = ti->uId;
|
||||||
toolPtr->hinst = ti->hinst;
|
toolPtr->rect = ti->rect;
|
||||||
|
toolPtr->hinst = ti->hinst;
|
||||||
|
|
||||||
if (ti->cbSize >= TTTOOLINFOW_V1_SIZE) {
|
if (ti->cbSize >= TTTOOLINFOW_V1_SIZE) {
|
||||||
if (IS_INTRESOURCE(ti->lpszText)) {
|
if (IS_INTRESOURCE(ti->lpszText)) {
|
||||||
|
@ -1079,8 +1081,8 @@ TOOLTIPS_AddToolT (TOOLTIPS_INFO *infoPtr, const TTTOOLINFOW *ti, BOOL isW)
|
||||||
toolPtr->lParam = ti->lParam;
|
toolPtr->lParam = ti->lParam;
|
||||||
|
|
||||||
/* install subclassing hook */
|
/* install subclassing hook */
|
||||||
if (toolPtr->uFlags & TTF_SUBCLASS) {
|
if (toolPtr->uInternalFlags & TTF_SUBCLASS) {
|
||||||
if (toolPtr->uFlags & TTF_IDISHWND) {
|
if (toolPtr->uInternalFlags & TTF_IDISHWND) {
|
||||||
SetWindowSubclass((HWND)toolPtr->uId, TOOLTIPS_SubclassProc, 1,
|
SetWindowSubclass((HWND)toolPtr->uId, TOOLTIPS_SubclassProc, 1,
|
||||||
(DWORD_PTR)infoPtr->hwndSelf);
|
(DWORD_PTR)infoPtr->hwndSelf);
|
||||||
}
|
}
|
||||||
|
@ -1139,8 +1141,8 @@ TOOLTIPS_DelToolT (TOOLTIPS_INFO *infoPtr, const TTTOOLINFOW *ti, BOOL isW)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* remove subclassing */
|
/* remove subclassing */
|
||||||
if (toolPtr->uFlags & TTF_SUBCLASS) {
|
if (toolPtr->uInternalFlags & TTF_SUBCLASS) {
|
||||||
if (toolPtr->uFlags & TTF_IDISHWND) {
|
if (toolPtr->uInternalFlags & TTF_IDISHWND) {
|
||||||
RemoveWindowSubclass((HWND)toolPtr->uId, TOOLTIPS_SubclassProc, 1);
|
RemoveWindowSubclass((HWND)toolPtr->uId, TOOLTIPS_SubclassProc, 1);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -1905,8 +1907,8 @@ TOOLTIPS_Destroy (TOOLTIPS_INFO *infoPtr)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* remove subclassing */
|
/* remove subclassing */
|
||||||
if (toolPtr->uFlags & TTF_SUBCLASS) {
|
if (toolPtr->uInternalFlags & TTF_SUBCLASS) {
|
||||||
if (toolPtr->uFlags & TTF_IDISHWND) {
|
if (toolPtr->uInternalFlags & TTF_IDISHWND) {
|
||||||
RemoveWindowSubclass((HWND)toolPtr->uId, TOOLTIPS_SubclassProc, 1);
|
RemoveWindowSubclass((HWND)toolPtr->uId, TOOLTIPS_SubclassProc, 1);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -1994,6 +1996,7 @@ TOOLTIPS_NCHitTest (const TOOLTIPS_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
|
||||||
static LRESULT
|
static LRESULT
|
||||||
TOOLTIPS_NotifyFormat (TOOLTIPS_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
|
TOOLTIPS_NotifyFormat (TOOLTIPS_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
|
#ifdef __REACTOS__
|
||||||
TTTOOL_INFO *toolPtr = infoPtr->tools;
|
TTTOOL_INFO *toolPtr = infoPtr->tools;
|
||||||
LRESULT nResult;
|
LRESULT nResult;
|
||||||
|
|
||||||
|
@ -2020,6 +2023,9 @@ TOOLTIPS_NotifyFormat (TOOLTIPS_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
|
||||||
}
|
}
|
||||||
return nResult;
|
return nResult;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
FIXME ("hwnd=%p wParam=%lx lParam=%lx\n", infoPtr->hwndSelf, wParam, lParam);
|
||||||
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
*
|
*
|
||||||
* TODO:
|
* TODO:
|
||||||
* missing notifications: TVN_GETINFOTIP, TVN_KEYDOWN,
|
* missing notifications: TVN_GETINFOTIP, TVN_KEYDOWN,
|
||||||
* TVN_SETDISPINFO, TVN_SINGLEEXPAND
|
* TVN_SETDISPINFO
|
||||||
*
|
*
|
||||||
* missing styles: TVS_FULLROWSELECT, TVS_INFOTIP, TVS_RTLREADING,
|
* missing styles: TVS_FULLROWSELECT, TVS_INFOTIP, TVS_RTLREADING,
|
||||||
*
|
*
|
||||||
|
@ -2869,11 +2869,13 @@ TREEVIEW_Refresh(TREEVIEW_INFO *infoPtr, HDC hdc, const RECT *rc)
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// This is correct, but is causes and infinite loop of WM_PAINT messages, resulting
|
// FIXME: This is correct, but is causes and infinite loop of WM_PAINT
|
||||||
// in continuous painting of the scroll bar in reactos. Comment out until the real
|
// messages, resulting in continuous painting of the scroll bar in reactos.
|
||||||
// bug is found
|
// Comment out until the real bug is found
|
||||||
//
|
//
|
||||||
//TREEVIEW_UpdateScrollBars(infoPtr);
|
#ifndef __REACTOS__
|
||||||
|
TREEVIEW_UpdateScrollBars(infoPtr);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (infoPtr->cdmode & CDRF_NOTIFYPOSTPAINT)
|
if (infoPtr->cdmode & CDRF_NOTIFYPOSTPAINT)
|
||||||
infoPtr->cdmode =
|
infoPtr->cdmode =
|
||||||
|
@ -3491,47 +3493,31 @@ TREEVIEW_Expand(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *item,
|
||||||
static void TREEVIEW_SingleExpand(TREEVIEW_INFO *infoPtr,
|
static void TREEVIEW_SingleExpand(TREEVIEW_INFO *infoPtr,
|
||||||
HTREEITEM selection, HTREEITEM item)
|
HTREEITEM selection, HTREEITEM item)
|
||||||
{
|
{
|
||||||
TREEVIEW_ITEM *SelItem;
|
TREEVIEW_ITEM *prev, *curr;
|
||||||
|
|
||||||
if ((infoPtr->dwStyle & TVS_SINGLEEXPAND) == 0 || infoPtr->hwndEdit || !item) return;
|
if ((infoPtr->dwStyle & TVS_SINGLEEXPAND) == 0 || infoPtr->hwndEdit || !item) return;
|
||||||
|
|
||||||
TREEVIEW_SendTreeviewNotify(infoPtr, TVN_SINGLEEXPAND, TVC_UNKNOWN, TVIF_HANDLE | TVIF_PARAM, item, 0);
|
TREEVIEW_SendTreeviewNotify(infoPtr, TVN_SINGLEEXPAND, TVC_UNKNOWN, TVIF_HANDLE | TVIF_PARAM, item, 0);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Close the previous selection all the way to the root
|
* Close the previous item and its ancestors as long as they are not
|
||||||
* as long as the new selection is not a child
|
* ancestors of the current item
|
||||||
*/
|
*/
|
||||||
if(selection && (selection != item))
|
for (prev = selection; prev && TREEVIEW_ValidItem(infoPtr, prev); prev = prev->parent)
|
||||||
{
|
{
|
||||||
BOOL closeit = TRUE;
|
for (curr = item; curr && TREEVIEW_ValidItem(infoPtr, curr); curr = curr->parent)
|
||||||
SelItem = item;
|
|
||||||
|
|
||||||
/* determine if the hitItem is a child of the currently selected item */
|
|
||||||
while(closeit && SelItem && TREEVIEW_ValidItem(infoPtr, SelItem) &&
|
|
||||||
(SelItem->parent != infoPtr->root))
|
|
||||||
{
|
{
|
||||||
closeit = (SelItem != selection);
|
if (curr == prev)
|
||||||
SelItem = SelItem->parent;
|
goto finish;
|
||||||
}
|
|
||||||
|
|
||||||
if(closeit)
|
|
||||||
{
|
|
||||||
if(TREEVIEW_ValidItem(infoPtr, selection))
|
|
||||||
SelItem = selection;
|
|
||||||
|
|
||||||
while(SelItem && (SelItem != item) && TREEVIEW_ValidItem(infoPtr, SelItem) &&
|
|
||||||
SelItem->parent != infoPtr->root)
|
|
||||||
{
|
|
||||||
TREEVIEW_Collapse(infoPtr, SelItem, FALSE, FALSE);
|
|
||||||
SelItem = SelItem->parent;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
TREEVIEW_Collapse(infoPtr, prev, FALSE, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
finish:
|
||||||
/*
|
/*
|
||||||
* Expand the current item
|
* Expand the current item
|
||||||
*/
|
*/
|
||||||
TREEVIEW_Expand(infoPtr, item, FALSE, FALSE);
|
TREEVIEW_Expand(infoPtr, item, FALSE, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static BOOL
|
static BOOL
|
||||||
|
@ -4474,6 +4460,9 @@ TREEVIEW_SelectItem(TREEVIEW_INFO *infoPtr, INT wParam, HTREEITEM item)
|
||||||
if (item && !TREEVIEW_ValidItem(infoPtr, item))
|
if (item && !TREEVIEW_ValidItem(infoPtr, item))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
if (item == infoPtr->selectedItem)
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
TRACE("%p (%s) %d\n", item, TREEVIEW_ItemName(item), wParam);
|
TRACE("%p (%s) %d\n", item, TREEVIEW_ItemName(item), wParam);
|
||||||
|
|
||||||
if (!TREEVIEW_DoSelectItem(infoPtr, wParam, item, TVC_UNKNOWN))
|
if (!TREEVIEW_DoSelectItem(infoPtr, wParam, item, TVC_UNKNOWN))
|
||||||
|
@ -4659,7 +4648,7 @@ TREEVIEW_EnsureVisible(TREEVIEW_INFO *infoPtr, HTREEITEM item, BOOL bHScroll)
|
||||||
while (parent != infoPtr->root)
|
while (parent != infoPtr->root)
|
||||||
{
|
{
|
||||||
if (!(parent->state & TVIS_EXPANDED))
|
if (!(parent->state & TVIS_EXPANDED))
|
||||||
TREEVIEW_Expand(infoPtr, parent, FALSE, FALSE);
|
TREEVIEW_Expand(infoPtr, parent, FALSE, TRUE);
|
||||||
|
|
||||||
parent = parent->parent;
|
parent = parent->parent;
|
||||||
}
|
}
|
||||||
|
|
|
@ -351,12 +351,18 @@ static BOOL UPDOWN_SetBuddyInt (const UPDOWN_INFO *infoPtr)
|
||||||
*/
|
*/
|
||||||
static BOOL UPDOWN_DrawBuddyBackground (const UPDOWN_INFO *infoPtr, HDC hdc)
|
static BOOL UPDOWN_DrawBuddyBackground (const UPDOWN_INFO *infoPtr, HDC hdc)
|
||||||
{
|
{
|
||||||
RECT br;
|
RECT br, r;
|
||||||
HTHEME buddyTheme = GetWindowTheme (infoPtr->Buddy);
|
HTHEME buddyTheme = GetWindowTheme (infoPtr->Buddy);
|
||||||
if (!buddyTheme) return FALSE;
|
if (!buddyTheme) return FALSE;
|
||||||
|
|
||||||
GetClientRect (infoPtr->Buddy, &br);
|
GetWindowRect (infoPtr->Buddy, &br);
|
||||||
MapWindowPoints (infoPtr->Buddy, infoPtr->Self, (POINT*)&br, 2);
|
MapWindowPoints (NULL, infoPtr->Self, (POINT*)&br, 2);
|
||||||
|
GetClientRect (infoPtr->Self, &r);
|
||||||
|
|
||||||
|
if (infoPtr->dwStyle & UDS_ALIGNLEFT)
|
||||||
|
br.left = r.left;
|
||||||
|
else if (infoPtr->dwStyle & UDS_ALIGNRIGHT)
|
||||||
|
br.right = r.right;
|
||||||
/* FIXME: take disabled etc. into account */
|
/* FIXME: take disabled etc. into account */
|
||||||
DrawThemeBackground (buddyTheme, hdc, 0, 0, &br, NULL);
|
DrawThemeBackground (buddyTheme, hdc, 0, 0, &br, NULL);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
|
@ -55,7 +55,7 @@ reactos/dll/win32/browseui # Out of sync
|
||||||
reactos/dll/win32/cabinet # Synced to WineStaging-1.7.37
|
reactos/dll/win32/cabinet # Synced to WineStaging-1.7.37
|
||||||
reactos/dll/win32/clusapi # Synced to WineStaging-1.7.37
|
reactos/dll/win32/clusapi # Synced to WineStaging-1.7.37
|
||||||
reactos/dll/win32/comcat # Synced to WineStaging-1.7.37
|
reactos/dll/win32/comcat # Synced to WineStaging-1.7.37
|
||||||
reactos/dll/win32/comctl32 # Synced to WineStaging-1.7.37
|
reactos/dll/win32/comctl32 # Synced to WineStaging-1.7.47
|
||||||
reactos/dll/win32/comdlg32 # Synced to WineStaging-1.7.37
|
reactos/dll/win32/comdlg32 # Synced to WineStaging-1.7.37
|
||||||
reactos/dll/win32/compstui # Synced to WineStaging-1.7.37
|
reactos/dll/win32/compstui # Synced to WineStaging-1.7.37
|
||||||
reactos/dll/win32/credui # Synced to WineStaging-1.7.37
|
reactos/dll/win32/credui # Synced to WineStaging-1.7.37
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue