mirror of
https://github.com/reactos/reactos.git
synced 2025-07-27 20:22:05 +00:00
[COMCTL32] Sync with Wine 3.0. CORE-14225
This commit is contained in:
parent
65ab703cd5
commit
edd99e8ccc
11 changed files with 275 additions and 238 deletions
|
@ -77,6 +77,8 @@ typedef struct
|
||||||
|
|
||||||
extern COMCTL32_SysColor comctl32_color DECLSPEC_HIDDEN;
|
extern COMCTL32_SysColor comctl32_color DECLSPEC_HIDDEN;
|
||||||
|
|
||||||
|
#ifdef __REACTOS__
|
||||||
|
|
||||||
typedef struct _BUTTON_DATA {
|
typedef struct _BUTTON_DATA {
|
||||||
LONG state;
|
LONG state;
|
||||||
HFONT font;
|
HFONT font;
|
||||||
|
@ -92,6 +94,8 @@ static inline PBUTTON_DATA _GetButtonData(HWND hwnd)
|
||||||
return (PBUTTON_DATA)GetWindowLongPtrW( hwnd, 0 );
|
return (PBUTTON_DATA)GetWindowLongPtrW( hwnd, 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif /* __REACTOS__ */
|
||||||
|
|
||||||
/* Internal function */
|
/* Internal function */
|
||||||
HWND COMCTL32_CreateToolTip (HWND) DECLSPEC_HIDDEN;
|
HWND COMCTL32_CreateToolTip (HWND) DECLSPEC_HIDDEN;
|
||||||
VOID COMCTL32_RefreshSysColors(void) DECLSPEC_HIDDEN;
|
VOID COMCTL32_RefreshSysColors(void) DECLSPEC_HIDDEN;
|
||||||
|
@ -104,6 +108,10 @@ INT Str_GetPtrAtoW (LPCSTR lpSrc, LPWSTR lpDest, INT nMaxLen) DECLSPEC_HIDDEN;
|
||||||
BOOL Str_SetPtrAtoW (LPWSTR *lppDest, LPCSTR lpSrc) DECLSPEC_HIDDEN;
|
BOOL Str_SetPtrAtoW (LPWSTR *lppDest, LPCSTR lpSrc) DECLSPEC_HIDDEN;
|
||||||
BOOL Str_SetPtrWtoA (LPSTR *lppDest, LPCWSTR lpSrc) DECLSPEC_HIDDEN;
|
BOOL Str_SetPtrWtoA (LPSTR *lppDest, LPCWSTR lpSrc) DECLSPEC_HIDDEN;
|
||||||
|
|
||||||
|
#ifndef __REACTOS__
|
||||||
|
#define COMCTL32_VERSION_MINOR 81
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Our internal stack structure of the window procedures to subclass */
|
/* Our internal stack structure of the window procedures to subclass */
|
||||||
typedef struct _SUBCLASSPROCS {
|
typedef struct _SUBCLASSPROCS {
|
||||||
SUBCLASSPROC subproc;
|
SUBCLASSPROC subproc;
|
||||||
|
@ -175,18 +183,21 @@ extern void TREEVIEW_Register(void) DECLSPEC_HIDDEN;
|
||||||
extern void TREEVIEW_Unregister(void) DECLSPEC_HIDDEN;
|
extern void TREEVIEW_Unregister(void) DECLSPEC_HIDDEN;
|
||||||
extern void UPDOWN_Register(void) DECLSPEC_HIDDEN;
|
extern void UPDOWN_Register(void) DECLSPEC_HIDDEN;
|
||||||
extern void UPDOWN_Unregister(void) DECLSPEC_HIDDEN;
|
extern void UPDOWN_Unregister(void) DECLSPEC_HIDDEN;
|
||||||
|
#ifdef __REACTOS__
|
||||||
extern void BUTTON_Register();
|
extern void BUTTON_Register();
|
||||||
extern void BUTTON_Unregister();
|
extern void BUTTON_Unregister();
|
||||||
#ifdef __REACTOS__
|
|
||||||
extern void TOOLBARv6_Register(void) DECLSPEC_HIDDEN;
|
extern void TOOLBARv6_Register(void) DECLSPEC_HIDDEN;
|
||||||
extern void TOOLBARv6_Unregister(void) DECLSPEC_HIDDEN;
|
extern void TOOLBARv6_Unregister(void) DECLSPEC_HIDDEN;
|
||||||
#endif
|
#endif /* __REACTOS__ */
|
||||||
|
|
||||||
int MONTHCAL_MonthLength(int month, int year) DECLSPEC_HIDDEN;
|
int MONTHCAL_MonthLength(int month, int year) DECLSPEC_HIDDEN;
|
||||||
int MONTHCAL_CalculateDayOfWeek(SYSTEMTIME *date, BOOL inplace) DECLSPEC_HIDDEN;
|
int MONTHCAL_CalculateDayOfWeek(SYSTEMTIME *date, BOOL inplace) DECLSPEC_HIDDEN;
|
||||||
LONG MONTHCAL_CompareSystemTime(const SYSTEMTIME *first, const SYSTEMTIME *second) DECLSPEC_HIDDEN;
|
LONG MONTHCAL_CompareSystemTime(const SYSTEMTIME *first, const SYSTEMTIME *second) DECLSPEC_HIDDEN;
|
||||||
|
#ifdef __REACTOS__
|
||||||
extern void THEMING_Initialize(HANDLE hActCtx5, HANDLE hActCtx6) DECLSPEC_HIDDEN;
|
extern void THEMING_Initialize(HANDLE hActCtx5, HANDLE hActCtx6) DECLSPEC_HIDDEN;
|
||||||
|
#else
|
||||||
|
extern void THEMING_Initialize(void) DECLSPEC_HIDDEN;
|
||||||
|
#endif
|
||||||
extern void THEMING_Uninitialize(void) DECLSPEC_HIDDEN;
|
extern void THEMING_Uninitialize(void) DECLSPEC_HIDDEN;
|
||||||
extern LRESULT THEMING_CallOriginalClass(HWND, UINT, WPARAM, LPARAM) DECLSPEC_HIDDEN;
|
extern LRESULT THEMING_CallOriginalClass(HWND, UINT, WPARAM, LPARAM) DECLSPEC_HIDDEN;
|
||||||
extern void THEMING_SetSubclassData(HWND, ULONG_PTR) DECLSPEC_HIDDEN;
|
extern void THEMING_SetSubclassData(HWND, ULONG_PTR) DECLSPEC_HIDDEN;
|
||||||
|
|
|
@ -275,7 +275,7 @@ BOOLEAN WINAPI RegisterClassNameW(LPCWSTR className)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif /* __REACTOS__ */
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* DllMain [Internal]
|
* DllMain [Internal]
|
||||||
|
@ -1120,7 +1120,6 @@ HRESULT WINAPI DllGetVersion (DLLVERSIONINFO *pdvi)
|
||||||
HRESULT WINAPI DllInstall(BOOL bInstall, LPCWSTR cmdline)
|
HRESULT WINAPI DllInstall(BOOL bInstall, LPCWSTR cmdline)
|
||||||
{
|
{
|
||||||
TRACE("(%u, %s): stub\n", bInstall, debugstr_w(cmdline));
|
TRACE("(%u, %s): stub\n", bInstall, debugstr_w(cmdline));
|
||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -283,7 +283,7 @@ static BOOL add_with_alpha( HIMAGELIST himl, HDC hdc, int pos, int count,
|
||||||
mask_info->bmiHeader = info->bmiHeader;
|
mask_info->bmiHeader = info->bmiHeader;
|
||||||
mask_info->bmiHeader.biBitCount = 1;
|
mask_info->bmiHeader.biBitCount = 1;
|
||||||
mask_info->bmiHeader.biSizeImage = mask_width * height;
|
mask_info->bmiHeader.biSizeImage = mask_width * height;
|
||||||
if (!(mask_bits = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, info->bmiHeader.biSizeImage )))
|
if (!(mask_bits = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, mask_info->bmiHeader.biSizeImage )))
|
||||||
goto done;
|
goto done;
|
||||||
if (!GetDIBits( hdc, hbmMask, 0, height, mask_bits, mask_info, DIB_RGB_COLORS )) goto done;
|
if (!GetDIBits( hdc, hbmMask, 0, height, mask_bits, mask_info, DIB_RGB_COLORS )) goto done;
|
||||||
}
|
}
|
||||||
|
@ -2132,7 +2132,8 @@ ImageList_LoadImageW (HINSTANCE hi, LPCWSTR lpbmp, INT cx, INT cGrow,
|
||||||
|
|
||||||
nImageCount = dib.dsBm.bmWidth / cx;
|
nImageCount = dib.dsBm.bmWidth / cx;
|
||||||
|
|
||||||
himl = ImageList_Create (cx, dib.dsBm.bmHeight, ILC_MASK | color, nImageCount, cGrow);
|
if (clrMask != CLR_NONE) color |= ILC_MASK;
|
||||||
|
himl = ImageList_Create (cx, dib.dsBm.bmHeight, color, nImageCount, cGrow);
|
||||||
if (!himl) {
|
if (!himl) {
|
||||||
DeleteObject (handle);
|
DeleteObject (handle);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
@ -1001,7 +1001,7 @@ static BOOL notify_dispinfoT(const LISTVIEW_INFO *infoPtr, UINT code, LPNMLVDISP
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* if dipsinfo holder changed notification code then convert */
|
/* if dispinfo holder changed notification code then convert */
|
||||||
if (!isW && (pdi->hdr.code == LVN_GETDISPINFOW) && (pdi->item.mask & LVIF_TEXT))
|
if (!isW && (pdi->hdr.code == LVN_GETDISPINFOW) && (pdi->item.mask & LVIF_TEXT))
|
||||||
{
|
{
|
||||||
length = WideCharToMultiByte(CP_ACP, 0, pdi->item.pszText, -1, NULL, 0, NULL, NULL);
|
length = WideCharToMultiByte(CP_ACP, 0, pdi->item.pszText, -1, NULL, 0, NULL, NULL);
|
||||||
|
@ -1055,7 +1055,7 @@ static void prepaint_setup (const LISTVIEW_INFO *infoPtr, HDC hdc, NMLVCUSTOMDRA
|
||||||
COLORREF backcolor, textcolor;
|
COLORREF backcolor, textcolor;
|
||||||
|
|
||||||
/* apparently, for selected items, we have to override the returned values */
|
/* apparently, for selected items, we have to override the returned values */
|
||||||
if (!SubItem || (infoPtr->dwLvExStyle & LVS_EX_FULLROWSELECT))
|
if (!SubItem)
|
||||||
{
|
{
|
||||||
if (lpnmlvcd->nmcd.uItemState & CDIS_SELECTED)
|
if (lpnmlvcd->nmcd.uItemState & CDIS_SELECTED)
|
||||||
{
|
{
|
||||||
|
@ -3843,33 +3843,44 @@ static LRESULT LISTVIEW_MouseHover(LISTVIEW_INFO *infoPtr, INT x, INT y)
|
||||||
* None.
|
* None.
|
||||||
*/
|
*/
|
||||||
static void LISTVIEW_MarqueeHighlight(LISTVIEW_INFO *infoPtr, const POINT *coords_orig,
|
static void LISTVIEW_MarqueeHighlight(LISTVIEW_INFO *infoPtr, const POINT *coords_orig,
|
||||||
const POINT *coords_offs, const POINT *offset,
|
|
||||||
INT scroll)
|
INT scroll)
|
||||||
{
|
{
|
||||||
BOOL controlDown = FALSE;
|
BOOL controlDown = FALSE;
|
||||||
LVITEMW item;
|
LVITEMW item;
|
||||||
ITERATOR old_elems, new_elems;
|
ITERATOR old_elems, new_elems;
|
||||||
RECT rect;
|
RECT rect;
|
||||||
|
POINT coords_offs, offset;
|
||||||
|
|
||||||
if (coords_offs->x > infoPtr->marqueeOrigin.x)
|
/* Ensure coordinates are within client bounds */
|
||||||
|
coords_offs.x = max(min(coords_orig->x, infoPtr->rcList.right), 0);
|
||||||
|
coords_offs.y = max(min(coords_orig->y, infoPtr->rcList.bottom), 0);
|
||||||
|
|
||||||
|
/* Get offset */
|
||||||
|
LISTVIEW_GetOrigin(infoPtr, &offset);
|
||||||
|
|
||||||
|
/* Offset coordinates by the appropriate amount */
|
||||||
|
coords_offs.x -= offset.x;
|
||||||
|
coords_offs.y -= offset.y;
|
||||||
|
|
||||||
|
if (coords_offs.x > infoPtr->marqueeOrigin.x)
|
||||||
{
|
{
|
||||||
rect.left = infoPtr->marqueeOrigin.x;
|
rect.left = infoPtr->marqueeOrigin.x;
|
||||||
rect.right = coords_offs->x;
|
rect.right = coords_offs.x;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
rect.left = coords_offs->x;
|
rect.left = coords_offs.x;
|
||||||
rect.right = infoPtr->marqueeOrigin.x;
|
rect.right = infoPtr->marqueeOrigin.x;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (coords_offs->y > infoPtr->marqueeOrigin.y)
|
if (coords_offs.y > infoPtr->marqueeOrigin.y)
|
||||||
{
|
{
|
||||||
rect.top = infoPtr->marqueeOrigin.y;
|
rect.top = infoPtr->marqueeOrigin.y;
|
||||||
rect.bottom = coords_offs->y;
|
rect.bottom = coords_offs.y;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
rect.top = coords_offs->y;
|
rect.top = coords_offs.y;
|
||||||
rect.bottom = infoPtr->marqueeOrigin.y;
|
rect.bottom = infoPtr->marqueeOrigin.y;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3895,7 +3906,7 @@ static void LISTVIEW_MarqueeHighlight(LISTVIEW_INFO *infoPtr, const POINT *coord
|
||||||
|
|
||||||
infoPtr->marqueeRect = rect;
|
infoPtr->marqueeRect = rect;
|
||||||
infoPtr->marqueeDrawRect = rect;
|
infoPtr->marqueeDrawRect = rect;
|
||||||
OffsetRect(&infoPtr->marqueeDrawRect, offset->x, offset->y);
|
OffsetRect(&infoPtr->marqueeDrawRect, offset.x, offset.y);
|
||||||
|
|
||||||
iterator_frameditems_absolute(&new_elems, infoPtr, &infoPtr->marqueeRect);
|
iterator_frameditems_absolute(&new_elems, infoPtr, &infoPtr->marqueeRect);
|
||||||
iterator_remove_common_items(&old_elems, &new_elems);
|
iterator_remove_common_items(&old_elems, &new_elems);
|
||||||
|
@ -3960,9 +3971,7 @@ static VOID CALLBACK LISTVIEW_ScrollTimer(HWND hWnd, UINT uMsg, UINT_PTR idEvent
|
||||||
{
|
{
|
||||||
LISTVIEW_INFO *infoPtr;
|
LISTVIEW_INFO *infoPtr;
|
||||||
SCROLLINFO scrollInfo;
|
SCROLLINFO scrollInfo;
|
||||||
POINT coords_orig;
|
POINT coords;
|
||||||
POINT coords_offs;
|
|
||||||
POINT offset;
|
|
||||||
INT scroll = 0;
|
INT scroll = 0;
|
||||||
|
|
||||||
infoPtr = (LISTVIEW_INFO *) idEvent;
|
infoPtr = (LISTVIEW_INFO *) idEvent;
|
||||||
|
@ -3971,19 +3980,8 @@ static VOID CALLBACK LISTVIEW_ScrollTimer(HWND hWnd, UINT uMsg, UINT_PTR idEvent
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Get the current cursor position and convert to client coordinates */
|
/* Get the current cursor position and convert to client coordinates */
|
||||||
GetCursorPos(&coords_orig);
|
GetCursorPos(&coords);
|
||||||
ScreenToClient(hWnd, &coords_orig);
|
ScreenToClient(hWnd, &coords);
|
||||||
|
|
||||||
/* Ensure coordinates are within client bounds */
|
|
||||||
coords_offs.x = max(min(coords_orig.x, infoPtr->rcList.right), 0);
|
|
||||||
coords_offs.y = max(min(coords_orig.y, infoPtr->rcList.bottom), 0);
|
|
||||||
|
|
||||||
/* Get offset */
|
|
||||||
LISTVIEW_GetOrigin(infoPtr, &offset);
|
|
||||||
|
|
||||||
/* Offset coordinates by the appropriate amount */
|
|
||||||
coords_offs.x -= offset.x;
|
|
||||||
coords_offs.y -= offset.y;
|
|
||||||
|
|
||||||
scrollInfo.cbSize = sizeof(SCROLLINFO);
|
scrollInfo.cbSize = sizeof(SCROLLINFO);
|
||||||
scrollInfo.fMask = SIF_ALL;
|
scrollInfo.fMask = SIF_ALL;
|
||||||
|
@ -4007,12 +4005,12 @@ static VOID CALLBACK LISTVIEW_ScrollTimer(HWND hWnd, UINT uMsg, UINT_PTR idEvent
|
||||||
scroll |= SCROLL_RIGHT;
|
scroll |= SCROLL_RIGHT;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (((coords_orig.x <= 0) && (scroll & SCROLL_LEFT)) ||
|
if (((coords.x <= 0) && (scroll & SCROLL_LEFT)) ||
|
||||||
((coords_orig.y <= 0) && (scroll & SCROLL_UP)) ||
|
((coords.y <= 0) && (scroll & SCROLL_UP)) ||
|
||||||
((coords_orig.x >= infoPtr->rcList.right) && (scroll & SCROLL_RIGHT)) ||
|
((coords.x >= infoPtr->rcList.right) && (scroll & SCROLL_RIGHT)) ||
|
||||||
((coords_orig.y >= infoPtr->rcList.bottom) && (scroll & SCROLL_DOWN)))
|
((coords.y >= infoPtr->rcList.bottom) && (scroll & SCROLL_DOWN)))
|
||||||
{
|
{
|
||||||
LISTVIEW_MarqueeHighlight(infoPtr, &coords_orig, &coords_offs, &offset, scroll);
|
LISTVIEW_MarqueeHighlight(infoPtr, &coords, scroll);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4034,6 +4032,9 @@ static LRESULT LISTVIEW_MouseMove(LISTVIEW_INFO *infoPtr, WORD fwKeys, INT x, IN
|
||||||
RECT rect;
|
RECT rect;
|
||||||
POINT pt;
|
POINT pt;
|
||||||
|
|
||||||
|
pt.x = x;
|
||||||
|
pt.y = y;
|
||||||
|
|
||||||
if (!(fwKeys & MK_LBUTTON))
|
if (!(fwKeys & MK_LBUTTON))
|
||||||
infoPtr->bLButtonDown = FALSE;
|
infoPtr->bLButtonDown = FALSE;
|
||||||
|
|
||||||
|
@ -4046,24 +4047,6 @@ static LRESULT LISTVIEW_MouseMove(LISTVIEW_INFO *infoPtr, WORD fwKeys, INT x, IN
|
||||||
|
|
||||||
if (infoPtr->bMarqueeSelect)
|
if (infoPtr->bMarqueeSelect)
|
||||||
{
|
{
|
||||||
POINT coords_orig;
|
|
||||||
POINT coords_offs;
|
|
||||||
POINT offset;
|
|
||||||
|
|
||||||
coords_orig.x = x;
|
|
||||||
coords_orig.y = y;
|
|
||||||
|
|
||||||
/* Get offset */
|
|
||||||
LISTVIEW_GetOrigin(infoPtr, &offset);
|
|
||||||
|
|
||||||
/* Ensure coordinates are within client bounds */
|
|
||||||
coords_offs.x = max(min(x, infoPtr->rcList.right), 0);
|
|
||||||
coords_offs.y = max(min(y, infoPtr->rcList.bottom), 0);
|
|
||||||
|
|
||||||
/* Offset coordinates by the appropriate amount */
|
|
||||||
coords_offs.x -= offset.x;
|
|
||||||
coords_offs.y -= offset.y;
|
|
||||||
|
|
||||||
/* Enable the timer if we're going outside our bounds, in case the user doesn't
|
/* Enable the timer if we're going outside our bounds, in case the user doesn't
|
||||||
move the mouse again */
|
move the mouse again */
|
||||||
|
|
||||||
|
@ -4082,13 +4065,10 @@ static LRESULT LISTVIEW_MouseMove(LISTVIEW_INFO *infoPtr, WORD fwKeys, INT x, IN
|
||||||
KillTimer(infoPtr->hwndSelf, (UINT_PTR) infoPtr);
|
KillTimer(infoPtr->hwndSelf, (UINT_PTR) infoPtr);
|
||||||
}
|
}
|
||||||
|
|
||||||
LISTVIEW_MarqueeHighlight(infoPtr, &coords_orig, &coords_offs, &offset, 0);
|
LISTVIEW_MarqueeHighlight(infoPtr, &pt, 0);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
pt.x = x;
|
|
||||||
pt.y = y;
|
|
||||||
|
|
||||||
ht.pt = pt;
|
ht.pt = pt;
|
||||||
LISTVIEW_HitTest(infoPtr, &ht, TRUE, TRUE);
|
LISTVIEW_HitTest(infoPtr, &ht, TRUE, TRUE);
|
||||||
|
|
||||||
|
@ -4808,7 +4788,6 @@ static BOOL LISTVIEW_DrawItem(LISTVIEW_INFO *infoPtr, HDC hdc, INT nItem, ITERAT
|
||||||
while (iterator_next(subitems))
|
while (iterator_next(subitems))
|
||||||
{
|
{
|
||||||
DWORD subitemstage = CDRF_DODEFAULT;
|
DWORD subitemstage = CDRF_DODEFAULT;
|
||||||
NMLVCUSTOMDRAW temp_nmlvcd;
|
|
||||||
|
|
||||||
/* We need to query for each subitem, item's data (subitem == 0) is already here at this point */
|
/* We need to query for each subitem, item's data (subitem == 0) is already here at this point */
|
||||||
if (subitems->nItem)
|
if (subitems->nItem)
|
||||||
|
@ -4835,16 +4814,19 @@ static BOOL LISTVIEW_DrawItem(LISTVIEW_INFO *infoPtr, HDC hdc, INT nItem, ITERAT
|
||||||
|
|
||||||
if (cdsubitemmode & CDRF_NOTIFYSUBITEMDRAW)
|
if (cdsubitemmode & CDRF_NOTIFYSUBITEMDRAW)
|
||||||
subitemstage = notify_customdraw(infoPtr, CDDS_SUBITEM | CDDS_ITEMPREPAINT, &nmlvcd);
|
subitemstage = notify_customdraw(infoPtr, CDDS_SUBITEM | CDDS_ITEMPREPAINT, &nmlvcd);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
nmlvcd.clrTextBk = infoPtr->clrTextBk;
|
||||||
|
nmlvcd.clrText = infoPtr->clrText;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
if (subitems->nItem == 0 || (cdmode & CDRF_NOTIFYITEMDRAW))
|
||||||
* A selection should neither affect the colors in the post paint notification nor
|
prepaint_setup(infoPtr, hdc, &nmlvcd, FALSE);
|
||||||
* affect the colors of the next drawn subitem. Copy the structure to prevent this.
|
else if (!(infoPtr->dwLvExStyle & LVS_EX_FULLROWSELECT))
|
||||||
*/
|
prepaint_setup(infoPtr, hdc, &nmlvcd, TRUE);
|
||||||
temp_nmlvcd = nmlvcd;
|
|
||||||
prepaint_setup(infoPtr, hdc, &temp_nmlvcd, subitems->nItem);
|
|
||||||
|
|
||||||
if (!(subitemstage & CDRF_SKIPDEFAULT))
|
if (!(subitemstage & CDRF_SKIPDEFAULT))
|
||||||
LISTVIEW_DrawItemPart(infoPtr, &lvItem, &temp_nmlvcd, &pos);
|
LISTVIEW_DrawItemPart(infoPtr, &lvItem, &nmlvcd, &pos);
|
||||||
|
|
||||||
if (subitemstage & CDRF_NOTIFYPOSTPAINT)
|
if (subitemstage & CDRF_NOTIFYPOSTPAINT)
|
||||||
subitemstage = notify_customdraw(infoPtr, CDDS_SUBITEM | CDDS_ITEMPOSTPAINT, &nmlvcd);
|
subitemstage = notify_customdraw(infoPtr, CDDS_SUBITEM | CDDS_ITEMPOSTPAINT, &nmlvcd);
|
||||||
|
@ -8864,6 +8846,7 @@ static BOOL LISTVIEW_SetItemCount(LISTVIEW_INFO *infoPtr, INT nItems, DWORD dwFl
|
||||||
if (infoPtr->nFocusedItem >= nItems)
|
if (infoPtr->nFocusedItem >= nItems)
|
||||||
{
|
{
|
||||||
LISTVIEW_SetItemFocus(infoPtr, -1);
|
LISTVIEW_SetItemFocus(infoPtr, -1);
|
||||||
|
infoPtr->nFocusedItem = -1;
|
||||||
SetRectEmpty(&infoPtr->rcFocus);
|
SetRectEmpty(&infoPtr->rcFocus);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9483,7 +9466,7 @@ static VOID CALLBACK LISTVIEW_DelayedEditItem(HWND hwnd, UINT uMsg, UINT_PTR idE
|
||||||
* Success: TRUE
|
* Success: TRUE
|
||||||
* Failure: FALSE
|
* Failure: FALSE
|
||||||
*/
|
*/
|
||||||
static LRESULT LISTVIEW_NCCreate(HWND hwnd, const CREATESTRUCTW *lpcs)
|
static LRESULT LISTVIEW_NCCreate(HWND hwnd, WPARAM wParam, const CREATESTRUCTW *lpcs)
|
||||||
{
|
{
|
||||||
LISTVIEW_INFO *infoPtr;
|
LISTVIEW_INFO *infoPtr;
|
||||||
LOGFONTW logFont;
|
LOGFONTW logFont;
|
||||||
|
@ -9545,7 +9528,8 @@ static LRESULT LISTVIEW_NCCreate(HWND hwnd, const CREATESTRUCTW *lpcs)
|
||||||
if (!(infoPtr->hdpaPosX = DPA_Create(10))) goto fail;
|
if (!(infoPtr->hdpaPosX = DPA_Create(10))) goto fail;
|
||||||
if (!(infoPtr->hdpaPosY = DPA_Create(10))) goto fail;
|
if (!(infoPtr->hdpaPosY = DPA_Create(10))) goto fail;
|
||||||
if (!(infoPtr->hdpaColumns = DPA_Create(10))) goto fail;
|
if (!(infoPtr->hdpaColumns = DPA_Create(10))) goto fail;
|
||||||
return TRUE;
|
|
||||||
|
return DefWindowProcW(hwnd, WM_NCCREATE, wParam, (LPARAM)lpcs);
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
DestroyWindow(infoPtr->hwndHeader);
|
DestroyWindow(infoPtr->hwndHeader);
|
||||||
|
@ -11711,7 +11695,7 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
return LISTVIEW_Command(infoPtr, wParam, lParam);
|
return LISTVIEW_Command(infoPtr, wParam, lParam);
|
||||||
|
|
||||||
case WM_NCCREATE:
|
case WM_NCCREATE:
|
||||||
return LISTVIEW_NCCreate(hwnd, (LPCREATESTRUCTW)lParam);
|
return LISTVIEW_NCCreate(hwnd, wParam, (LPCREATESTRUCTW)lParam);
|
||||||
|
|
||||||
case WM_CREATE:
|
case WM_CREATE:
|
||||||
return LISTVIEW_Create(hwnd, (LPCREATESTRUCTW)lParam);
|
return LISTVIEW_Create(hwnd, (LPCREATESTRUCTW)lParam);
|
||||||
|
|
|
@ -613,6 +613,7 @@ REBAR_DrawBand (HDC hdc, const REBAR_INFO *infoPtr, REBAR_BAND *lpBand)
|
||||||
oldcolor = SetTextColor (hdc, new);
|
oldcolor = SetTextColor (hdc, new);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __REACTOS__
|
||||||
if (!theme)
|
if (!theme)
|
||||||
{
|
{
|
||||||
DrawTextW (hdc, lpBand->lpText, -1, &lpBand->rcCapText, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
|
DrawTextW (hdc, lpBand->lpText, -1, &lpBand->rcCapText, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
|
||||||
|
@ -621,6 +622,10 @@ REBAR_DrawBand (HDC hdc, const REBAR_INFO *infoPtr, REBAR_BAND *lpBand)
|
||||||
{
|
{
|
||||||
DrawThemeText(theme, hdc, 0, 0, lpBand->lpText, -1, DT_CENTER | DT_VCENTER | DT_SINGLELINE, 0, &lpBand->rcCapText);
|
DrawThemeText(theme, hdc, 0, 0, lpBand->lpText, -1, DT_CENTER | DT_VCENTER | DT_SINGLELINE, 0, &lpBand->rcCapText);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
DrawTextW (hdc, lpBand->lpText, -1, &lpBand->rcCapText,
|
||||||
|
DT_CENTER | DT_VCENTER | DT_SINGLELINE);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (oldBkMode != TRANSPARENT)
|
if (oldBkMode != TRANSPARENT)
|
||||||
SetBkMode (hdc, oldBkMode);
|
SetBkMode (hdc, oldBkMode);
|
||||||
|
@ -1843,7 +1848,6 @@ static LRESULT REBAR_EraseBkGnd (const REBAR_INFO *infoPtr, HDC hdc)
|
||||||
oldrow = -1;
|
oldrow = -1;
|
||||||
for(i=0; i<infoPtr->uNumBands; i++) {
|
for(i=0; i<infoPtr->uNumBands; i++) {
|
||||||
RECT rcBand;
|
RECT rcBand;
|
||||||
|
|
||||||
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);
|
||||||
|
|
|
@ -196,10 +196,14 @@ STATUSBAR_DrawPart (const STATUS_INFO *infoPtr, HDC hdc, const STATUSWINDOWPART
|
||||||
SendMessageW (infoPtr->Notify, WM_DRAWITEM, dis.CtlID, (LPARAM)&dis);
|
SendMessageW (infoPtr->Notify, WM_DRAWITEM, dis.CtlID, (LPARAM)&dis);
|
||||||
} else {
|
} else {
|
||||||
r.left += x;
|
r.left += x;
|
||||||
|
#ifdef __REACTOS__
|
||||||
if (!theme)
|
if (!theme)
|
||||||
DrawStatusTextW (hdc, &r, part->text, SBT_NOBORDERS);
|
DrawStatusTextW (hdc, &r, part->text, SBT_NOBORDERS);
|
||||||
else
|
else
|
||||||
DrawThemeText(theme, hdc, SP_PANE, 0, part->text, -1, DT_VCENTER|DT_SINGLELINE|DT_NOPREFIX, 0, &r);
|
DrawThemeText(theme, hdc, SP_PANE, 0, part->text, -1, DT_VCENTER|DT_SINGLELINE|DT_NOPREFIX, 0, &r);
|
||||||
|
#else
|
||||||
|
DrawStatusTextW (hdc, &r, part->text, SBT_NOBORDERS);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1463,7 +1463,7 @@ static BOOL SYSLINK_NoNextLink (const SYSLINK_INFO *infoPtr, BOOL Prev)
|
||||||
* SYSLINK_GetIdealSize
|
* SYSLINK_GetIdealSize
|
||||||
* Calculates the ideal size of a link control at a given maximum width.
|
* Calculates the ideal size of a link control at a given maximum width.
|
||||||
*/
|
*/
|
||||||
static VOID SYSLINK_GetIdealSize (const SYSLINK_INFO *infoPtr, int cxMaxWidth, LPSIZE lpSize)
|
static LONG SYSLINK_GetIdealSize (const SYSLINK_INFO *infoPtr, int cxMaxWidth, SIZE *lpSize)
|
||||||
{
|
{
|
||||||
RECT rc;
|
RECT rc;
|
||||||
HDC hdc;
|
HDC hdc;
|
||||||
|
@ -1484,6 +1484,8 @@ static VOID SYSLINK_GetIdealSize (const SYSLINK_INFO *infoPtr, int cxMaxWidth, L
|
||||||
lpSize->cx = rc.right;
|
lpSize->cx = rc.right;
|
||||||
lpSize->cy = rc.bottom;
|
lpSize->cy = rc.bottom;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return rc.bottom;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
@ -1655,10 +1657,8 @@ static LRESULT WINAPI SysLinkWindowProc(HWND hwnd, UINT message,
|
||||||
|
|
||||||
case LM_GETIDEALHEIGHT:
|
case LM_GETIDEALHEIGHT:
|
||||||
if (lParam)
|
if (lParam)
|
||||||
{
|
return SYSLINK_GetIdealSize(infoPtr, (int)wParam, (SIZE *)lParam);
|
||||||
/* LM_GETIDEALSIZE */
|
else
|
||||||
SYSLINK_GetIdealSize(infoPtr, (int)wParam, (LPSIZE)lParam);
|
|
||||||
}
|
|
||||||
return SYSLINK_GetIdealHeight(infoPtr);
|
return SYSLINK_GetIdealHeight(infoPtr);
|
||||||
|
|
||||||
case WM_SETFOCUS:
|
case WM_SETFOCUS:
|
||||||
|
|
|
@ -43,6 +43,15 @@ struct taskdialog_control
|
||||||
unsigned int template_size;
|
unsigned int template_size;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct taskdialog_button_desc
|
||||||
|
{
|
||||||
|
int id;
|
||||||
|
const WCHAR *text;
|
||||||
|
unsigned int width;
|
||||||
|
unsigned int line;
|
||||||
|
HINSTANCE hinst;
|
||||||
|
};
|
||||||
|
|
||||||
struct taskdialog_template_desc
|
struct taskdialog_template_desc
|
||||||
{
|
{
|
||||||
const TASKDIALOGCONFIG *taskconfig;
|
const TASKDIALOGCONFIG *taskconfig;
|
||||||
|
@ -53,15 +62,14 @@ struct taskdialog_template_desc
|
||||||
LONG x_baseunit;
|
LONG x_baseunit;
|
||||||
LONG y_baseunit;
|
LONG y_baseunit;
|
||||||
HFONT font;
|
HFONT font;
|
||||||
|
struct taskdialog_button_desc *default_button;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct taskdialog_button_desc
|
struct taskdialog_info
|
||||||
{
|
{
|
||||||
int id;
|
HWND hwnd;
|
||||||
const WCHAR *text;
|
PFTASKDIALOGCALLBACK callback;
|
||||||
unsigned int width;
|
LONG_PTR callback_data;
|
||||||
unsigned int line;
|
|
||||||
HINSTANCE hinst;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static void pixels_to_dialogunits(const struct taskdialog_template_desc *desc, LONG *width, LONG *height)
|
static void pixels_to_dialogunits(const struct taskdialog_template_desc *desc, LONG *width, LONG *height)
|
||||||
|
@ -128,7 +136,7 @@ static void taskdialog_get_text_extent(const struct taskdialog_template_desc *de
|
||||||
}
|
}
|
||||||
|
|
||||||
static unsigned int taskdialog_add_control(struct taskdialog_template_desc *desc, WORD id, const WCHAR *class,
|
static unsigned int taskdialog_add_control(struct taskdialog_template_desc *desc, WORD id, const WCHAR *class,
|
||||||
HINSTANCE hInstance, const WCHAR *text, short x, short y, short cx, short cy)
|
HINSTANCE hInstance, const WCHAR *text, DWORD style, short x, short y, short cx, short cy)
|
||||||
{
|
{
|
||||||
struct taskdialog_control *control = Alloc(sizeof(*control));
|
struct taskdialog_control *control = Alloc(sizeof(*control));
|
||||||
unsigned int size, class_size, text_size;
|
unsigned int size, class_size, text_size;
|
||||||
|
@ -155,7 +163,7 @@ static unsigned int taskdialog_add_control(struct taskdialog_template_desc *desc
|
||||||
control->template = template = Alloc(size);
|
control->template = template = Alloc(size);
|
||||||
control->template_size = size;
|
control->template_size = size;
|
||||||
|
|
||||||
template->style = WS_VISIBLE;
|
template->style = WS_VISIBLE | style;
|
||||||
template->dwExtendedStyle = 0;
|
template->dwExtendedStyle = 0;
|
||||||
template->x = x;
|
template->x = x;
|
||||||
template->y = y;
|
template->y = y;
|
||||||
|
@ -183,7 +191,7 @@ static unsigned int taskdialog_add_static_label(struct taskdialog_template_desc
|
||||||
taskdialog_get_text_extent(desc, str, TRUE, &sz);
|
taskdialog_get_text_extent(desc, str, TRUE, &sz);
|
||||||
|
|
||||||
desc->dialog_height += DIALOG_SPACING;
|
desc->dialog_height += DIALOG_SPACING;
|
||||||
size = taskdialog_add_control(desc, id, WC_STATICW, desc->taskconfig->hInstance, str, DIALOG_SPACING,
|
size = taskdialog_add_control(desc, id, WC_STATICW, desc->taskconfig->hInstance, str, 0, DIALOG_SPACING,
|
||||||
desc->dialog_height, sz.cx, sz.cy);
|
desc->dialog_height, sz.cx, sz.cy);
|
||||||
desc->dialog_height += sz.cy + DIALOG_SPACING;
|
desc->dialog_height += sz.cy + DIALOG_SPACING;
|
||||||
return size;
|
return size;
|
||||||
|
@ -211,6 +219,9 @@ static void taskdialog_init_button(struct taskdialog_button_desc *button, struct
|
||||||
button->width = max(DIALOG_BUTTON_WIDTH, sz.cx + DIALOG_SPACING * 2);
|
button->width = max(DIALOG_BUTTON_WIDTH, sz.cx + DIALOG_SPACING * 2);
|
||||||
button->line = 0;
|
button->line = 0;
|
||||||
button->hinst = custom_button ? desc->taskconfig->hInstance : COMCTL32_hModule;
|
button->hinst = custom_button ? desc->taskconfig->hInstance : COMCTL32_hModule;
|
||||||
|
|
||||||
|
if (id == desc->taskconfig->nDefaultButton)
|
||||||
|
desc->default_button = button;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void taskdialog_init_common_buttons(struct taskdialog_template_desc *desc, struct taskdialog_button_desc *buttons,
|
static void taskdialog_init_common_buttons(struct taskdialog_template_desc *desc, struct taskdialog_button_desc *buttons,
|
||||||
|
@ -267,6 +278,9 @@ static unsigned int taskdialog_add_buttons(struct taskdialog_template_desc *desc
|
||||||
if (count == 0)
|
if (count == 0)
|
||||||
taskdialog_init_button(&buttons[count++], desc, IDOK, MAKEINTRESOURCEW(IDS_BUTTON_OK), FALSE);
|
taskdialog_init_button(&buttons[count++], desc, IDOK, MAKEINTRESOURCEW(IDS_BUTTON_OK), FALSE);
|
||||||
|
|
||||||
|
if (!desc->default_button)
|
||||||
|
desc->default_button = &buttons[0];
|
||||||
|
|
||||||
/* For easy handling just allocate as many lines as buttons, the worst case. */
|
/* For easy handling just allocate as many lines as buttons, the worst case. */
|
||||||
line_widths = Alloc(count * sizeof(*line_widths));
|
line_widths = Alloc(count * sizeof(*line_widths));
|
||||||
|
|
||||||
|
@ -321,14 +335,16 @@ static unsigned int taskdialog_add_buttons(struct taskdialog_template_desc *desc
|
||||||
location_x = alignment;
|
location_x = alignment;
|
||||||
for (i = 0; i < count; i++)
|
for (i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
|
DWORD style = &buttons[i] == desc->default_button ? BS_DEFPUSHBUTTON : BS_PUSHBUTTON;
|
||||||
|
|
||||||
if (i > 0 && buttons[i].line != buttons[i - 1].line) /* New line */
|
if (i > 0 && buttons[i].line != buttons[i - 1].line) /* New line */
|
||||||
{
|
{
|
||||||
location_x = alignment;
|
location_x = alignment;
|
||||||
desc->dialog_height += DIALOG_BUTTON_HEIGHT + DIALOG_SPACING;
|
desc->dialog_height += DIALOG_BUTTON_HEIGHT + DIALOG_SPACING;
|
||||||
}
|
}
|
||||||
|
|
||||||
size += taskdialog_add_control(desc, buttons[i].id, WC_BUTTONW, buttons[i].hinst, buttons[i].text, location_x,
|
size += taskdialog_add_control(desc, buttons[i].id, WC_BUTTONW, buttons[i].hinst, buttons[i].text, style,
|
||||||
desc->dialog_height, buttons[i].width, DIALOG_BUTTON_HEIGHT);
|
location_x, desc->dialog_height, buttons[i].width, DIALOG_BUTTON_HEIGHT);
|
||||||
|
|
||||||
location_x += buttons[i].width + DIALOG_SPACING;
|
location_x += buttons[i].width + DIALOG_SPACING;
|
||||||
}
|
}
|
||||||
|
@ -376,6 +392,20 @@ static unsigned int taskdialog_get_reference_rect(const struct taskdialog_templa
|
||||||
return info.rcWork.right - info.rcWork.left;
|
return info.rcWork.right - info.rcWork.left;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static WCHAR *taskdialog_get_exe_name(const TASKDIALOGCONFIG *taskconfig, WCHAR *name, DWORD length)
|
||||||
|
{
|
||||||
|
DWORD len = GetModuleFileNameW(NULL, name, length);
|
||||||
|
if (len && len < length)
|
||||||
|
{
|
||||||
|
WCHAR *p;
|
||||||
|
if ((p = strrchrW(name, '/'))) name = p + 1;
|
||||||
|
if ((p = strrchrW(name, '\\'))) name = p + 1;
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
static DLGTEMPLATE *create_taskdialog_template(const TASKDIALOGCONFIG *taskconfig)
|
static DLGTEMPLATE *create_taskdialog_template(const TASKDIALOGCONFIG *taskconfig)
|
||||||
{
|
{
|
||||||
struct taskdialog_control *control, *control2;
|
struct taskdialog_control *control, *control2;
|
||||||
|
@ -386,15 +416,19 @@ static DLGTEMPLATE *create_taskdialog_template(const TASKDIALOGCONFIG *taskconfi
|
||||||
const WCHAR *titleW = NULL;
|
const WCHAR *titleW = NULL;
|
||||||
DLGTEMPLATE *template;
|
DLGTEMPLATE *template;
|
||||||
NONCLIENTMETRICSW ncm;
|
NONCLIENTMETRICSW ncm;
|
||||||
|
WCHAR pathW[MAX_PATH];
|
||||||
RECT ref_rect;
|
RECT ref_rect;
|
||||||
char *ptr;
|
char *ptr;
|
||||||
HDC hdc;
|
HDC hdc;
|
||||||
|
|
||||||
/* Window title */
|
/* Window title */
|
||||||
if (!taskconfig->pszWindowTitle)
|
if (!taskconfig->pszWindowTitle)
|
||||||
FIXME("use executable name for window title\n");
|
titleW = taskdialog_get_exe_name(taskconfig, pathW, sizeof(pathW)/sizeof(pathW[0]));
|
||||||
else if (IS_INTRESOURCE(taskconfig->pszWindowTitle))
|
else if (IS_INTRESOURCE(taskconfig->pszWindowTitle))
|
||||||
FIXME("load window title from resources\n");
|
{
|
||||||
|
if (!LoadStringW(taskconfig->hInstance, LOWORD(taskconfig->pszWindowTitle), (WCHAR *)&titleW, 0))
|
||||||
|
titleW = taskdialog_get_exe_name(taskconfig, pathW, sizeof(pathW)/sizeof(pathW[0]));
|
||||||
|
}
|
||||||
else
|
else
|
||||||
titleW = taskconfig->pszWindowTitle;
|
titleW = taskconfig->pszWindowTitle;
|
||||||
if (!titleW)
|
if (!titleW)
|
||||||
|
@ -423,6 +457,7 @@ static DLGTEMPLATE *create_taskdialog_template(const TASKDIALOGCONFIG *taskconfi
|
||||||
desc.dialog_height = 0;
|
desc.dialog_height = 0;
|
||||||
desc.dialog_width = max(taskconfig->cxWidth, DIALOG_MIN_WIDTH);
|
desc.dialog_width = max(taskconfig->cxWidth, DIALOG_MIN_WIDTH);
|
||||||
desc.dialog_width = min(desc.dialog_width, screen_width);
|
desc.dialog_width = min(desc.dialog_width, screen_width);
|
||||||
|
desc.default_button = NULL;
|
||||||
|
|
||||||
size += taskdialog_add_main_instruction(&desc);
|
size += taskdialog_add_main_instruction(&desc);
|
||||||
size += taskdialog_add_content(&desc);
|
size += taskdialog_add_content(&desc);
|
||||||
|
@ -466,20 +501,54 @@ static DLGTEMPLATE *create_taskdialog_template(const TASKDIALOGCONFIG *taskconfi
|
||||||
return template;
|
return template;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static HRESULT taskdialog_notify(struct taskdialog_info *dialog_info, UINT notification, WPARAM wparam, LPARAM lparam)
|
||||||
|
{
|
||||||
|
return dialog_info->callback ? dialog_info->callback(dialog_info->hwnd, notification, wparam, lparam,
|
||||||
|
dialog_info->callback_data) : S_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void taskdialog_on_button_click(struct taskdialog_info *dialog_info, WORD command_id)
|
||||||
|
{
|
||||||
|
if (taskdialog_notify(dialog_info, TDN_BUTTON_CLICKED, command_id, 0) == S_OK)
|
||||||
|
EndDialog(dialog_info->hwnd, command_id);
|
||||||
|
}
|
||||||
|
|
||||||
static INT_PTR CALLBACK taskdialog_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
static INT_PTR CALLBACK taskdialog_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
|
static const WCHAR taskdialog_info_propnameW[] = {'T','a','s','k','D','i','a','l','o','g','I','n','f','o',0};
|
||||||
|
struct taskdialog_info *dialog_info;
|
||||||
|
|
||||||
TRACE("hwnd=%p msg=0x%04x wparam=%lx lparam=%lx\n", hwnd, msg, wParam, lParam);
|
TRACE("hwnd=%p msg=0x%04x wparam=%lx lparam=%lx\n", hwnd, msg, wParam, lParam);
|
||||||
|
|
||||||
|
if (msg != WM_INITDIALOG)
|
||||||
|
dialog_info = GetPropW(hwnd, taskdialog_info_propnameW);
|
||||||
|
|
||||||
switch (msg)
|
switch (msg)
|
||||||
{
|
{
|
||||||
|
case TDM_CLICK_BUTTON:
|
||||||
|
taskdialog_on_button_click(dialog_info, LOWORD(wParam));
|
||||||
|
break;
|
||||||
|
case WM_INITDIALOG:
|
||||||
|
dialog_info = (struct taskdialog_info *)lParam;
|
||||||
|
dialog_info->hwnd = hwnd;
|
||||||
|
SetPropW(hwnd, taskdialog_info_propnameW, dialog_info);
|
||||||
|
|
||||||
|
taskdialog_notify(dialog_info, TDN_DIALOG_CONSTRUCTED, 0, 0);
|
||||||
|
break;
|
||||||
|
case WM_SHOWWINDOW:
|
||||||
|
taskdialog_notify(dialog_info, TDN_CREATED, 0, 0);
|
||||||
|
break;
|
||||||
case WM_COMMAND:
|
case WM_COMMAND:
|
||||||
if (HIWORD(wParam) == BN_CLICKED)
|
if (HIWORD(wParam) == BN_CLICKED)
|
||||||
{
|
{
|
||||||
WORD command_id = LOWORD(wParam);
|
taskdialog_on_button_click(dialog_info, LOWORD(wParam));
|
||||||
EndDialog(hwnd, command_id);
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case WM_DESTROY:
|
||||||
|
taskdialog_notify(dialog_info, TDN_DESTROYED, 0, 0);
|
||||||
|
RemovePropW(hwnd, taskdialog_info_propnameW);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -490,13 +559,21 @@ static INT_PTR CALLBACK taskdialog_proc(HWND hwnd, UINT msg, WPARAM wParam, LPAR
|
||||||
HRESULT WINAPI TaskDialogIndirect(const TASKDIALOGCONFIG *taskconfig, int *button,
|
HRESULT WINAPI TaskDialogIndirect(const TASKDIALOGCONFIG *taskconfig, int *button,
|
||||||
int *radio_button, BOOL *verification_flag_checked)
|
int *radio_button, BOOL *verification_flag_checked)
|
||||||
{
|
{
|
||||||
|
struct taskdialog_info dialog_info;
|
||||||
DLGTEMPLATE *template;
|
DLGTEMPLATE *template;
|
||||||
INT ret;
|
INT ret;
|
||||||
|
|
||||||
TRACE("%p, %p, %p, %p\n", taskconfig, button, radio_button, verification_flag_checked);
|
TRACE("%p, %p, %p, %p\n", taskconfig, button, radio_button, verification_flag_checked);
|
||||||
|
|
||||||
|
if (!taskconfig || taskconfig->cbSize != sizeof(TASKDIALOGCONFIG))
|
||||||
|
return E_INVALIDARG;
|
||||||
|
|
||||||
|
dialog_info.callback = taskconfig->pfCallback;
|
||||||
|
dialog_info.callback_data = taskconfig->lpCallbackData;
|
||||||
|
|
||||||
template = create_taskdialog_template(taskconfig);
|
template = create_taskdialog_template(taskconfig);
|
||||||
ret = DialogBoxIndirectParamW(taskconfig->hInstance, template, taskconfig->hwndParent, taskdialog_proc, 0);
|
ret = (short)DialogBoxIndirectParamW(taskconfig->hInstance, template, taskconfig->hwndParent,
|
||||||
|
taskdialog_proc, (LPARAM)&dialog_info);
|
||||||
Free(template);
|
Free(template);
|
||||||
|
|
||||||
if (button) *button = ret;
|
if (button) *button = ret;
|
||||||
|
|
|
@ -392,7 +392,7 @@ static void TOOLTIPS_GetDispInfoA(const TOOLTIPS_INFO *infoPtr, TTTOOL_INFO *too
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ERR("recursive text callback!\n");
|
ERR("recursive text callback\n");
|
||||||
buffer[0] = '\0';
|
buffer[0] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -448,7 +448,7 @@ static void TOOLTIPS_GetDispInfoW(const TOOLTIPS_INFO *infoPtr, TTTOOL_INFO *too
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ERR("recursive text callback!\n");
|
ERR("recursive text callback\n");
|
||||||
buffer[0] = '\0';
|
buffer[0] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -577,13 +577,13 @@ TOOLTIPS_Show (TOOLTIPS_INFO *infoPtr, BOOL track_activate)
|
||||||
NMHDR hdr;
|
NMHDR hdr;
|
||||||
int ptfx = 0;
|
int ptfx = 0;
|
||||||
DWORD style = GetWindowLongW(infoPtr->hwndSelf, GWL_STYLE);
|
DWORD style = GetWindowLongW(infoPtr->hwndSelf, GWL_STYLE);
|
||||||
INT nTool;
|
INT nTool, current;
|
||||||
|
|
||||||
if (track_activate)
|
if (track_activate)
|
||||||
{
|
{
|
||||||
if (infoPtr->nTrackTool == -1)
|
if (infoPtr->nTrackTool == -1)
|
||||||
{
|
{
|
||||||
TRACE("invalid tracking tool (-1)!\n");
|
TRACE("invalid tracking tool %d\n", infoPtr->nTrackTool);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
nTool = infoPtr->nTrackTool;
|
nTool = infoPtr->nTrackTool;
|
||||||
|
@ -592,25 +592,29 @@ TOOLTIPS_Show (TOOLTIPS_INFO *infoPtr, BOOL track_activate)
|
||||||
{
|
{
|
||||||
if (infoPtr->nTool == -1)
|
if (infoPtr->nTool == -1)
|
||||||
{
|
{
|
||||||
TRACE("invalid tool (-1)!\n");
|
TRACE("invalid tool %d\n", infoPtr->nTool);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
nTool = infoPtr->nTool;
|
nTool = infoPtr->nTool;
|
||||||
}
|
}
|
||||||
|
|
||||||
TRACE("Show tooltip pre %d! (%p)\n", nTool, infoPtr->hwndSelf);
|
TRACE("Show tooltip pre %d, %p\n", nTool, infoPtr->hwndSelf);
|
||||||
|
|
||||||
|
current = infoPtr->nCurrentTool;
|
||||||
|
if (!track_activate)
|
||||||
|
infoPtr->nCurrentTool = infoPtr->nTool;
|
||||||
|
|
||||||
TOOLTIPS_GetTipText (infoPtr, nTool, infoPtr->szTipText);
|
TOOLTIPS_GetTipText (infoPtr, nTool, infoPtr->szTipText);
|
||||||
|
|
||||||
if (infoPtr->szTipText[0] == '\0')
|
if (infoPtr->szTipText[0] == '\0')
|
||||||
|
{
|
||||||
|
infoPtr->nCurrentTool = current;
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
toolPtr = &infoPtr->tools[nTool];
|
toolPtr = &infoPtr->tools[nTool];
|
||||||
|
|
||||||
if (!track_activate)
|
TRACE("Show tooltip %d\n", nTool);
|
||||||
infoPtr->nCurrentTool = infoPtr->nTool;
|
|
||||||
|
|
||||||
TRACE("Show tooltip %d!\n", nTool);
|
|
||||||
|
|
||||||
hdr.hwndFrom = infoPtr->hwndSelf;
|
hdr.hwndFrom = infoPtr->hwndSelf;
|
||||||
hdr.idFrom = toolPtr->uId;
|
hdr.idFrom = toolPtr->uId;
|
||||||
|
@ -820,9 +824,9 @@ TOOLTIPS_Show (TOOLTIPS_INFO *infoPtr, BOOL track_activate)
|
||||||
if (!track_activate)
|
if (!track_activate)
|
||||||
{
|
{
|
||||||
SetTimer (infoPtr->hwndSelf, ID_TIMERPOP, infoPtr->nAutoPopTime, 0);
|
SetTimer (infoPtr->hwndSelf, ID_TIMERPOP, infoPtr->nAutoPopTime, 0);
|
||||||
TRACE("timer 2 started!\n");
|
TRACE("timer 2 started\n");
|
||||||
SetTimer (infoPtr->hwndSelf, ID_TIMERLEAVE, infoPtr->nReshowTime, 0);
|
SetTimer (infoPtr->hwndSelf, ID_TIMERLEAVE, infoPtr->nReshowTime, 0);
|
||||||
TRACE("timer 3 started!\n");
|
TRACE("timer 3 started\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -833,7 +837,7 @@ TOOLTIPS_Hide (TOOLTIPS_INFO *infoPtr)
|
||||||
TTTOOL_INFO *toolPtr;
|
TTTOOL_INFO *toolPtr;
|
||||||
NMHDR hdr;
|
NMHDR hdr;
|
||||||
|
|
||||||
TRACE("Hide tooltip %d! (%p)\n", infoPtr->nCurrentTool, infoPtr->hwndSelf);
|
TRACE("Hide tooltip %d, %p.\n", infoPtr->nCurrentTool, infoPtr->hwndSelf);
|
||||||
|
|
||||||
if (infoPtr->nCurrentTool == -1)
|
if (infoPtr->nCurrentTool == -1)
|
||||||
return;
|
return;
|
||||||
|
@ -942,8 +946,16 @@ TOOLTIPS_GetToolFromPoint (const TOOLTIPS_INFO *infoPtr, HWND hwnd, const POINT
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
TOOLTIPS_CopyInfoT (const TTTOOL_INFO *toolPtr, TTTOOLINFOW *ti, BOOL isW)
|
TOOLTIPS_CopyInfoT (const TOOLTIPS_INFO *infoPtr, INT index, TTTOOLINFOW *ti, BOOL isW)
|
||||||
{
|
{
|
||||||
|
const TTTOOL_INFO *toolPtr = &infoPtr->tools[index];
|
||||||
|
|
||||||
|
ti->uFlags = toolPtr->uFlags;
|
||||||
|
ti->hwnd = toolPtr->hwnd;
|
||||||
|
ti->uId = toolPtr->uId;
|
||||||
|
ti->rect = toolPtr->rect;
|
||||||
|
ti->hinst = toolPtr->hinst;
|
||||||
|
|
||||||
if (ti->lpszText) {
|
if (ti->lpszText) {
|
||||||
if (toolPtr->lpszText == NULL ||
|
if (toolPtr->lpszText == NULL ||
|
||||||
IS_INTRESOURCE(toolPtr->lpszText) ||
|
IS_INTRESOURCE(toolPtr->lpszText) ||
|
||||||
|
@ -956,6 +968,11 @@ TOOLTIPS_CopyInfoT (const TTTOOL_INFO *toolPtr, TTTOOLINFOW *ti, BOOL isW)
|
||||||
WideCharToMultiByte(CP_ACP, 0, toolPtr->lpszText, -1,
|
WideCharToMultiByte(CP_ACP, 0, toolPtr->lpszText, -1,
|
||||||
(LPSTR)ti->lpszText, MAX_TEXT_SIZE_A, NULL, NULL);
|
(LPSTR)ti->lpszText, MAX_TEXT_SIZE_A, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ti->cbSize >= TTTOOLINFOW_V2_SIZE)
|
||||||
|
ti->lParam = toolPtr->lParam;
|
||||||
|
|
||||||
|
/* lpReserved is intentionally not set. */
|
||||||
}
|
}
|
||||||
|
|
||||||
static BOOL
|
static BOOL
|
||||||
|
@ -1011,8 +1028,7 @@ TOOLTIPS_Activate (TOOLTIPS_INFO *infoPtr, BOOL activate)
|
||||||
{
|
{
|
||||||
infoPtr->bActive = activate;
|
infoPtr->bActive = activate;
|
||||||
|
|
||||||
if (infoPtr->bActive)
|
TRACE("activate %d\n", activate);
|
||||||
TRACE("activate!\n");
|
|
||||||
|
|
||||||
if (!(infoPtr->bActive) && (infoPtr->nCurrentTool != -1))
|
if (!(infoPtr->bActive) && (infoPtr->nCurrentTool != -1))
|
||||||
TOOLTIPS_Hide (infoPtr);
|
TOOLTIPS_Hide (infoPtr);
|
||||||
|
@ -1029,8 +1045,7 @@ TOOLTIPS_AddToolT (TOOLTIPS_INFO *infoPtr, const TTTOOLINFOW *ti, BOOL isW)
|
||||||
|
|
||||||
if (!ti) return FALSE;
|
if (!ti) return FALSE;
|
||||||
|
|
||||||
TRACE("add tool (%p) %p %ld%s!\n",
|
TRACE("add tool (%p) %p %ld%s\n", infoPtr->hwndSelf, ti->hwnd, ti->uId,
|
||||||
infoPtr->hwndSelf, ti->hwnd, ti->uId,
|
|
||||||
(ti->uFlags & TTF_IDISHWND) ? " TTF_IDISHWND" : "");
|
(ti->uFlags & TTF_IDISHWND) ? " TTF_IDISHWND" : "");
|
||||||
|
|
||||||
if (ti->cbSize >= TTTOOLINFOW_V2_SIZE && !ti->lpszText && isW)
|
if (ti->cbSize >= TTTOOLINFOW_V2_SIZE && !ti->lpszText && isW)
|
||||||
|
@ -1067,27 +1082,18 @@ TOOLTIPS_AddToolT (TOOLTIPS_INFO *infoPtr, const TTTOOLINFOW *ti, BOOL isW)
|
||||||
}
|
}
|
||||||
else if (ti->lpszText) {
|
else if (ti->lpszText) {
|
||||||
if (TOOLTIPS_IsCallbackString(ti->lpszText, isW)) {
|
if (TOOLTIPS_IsCallbackString(ti->lpszText, isW)) {
|
||||||
TRACE("add CALLBACK!\n");
|
TRACE("add CALLBACK\n");
|
||||||
toolPtr->lpszText = LPSTR_TEXTCALLBACKW;
|
toolPtr->lpszText = LPSTR_TEXTCALLBACKW;
|
||||||
}
|
}
|
||||||
else if (isW) {
|
else if (isW) {
|
||||||
__TRY
|
|
||||||
{
|
|
||||||
INT len = lstrlenW (ti->lpszText);
|
INT len = lstrlenW (ti->lpszText);
|
||||||
TRACE("add text %s!\n", debugstr_w(ti->lpszText));
|
TRACE("add text %s\n", debugstr_w(ti->lpszText));
|
||||||
toolPtr->lpszText = Alloc ((len + 1)*sizeof(WCHAR));
|
toolPtr->lpszText = Alloc ((len + 1)*sizeof(WCHAR));
|
||||||
strcpyW (toolPtr->lpszText, ti->lpszText);
|
strcpyW (toolPtr->lpszText, ti->lpszText);
|
||||||
}
|
}
|
||||||
__EXCEPT_PAGE_FAULT
|
|
||||||
{
|
|
||||||
WARN("Invalid lpszText.\n");
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
__ENDTRY
|
|
||||||
}
|
|
||||||
else {
|
else {
|
||||||
INT len = MultiByteToWideChar(CP_ACP, 0, (LPSTR)ti->lpszText, -1, NULL, 0);
|
INT len = MultiByteToWideChar(CP_ACP, 0, (LPSTR)ti->lpszText, -1, NULL, 0);
|
||||||
TRACE("add text \"%s\"!\n", (LPSTR)ti->lpszText);
|
TRACE("add text \"%s\"\n", debugstr_a((char *)ti->lpszText));
|
||||||
toolPtr->lpszText = Alloc (len * sizeof(WCHAR));
|
toolPtr->lpszText = Alloc (len * sizeof(WCHAR));
|
||||||
MultiByteToWideChar(CP_ACP, 0, (LPSTR)ti->lpszText, -1, toolPtr->lpszText, len);
|
MultiByteToWideChar(CP_ACP, 0, (LPSTR)ti->lpszText, -1, toolPtr->lpszText, len);
|
||||||
}
|
}
|
||||||
|
@ -1107,7 +1113,7 @@ TOOLTIPS_AddToolT (TOOLTIPS_INFO *infoPtr, const TTTOOLINFOW *ti, BOOL isW)
|
||||||
SetWindowSubclass(toolPtr->hwnd, TOOLTIPS_SubclassProc, 1,
|
SetWindowSubclass(toolPtr->hwnd, TOOLTIPS_SubclassProc, 1,
|
||||||
(DWORD_PTR)infoPtr->hwndSelf);
|
(DWORD_PTR)infoPtr->hwndSelf);
|
||||||
}
|
}
|
||||||
TRACE("subclassing installed!\n");
|
TRACE("subclassing installed\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
nResult = SendMessageW (toolPtr->hwnd, WM_NOTIFYFORMAT,
|
nResult = SendMessageW (toolPtr->hwnd, WM_NOTIFYFORMAT,
|
||||||
|
@ -1119,12 +1125,19 @@ TOOLTIPS_AddToolT (TOOLTIPS_INFO *infoPtr, const TTTOOLINFOW *ti, BOOL isW)
|
||||||
toolPtr->bNotifyUnicode = TRUE;
|
toolPtr->bNotifyUnicode = TRUE;
|
||||||
TRACE(" -- WM_NOTIFYFORMAT returns: NFR_UNICODE\n");
|
TRACE(" -- WM_NOTIFYFORMAT returns: NFR_UNICODE\n");
|
||||||
} else {
|
} else {
|
||||||
TRACE (" -- WM_NOTIFYFORMAT returns: error!\n");
|
TRACE (" -- WM_NOTIFYFORMAT returns: %d\n", nResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void TOOLTIPS_ResetSubclass (const TTTOOL_INFO *toolPtr)
|
||||||
|
{
|
||||||
|
/* Reset subclassing data. */
|
||||||
|
if (toolPtr->uInternalFlags & TTF_SUBCLASS)
|
||||||
|
SetWindowSubclass(toolPtr->uInternalFlags & TTF_IDISHWND ? (HWND)toolPtr->uId : toolPtr->hwnd,
|
||||||
|
TOOLTIPS_SubclassProc, 1, 0);
|
||||||
|
}
|
||||||
|
|
||||||
static LRESULT
|
static LRESULT
|
||||||
TOOLTIPS_DelToolT (TOOLTIPS_INFO *infoPtr, const TTTOOLINFOW *ti, BOOL isW)
|
TOOLTIPS_DelToolT (TOOLTIPS_INFO *infoPtr, const TTTOOLINFOW *ti, BOOL isW)
|
||||||
|
@ -1157,15 +1170,7 @@ TOOLTIPS_DelToolT (TOOLTIPS_INFO *infoPtr, const TTTOOLINFOW *ti, BOOL isW)
|
||||||
Free (toolPtr->lpszText);
|
Free (toolPtr->lpszText);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* remove subclassing */
|
TOOLTIPS_ResetSubclass (toolPtr);
|
||||||
if (toolPtr->uInternalFlags & TTF_SUBCLASS) {
|
|
||||||
if (toolPtr->uInternalFlags & TTF_IDISHWND) {
|
|
||||||
RemoveWindowSubclass((HWND)toolPtr->uId, TOOLTIPS_SubclassProc, 1);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
RemoveWindowSubclass(toolPtr->hwnd, TOOLTIPS_SubclassProc, 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* delete tool from tool list */
|
/* delete tool from tool list */
|
||||||
if (infoPtr->uNumTools == 1) {
|
if (infoPtr->uNumTools == 1) {
|
||||||
|
@ -1218,28 +1223,14 @@ static LRESULT
|
||||||
TOOLTIPS_EnumToolsT (const TOOLTIPS_INFO *infoPtr, UINT uIndex, TTTOOLINFOW *ti,
|
TOOLTIPS_EnumToolsT (const TOOLTIPS_INFO *infoPtr, UINT uIndex, TTTOOLINFOW *ti,
|
||||||
BOOL isW)
|
BOOL isW)
|
||||||
{
|
{
|
||||||
TTTOOL_INFO *toolPtr;
|
if (!ti || ti->cbSize < TTTOOLINFOW_V1_SIZE)
|
||||||
|
|
||||||
if (!ti) return FALSE;
|
|
||||||
if (ti->cbSize < TTTOOLINFOW_V1_SIZE)
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
if (uIndex >= infoPtr->uNumTools)
|
if (uIndex >= infoPtr->uNumTools)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
TRACE("index=%u\n", uIndex);
|
TRACE("index=%u\n", uIndex);
|
||||||
|
|
||||||
toolPtr = &infoPtr->tools[uIndex];
|
TOOLTIPS_CopyInfoT (infoPtr, uIndex, ti, isW);
|
||||||
|
|
||||||
/* copy tool data */
|
|
||||||
ti->uFlags = toolPtr->uFlags;
|
|
||||||
ti->hwnd = toolPtr->hwnd;
|
|
||||||
ti->uId = toolPtr->uId;
|
|
||||||
ti->rect = toolPtr->rect;
|
|
||||||
ti->hinst = toolPtr->hinst;
|
|
||||||
TOOLTIPS_CopyInfoT (toolPtr, ti, isW);
|
|
||||||
|
|
||||||
if (ti->cbSize >= TTTOOLINFOA_V2_SIZE)
|
|
||||||
ti->lParam = toolPtr->lParam;
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -1269,31 +1260,15 @@ TOOLTIPS_GetBubbleSize (const TOOLTIPS_INFO *infoPtr, const TTTOOLINFOW *lpToolI
|
||||||
static LRESULT
|
static LRESULT
|
||||||
TOOLTIPS_GetCurrentToolT (const TOOLTIPS_INFO *infoPtr, TTTOOLINFOW *ti, BOOL isW)
|
TOOLTIPS_GetCurrentToolT (const TOOLTIPS_INFO *infoPtr, TTTOOLINFOW *ti, BOOL isW)
|
||||||
{
|
{
|
||||||
TTTOOL_INFO *toolPtr;
|
|
||||||
|
|
||||||
if (ti) {
|
if (ti) {
|
||||||
if (ti->cbSize < TTTOOLINFOW_V1_SIZE)
|
if (ti->cbSize < TTTOOLINFOW_V1_SIZE)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (infoPtr->nCurrentTool > -1) {
|
if (infoPtr->nCurrentTool != -1)
|
||||||
toolPtr = &infoPtr->tools[infoPtr->nCurrentTool];
|
TOOLTIPS_CopyInfoT (infoPtr, infoPtr->nCurrentTool, ti, isW);
|
||||||
|
|
||||||
/* copy tool data */
|
|
||||||
ti->uFlags = toolPtr->uFlags;
|
|
||||||
ti->rect = toolPtr->rect;
|
|
||||||
ti->hinst = toolPtr->hinst;
|
|
||||||
TOOLTIPS_CopyInfoT (toolPtr, ti, isW);
|
|
||||||
|
|
||||||
if (ti->cbSize >= TTTOOLINFOW_V2_SIZE)
|
|
||||||
ti->lParam = toolPtr->lParam;
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
return FALSE;
|
return infoPtr->nCurrentTool != -1;
|
||||||
}
|
|
||||||
else
|
|
||||||
return (infoPtr->nCurrentTool != -1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1398,8 +1373,8 @@ TOOLTIPS_GetToolCount (const TOOLTIPS_INFO *infoPtr)
|
||||||
static LRESULT
|
static LRESULT
|
||||||
TOOLTIPS_GetToolInfoT (const TOOLTIPS_INFO *infoPtr, TTTOOLINFOW *ti, BOOL isW)
|
TOOLTIPS_GetToolInfoT (const TOOLTIPS_INFO *infoPtr, TTTOOLINFOW *ti, BOOL isW)
|
||||||
{
|
{
|
||||||
TTTOOL_INFO *toolPtr;
|
|
||||||
INT nTool;
|
INT nTool;
|
||||||
|
HWND hwnd;
|
||||||
|
|
||||||
if (!ti) return FALSE;
|
if (!ti) return FALSE;
|
||||||
if (ti->cbSize < TTTOOLINFOW_V1_SIZE)
|
if (ti->cbSize < TTTOOLINFOW_V1_SIZE)
|
||||||
|
@ -1413,16 +1388,9 @@ TOOLTIPS_GetToolInfoT (const TOOLTIPS_INFO *infoPtr, TTTOOLINFOW *ti, BOOL isW)
|
||||||
|
|
||||||
TRACE("tool %d\n", nTool);
|
TRACE("tool %d\n", nTool);
|
||||||
|
|
||||||
toolPtr = &infoPtr->tools[nTool];
|
hwnd = ti->hwnd;
|
||||||
|
TOOLTIPS_CopyInfoT (infoPtr, nTool, ti, isW);
|
||||||
/* copy tool data */
|
ti->hwnd = hwnd;
|
||||||
ti->uFlags = toolPtr->uFlags;
|
|
||||||
ti->rect = toolPtr->rect;
|
|
||||||
ti->hinst = toolPtr->hinst;
|
|
||||||
TOOLTIPS_CopyInfoT (toolPtr, ti, isW);
|
|
||||||
|
|
||||||
if (ti->cbSize >= TTTOOLINFOW_V2_SIZE)
|
|
||||||
ti->lParam = toolPtr->lParam;
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -1432,7 +1400,6 @@ static LRESULT
|
||||||
TOOLTIPS_HitTestT (const TOOLTIPS_INFO *infoPtr, LPTTHITTESTINFOW lptthit,
|
TOOLTIPS_HitTestT (const TOOLTIPS_INFO *infoPtr, LPTTHITTESTINFOW lptthit,
|
||||||
BOOL isW)
|
BOOL isW)
|
||||||
{
|
{
|
||||||
TTTOOL_INFO *toolPtr;
|
|
||||||
INT nTool;
|
INT nTool;
|
||||||
|
|
||||||
if (lptthit == 0)
|
if (lptthit == 0)
|
||||||
|
@ -1442,21 +1409,11 @@ TOOLTIPS_HitTestT (const TOOLTIPS_INFO *infoPtr, LPTTHITTESTINFOW lptthit,
|
||||||
if (nTool == -1)
|
if (nTool == -1)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
TRACE("tool %d!\n", nTool);
|
TRACE("tool %d\n", nTool);
|
||||||
|
|
||||||
/* copy tool data */
|
/* copy tool data */
|
||||||
if (lptthit->ti.cbSize >= TTTOOLINFOW_V1_SIZE) {
|
if (lptthit->ti.cbSize >= TTTOOLINFOW_V1_SIZE)
|
||||||
toolPtr = &infoPtr->tools[nTool];
|
TOOLTIPS_CopyInfoT (infoPtr, nTool, &lptthit->ti, isW);
|
||||||
|
|
||||||
lptthit->ti.uFlags = toolPtr->uFlags;
|
|
||||||
lptthit->ti.hwnd = toolPtr->hwnd;
|
|
||||||
lptthit->ti.uId = toolPtr->uId;
|
|
||||||
lptthit->ti.rect = toolPtr->rect;
|
|
||||||
lptthit->ti.hinst = toolPtr->hinst;
|
|
||||||
TOOLTIPS_CopyInfoT (toolPtr, &lptthit->ti, isW);
|
|
||||||
if (lptthit->ti.cbSize >= TTTOOLINFOW_V2_SIZE)
|
|
||||||
lptthit->ti.lParam = toolPtr->lParam;
|
|
||||||
}
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -1499,7 +1456,7 @@ TOOLTIPS_RelayEvent (TOOLTIPS_INFO *infoPtr, LPMSG lpMsg)
|
||||||
INT nOldTool;
|
INT nOldTool;
|
||||||
|
|
||||||
if (!lpMsg) {
|
if (!lpMsg) {
|
||||||
ERR("lpMsg == NULL!\n");
|
ERR("lpMsg == NULL\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1530,14 +1487,14 @@ TOOLTIPS_RelayEvent (TOOLTIPS_INFO *infoPtr, LPMSG lpMsg)
|
||||||
} else if (nOldTool == -1) { /* Moved from outside */
|
} else if (nOldTool == -1) { /* Moved from outside */
|
||||||
if(infoPtr->bActive) {
|
if(infoPtr->bActive) {
|
||||||
SetTimer(infoPtr->hwndSelf, ID_TIMERSHOW, infoPtr->nInitialTime, 0);
|
SetTimer(infoPtr->hwndSelf, ID_TIMERSHOW, infoPtr->nInitialTime, 0);
|
||||||
TRACE("timer 1 started!\n");
|
TRACE("timer 1 started\n");
|
||||||
}
|
}
|
||||||
} else { /* Moved from one to another */
|
} else { /* Moved from one to another */
|
||||||
TOOLTIPS_Hide (infoPtr);
|
TOOLTIPS_Hide (infoPtr);
|
||||||
KillTimer(infoPtr->hwndSelf, ID_TIMERLEAVE);
|
KillTimer(infoPtr->hwndSelf, ID_TIMERLEAVE);
|
||||||
if(infoPtr->bActive) {
|
if(infoPtr->bActive) {
|
||||||
SetTimer (infoPtr->hwndSelf, ID_TIMERSHOW, infoPtr->nReshowTime, 0);
|
SetTimer (infoPtr->hwndSelf, ID_TIMERSHOW, infoPtr->nReshowTime, 0);
|
||||||
TRACE("timer 1 started!\n");
|
TRACE("timer 1 started\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if(infoPtr->nCurrentTool != -1) { /* restart autopop */
|
} else if(infoPtr->nCurrentTool != -1) { /* restart autopop */
|
||||||
|
@ -1547,7 +1504,7 @@ TOOLTIPS_RelayEvent (TOOLTIPS_INFO *infoPtr, LPMSG lpMsg)
|
||||||
} else if(infoPtr->nTool != -1 && infoPtr->bActive) {
|
} else if(infoPtr->nTool != -1 && infoPtr->bActive) {
|
||||||
/* previous show attempt didn't result in tooltip so try again */
|
/* previous show attempt didn't result in tooltip so try again */
|
||||||
SetTimer(infoPtr->hwndSelf, ID_TIMERSHOW, infoPtr->nInitialTime, 0);
|
SetTimer(infoPtr->hwndSelf, ID_TIMERSHOW, infoPtr->nInitialTime, 0);
|
||||||
TRACE("timer 1 started!\n");
|
TRACE("timer 1 started\n");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1703,7 +1660,7 @@ TOOLTIPS_SetToolInfoT (TOOLTIPS_INFO *infoPtr, const TTTOOLINFOW *ti, BOOL isW)
|
||||||
toolPtr->hinst = ti->hinst;
|
toolPtr->hinst = ti->hinst;
|
||||||
|
|
||||||
if (IS_INTRESOURCE(ti->lpszText)) {
|
if (IS_INTRESOURCE(ti->lpszText)) {
|
||||||
TRACE("set string id %x!\n", LOWORD(ti->lpszText));
|
TRACE("set string id %x\n", LOWORD(ti->lpszText));
|
||||||
toolPtr->lpszText = ti->lpszText;
|
toolPtr->lpszText = ti->lpszText;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -1762,7 +1719,7 @@ TOOLTIPS_TrackActivate (TOOLTIPS_INFO *infoPtr, BOOL track_activate, const TTTOO
|
||||||
/* activate */
|
/* activate */
|
||||||
infoPtr->nTrackTool = TOOLTIPS_GetToolFromInfoT (infoPtr, (const TTTOOLINFOW*)ti);
|
infoPtr->nTrackTool = TOOLTIPS_GetToolFromInfoT (infoPtr, (const TTTOOLINFOW*)ti);
|
||||||
if (infoPtr->nTrackTool != -1) {
|
if (infoPtr->nTrackTool != -1) {
|
||||||
TRACE("activated!\n");
|
TRACE("activated\n");
|
||||||
infoPtr->bTrackActive = TRUE;
|
infoPtr->bTrackActive = TRUE;
|
||||||
TOOLTIPS_TrackShow (infoPtr);
|
TOOLTIPS_TrackShow (infoPtr);
|
||||||
}
|
}
|
||||||
|
@ -1774,7 +1731,7 @@ TOOLTIPS_TrackActivate (TOOLTIPS_INFO *infoPtr, BOOL track_activate, const TTTOO
|
||||||
infoPtr->bTrackActive = FALSE;
|
infoPtr->bTrackActive = FALSE;
|
||||||
infoPtr->nTrackTool = -1;
|
infoPtr->nTrackTool = -1;
|
||||||
|
|
||||||
TRACE("deactivated!\n");
|
TRACE("deactivated\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1919,16 +1876,9 @@ TOOLTIPS_Destroy (TOOLTIPS_INFO *infoPtr)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* remove subclassing */
|
TOOLTIPS_ResetSubclass (toolPtr);
|
||||||
if (toolPtr->uInternalFlags & TTF_SUBCLASS) {
|
|
||||||
if (toolPtr->uInternalFlags & TTF_IDISHWND) {
|
|
||||||
RemoveWindowSubclass((HWND)toolPtr->uId, TOOLTIPS_SubclassProc, 1);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
RemoveWindowSubclass(toolPtr->hwnd, TOOLTIPS_SubclassProc, 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Free (infoPtr->tools);
|
Free (infoPtr->tools);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1997,7 +1947,7 @@ TOOLTIPS_NCHitTest (const TOOLTIPS_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
|
||||||
|
|
||||||
if ((nTool > -1) && (nTool < infoPtr->uNumTools)) {
|
if ((nTool > -1) && (nTool < infoPtr->uNumTools)) {
|
||||||
if (infoPtr->tools[nTool].uFlags & TTF_TRANSPARENT) {
|
if (infoPtr->tools[nTool].uFlags & TTF_TRANSPARENT) {
|
||||||
TRACE("-- in transparent mode!\n");
|
TRACE("-- in transparent mode\n");
|
||||||
return HTTRANSPARENT;
|
return HTTRANSPARENT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2073,9 +2023,8 @@ TOOLTIPS_SetFont (TOOLTIPS_INFO *infoPtr, HFONT hFont, BOOL redraw)
|
||||||
lf.lfWeight = FW_BOLD;
|
lf.lfWeight = FW_BOLD;
|
||||||
infoPtr->hTitleFont = CreateFontIndirectW(&lf);
|
infoPtr->hTitleFont = CreateFontIndirectW(&lf);
|
||||||
|
|
||||||
if (redraw && infoPtr->nCurrentTool != -1) {
|
if (redraw && infoPtr->nCurrentTool != -1)
|
||||||
FIXME("full redraw needed!\n");
|
FIXME("full redraw needed\n");
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -2124,7 +2073,7 @@ TOOLTIPS_Timer (TOOLTIPS_INFO *infoPtr, INT iTimer)
|
||||||
{
|
{
|
||||||
INT nOldTool;
|
INT nOldTool;
|
||||||
|
|
||||||
TRACE("timer %d (%p) expired!\n", iTimer, infoPtr->hwndSelf);
|
TRACE("timer %d (%p) expired\n", iTimer, infoPtr->hwndSelf);
|
||||||
|
|
||||||
switch (iTimer) {
|
switch (iTimer) {
|
||||||
case ID_TIMERSHOW:
|
case ID_TIMERSHOW:
|
||||||
|
@ -2178,12 +2127,13 @@ TOOLTIPS_WinIniChange (TOOLTIPS_INFO *infoPtr)
|
||||||
|
|
||||||
|
|
||||||
static LRESULT CALLBACK
|
static LRESULT CALLBACK
|
||||||
TOOLTIPS_SubclassProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT_PTR uID, DWORD_PTR dwRef)
|
TOOLTIPS_SubclassProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam, UINT_PTR uID, DWORD_PTR dwRef)
|
||||||
{
|
{
|
||||||
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr ((HWND)dwRef);
|
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr ((HWND)dwRef);
|
||||||
MSG msg;
|
MSG msg;
|
||||||
|
|
||||||
switch(uMsg) {
|
switch (message)
|
||||||
|
{
|
||||||
case WM_MOUSEMOVE:
|
case WM_MOUSEMOVE:
|
||||||
case WM_LBUTTONDOWN:
|
case WM_LBUTTONDOWN:
|
||||||
case WM_LBUTTONUP:
|
case WM_LBUTTONUP:
|
||||||
|
@ -2191,17 +2141,23 @@ TOOLTIPS_SubclassProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT_
|
||||||
case WM_MBUTTONUP:
|
case WM_MBUTTONUP:
|
||||||
case WM_RBUTTONDOWN:
|
case WM_RBUTTONDOWN:
|
||||||
case WM_RBUTTONUP:
|
case WM_RBUTTONUP:
|
||||||
|
if (infoPtr)
|
||||||
|
{
|
||||||
msg.hwnd = hwnd;
|
msg.hwnd = hwnd;
|
||||||
msg.message = uMsg;
|
msg.message = message;
|
||||||
msg.wParam = wParam;
|
msg.wParam = wParam;
|
||||||
msg.lParam = lParam;
|
msg.lParam = lParam;
|
||||||
TOOLTIPS_RelayEvent(infoPtr, &msg);
|
TOOLTIPS_RelayEvent(infoPtr, &msg);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case WM_NCDESTROY:
|
||||||
|
RemoveWindowSubclass(hwnd, TOOLTIPS_SubclassProc, 1);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return DefSubclassProc(hwnd, uMsg, wParam, lParam);
|
|
||||||
|
return DefSubclassProc(hwnd, message, wParam, lParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -607,11 +607,11 @@ static HWND UPDOWN_SetBuddy (UPDOWN_INFO* infoPtr, HWND bud)
|
||||||
RECT budRect; /* new coord for the buddy */
|
RECT budRect; /* new coord for the buddy */
|
||||||
int x, width; /* new x position and width for the up-down */
|
int x, width; /* new x position and width for the up-down */
|
||||||
WCHAR buddyClass[40];
|
WCHAR buddyClass[40];
|
||||||
HWND ret;
|
HWND old_buddy;
|
||||||
|
|
||||||
TRACE("(hwnd=%p, bud=%p)\n", infoPtr->Self, bud);
|
TRACE("(hwnd=%p, bud=%p)\n", infoPtr->Self, bud);
|
||||||
|
|
||||||
ret = infoPtr->Buddy;
|
old_buddy = infoPtr->Buddy;
|
||||||
|
|
||||||
/* there is already a buddy assigned */
|
/* there is already a buddy assigned */
|
||||||
if (infoPtr->Buddy) RemoveWindowSubclass(infoPtr->Buddy, UPDOWN_Buddy_SubclassProc,
|
if (infoPtr->Buddy) RemoveWindowSubclass(infoPtr->Buddy, UPDOWN_Buddy_SubclassProc,
|
||||||
|
@ -648,7 +648,7 @@ static HWND UPDOWN_SetBuddy (UPDOWN_INFO* infoPtr, HWND bud)
|
||||||
x = budRect.right+DEFAULT_XSEP;
|
x = budRect.right+DEFAULT_XSEP;
|
||||||
} else {
|
} else {
|
||||||
/* nothing to do */
|
/* nothing to do */
|
||||||
return ret;
|
return old_buddy;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* first adjust the buddy to accommodate the up/down */
|
/* first adjust the buddy to accommodate the up/down */
|
||||||
|
@ -677,14 +677,15 @@ static HWND UPDOWN_SetBuddy (UPDOWN_INFO* infoPtr, HWND bud)
|
||||||
budRect.top - DEFAULT_ADDTOP, width,
|
budRect.top - DEFAULT_ADDTOP, width,
|
||||||
budRect.bottom - budRect.top + DEFAULT_ADDTOP + DEFAULT_ADDBOT,
|
budRect.bottom - budRect.top + DEFAULT_ADDTOP + DEFAULT_ADDBOT,
|
||||||
SWP_NOACTIVATE|SWP_FRAMECHANGED|SWP_NOZORDER);
|
SWP_NOACTIVATE|SWP_FRAMECHANGED|SWP_NOZORDER);
|
||||||
} else {
|
} else if (!(infoPtr->dwStyle & UDS_HORZ) && old_buddy != NULL) {
|
||||||
RECT rect;
|
RECT rect;
|
||||||
GetWindowRect(infoPtr->Self, &rect);
|
GetWindowRect(infoPtr->Self, &rect);
|
||||||
MapWindowPoints(HWND_DESKTOP, GetParent(infoPtr->Self), (POINT *)&rect, 2);
|
MapWindowPoints(HWND_DESKTOP, GetParent(infoPtr->Self), (POINT *)&rect, 2);
|
||||||
SetWindowPos(infoPtr->Self, 0, rect.left, rect.top, DEFAULT_WIDTH, rect.bottom - rect.top,
|
SetWindowPos(infoPtr->Self, 0, rect.left, rect.top, DEFAULT_WIDTH, rect.bottom - rect.top,
|
||||||
SWP_NOACTIVATE|SWP_FRAMECHANGED|SWP_NOZORDER);
|
SWP_NOACTIVATE|SWP_FRAMECHANGED|SWP_NOZORDER);
|
||||||
}
|
}
|
||||||
return ret;
|
|
||||||
|
return old_buddy;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
|
|
@ -54,7 +54,7 @@ reactos/dll/win32/browseui # Out of sync
|
||||||
reactos/dll/win32/cabinet # Synced to WineStaging-2.9
|
reactos/dll/win32/cabinet # Synced to WineStaging-2.9
|
||||||
reactos/dll/win32/clusapi # Synced to WineStaging-2.9
|
reactos/dll/win32/clusapi # Synced to WineStaging-2.9
|
||||||
reactos/dll/win32/comcat # Synced to WineStaging-2.9
|
reactos/dll/win32/comcat # Synced to WineStaging-2.9
|
||||||
reactos/dll/win32/comctl32 # Synced to WineStaging-2.16
|
reactos/dll/win32/comctl32 # Synced to Wine-3.0
|
||||||
reactos/dll/win32/comdlg32 # Synced to WineStaging-2.16
|
reactos/dll/win32/comdlg32 # Synced to WineStaging-2.16
|
||||||
reactos/dll/win32/compstui # Synced to WineStaging-2.9
|
reactos/dll/win32/compstui # Synced to WineStaging-2.9
|
||||||
reactos/dll/win32/credui # Synced to WineStaging-2.9
|
reactos/dll/win32/credui # Synced to WineStaging-2.9
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue