Commit 9cfb9435 authored by Robert Shearman's avatar Robert Shearman Committed by Alexandre Julliard

Implement SetPathWordBreakProc and MirrorIcon.

parent 5d0c01c4
...@@ -130,8 +130,6 @@ static LRESULT WINAPI ...@@ -130,8 +130,6 @@ static LRESULT WINAPI
COMBOEX_EditWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam); COMBOEX_EditWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
static LRESULT WINAPI static LRESULT WINAPI
COMBOEX_ComboWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam); COMBOEX_ComboWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
static int CALLBACK
COMBOEX_PathWordBreakProc(LPWSTR lpch, int ichCurrent, int cch, int code);
static LRESULT COMBOEX_Destroy (COMBOEX_INFO *infoPtr); static LRESULT COMBOEX_Destroy (COMBOEX_INFO *infoPtr);
typedef INT (WINAPI *cmp_func_t)(LPCWSTR, LPCWSTR); typedef INT (WINAPI *cmp_func_t)(LPCWSTR, LPCWSTR);
...@@ -674,11 +672,9 @@ COMBOEX_SetExtendedStyle (COMBOEX_INFO *infoPtr, DWORD mask, DWORD style) ...@@ -674,11 +672,9 @@ COMBOEX_SetExtendedStyle (COMBOEX_INFO *infoPtr, DWORD mask, DWORD style)
infoPtr->dwExtStyle = style; infoPtr->dwExtStyle = style;
/* see if we need to change the word break proc on the edit */ /* see if we need to change the word break proc on the edit */
if ((infoPtr->dwExtStyle ^ dwTemp) & CBES_EX_PATHWORDBREAKPROC) { if ((infoPtr->dwExtStyle ^ dwTemp) & CBES_EX_PATHWORDBREAKPROC)
SendMessageW(infoPtr->hwndEdit, EM_SETWORDBREAKPROC, 0, SetPathWordBreakProc(infoPtr->hwndEdit,
(infoPtr->dwExtStyle & CBES_EX_PATHWORDBREAKPROC) ? (infoPtr->dwExtStyle & CBES_EX_PATHWORDBREAKPROC) ? TRUE : FALSE);
(LPARAM)COMBOEX_PathWordBreakProc : 0);
}
/* test if the control's appearance has changed */ /* test if the control's appearance has changed */
mask = CBES_EX_NOEDITIMAGE | CBES_EX_NOEDITIMAGEINDENT; mask = CBES_EX_NOEDITIMAGE | CBES_EX_NOEDITIMAGEINDENT;
...@@ -1650,30 +1646,6 @@ static LRESULT COMBOEX_WindowPosChanging (COMBOEX_INFO *infoPtr, WINDOWPOS *wp) ...@@ -1650,30 +1646,6 @@ static LRESULT COMBOEX_WindowPosChanging (COMBOEX_INFO *infoPtr, WINDOWPOS *wp)
return 0; return 0;
} }
static inline int is_delimiter(WCHAR c)
{
switch(c) {
case '/':
case '\\':
case '.':
return TRUE;
}
return FALSE;
}
static int CALLBACK
COMBOEX_PathWordBreakProc(LPWSTR lpch, int ichCurrent, int cch, int code)
{
if (code == WB_ISDELIMITER) {
return is_delimiter(lpch[ichCurrent]);
} else {
int dir = (code == WB_LEFT) ? -1 : 1;
for(; 0 <= ichCurrent && ichCurrent < cch; ichCurrent += dir)
if (is_delimiter(lpch[ichCurrent])) return ichCurrent;
}
return ichCurrent;
}
static LRESULT WINAPI static LRESULT WINAPI
COMBOEX_EditWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) COMBOEX_EditWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{ {
......
...@@ -188,4 +188,7 @@ BOOL WINAPI DPA_Merge (const HDPA, const HDPA, DWORD, PFNDPACOMPARE, PFNDPAMERGE ...@@ -188,4 +188,7 @@ BOOL WINAPI DPA_Merge (const HDPA, const HDPA, DWORD, PFNDPACOMPARE, PFNDPAMERGE
#define DPA_GetPtrCount(hdpa) (*(INT*)(hdpa)) #define DPA_GetPtrCount(hdpa) (*(INT*)(hdpa))
LRESULT WINAPI SetPathWordBreakProc(HWND hwnd, BOOL bSet);
BOOL WINAPI MirrorIcon(HICON *phicon1, HICON *phicon2);
#endif /* __WINE_COMCTL32_H */ #endif /* __WINE_COMCTL32_H */
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
377 stdcall -noname IntlStrEqWorkerW(long wstr wstr long) 377 stdcall -noname IntlStrEqWorkerW(long wstr wstr long)
382 stdcall -noname SmoothScrollWindow(ptr) 382 stdcall -noname SmoothScrollWindow(ptr)
383 stub -noname DoReaderMode 383 stub -noname DoReaderMode
384 stub -noname SetPathWordBreakProc 384 stdcall -noname SetPathWordBreakProc(ptr long)
385 stdcall -noname DPA_EnumCallback(long long long) 385 stdcall -noname DPA_EnumCallback(long long long)
386 stdcall -noname DPA_DestroyCallback(ptr ptr long) 386 stdcall -noname DPA_DestroyCallback(ptr ptr long)
387 stdcall -noname DSA_EnumCallback(ptr ptr long) 387 stdcall -noname DSA_EnumCallback(ptr ptr long)
...@@ -105,7 +105,7 @@ ...@@ -105,7 +105,7 @@
411 stdcall GetWindowSubclass(long ptr long ptr) 411 stdcall GetWindowSubclass(long ptr long ptr)
412 stdcall RemoveWindowSubclass(long ptr long) 412 stdcall RemoveWindowSubclass(long ptr long)
413 stdcall DefSubclassProc(long long long long) 413 stdcall DefSubclassProc(long long long long)
414 stub -noname MirrorIcon 414 stdcall -noname MirrorIcon(ptr ptr)
415 stdcall -noname DrawTextWrap(long wstr long ptr long) user32.DrawTextW 415 stdcall -noname DrawTextWrap(long wstr long ptr long) user32.DrawTextW
416 stdcall -noname DrawTextExPrivWrap(long wstr long ptr long ptr) user32.DrawTextExW 416 stdcall -noname DrawTextExPrivWrap(long wstr long ptr long ptr) user32.DrawTextExW
417 stdcall -noname ExtTextOutWrap(long long long long ptr wstr long ptr) gdi32.ExtTextOutW 417 stdcall -noname ExtTextOutWrap(long long long long ptr wstr long ptr) gdi32.ExtTextOutW
......
...@@ -1485,3 +1485,67 @@ void COMCTL32_DrawInsertMark(HDC hDC, const RECT *lpRect, COLORREF clrInsertMark ...@@ -1485,3 +1485,67 @@ void COMCTL32_DrawInsertMark(HDC hDC, const RECT *lpRect, COLORREF clrInsertMark
SelectObject(hDC, hOldPen); SelectObject(hDC, hOldPen);
DeleteObject(hPen); DeleteObject(hPen);
} }
/***********************************************************************
* MirrorIcon [COMCTL32.414]
*
* Mirrors an icon so that it will appear correctly on a mirrored DC.
*
* PARAMS
* phicon1 [I/O] Icon.
* phicon2 [I/O] Icon.
*
* RETURNS
* Success: TRUE.
* Failure: FALSE.
*/
BOOL WINAPI MirrorIcon(HICON *phicon1, HICON *phicon2)
{
FIXME("(%p, %p): stub\n", phicon1, phicon2);
return FALSE;
}
static inline int IsDelimiter(WCHAR c)
{
switch(c)
{
case '/':
case '\\':
case '.':
case ' ':
return TRUE;
}
return FALSE;
}
static int CALLBACK PathWordBreakProc(LPWSTR lpch, int ichCurrent, int cch, int code)
{
if (code == WB_ISDELIMITER)
return IsDelimiter(lpch[ichCurrent]);
else
{
int dir = (code == WB_LEFT) ? -1 : 1;
for(; 0 <= ichCurrent && ichCurrent < cch; ichCurrent += dir)
if (IsDelimiter(lpch[ichCurrent])) return ichCurrent;
}
return ichCurrent;
}
/***********************************************************************
* SetPathWordBreakProc [COMCTL32.384]
*
* Sets the word break procedure for an edit control to one that understands
* paths so that the user can jump over directories.
*
* PARAMS
* hwnd [I] Handle to edit control.
* bSet [I] If this is TRUE then the word break proc is set, otherwise it is removed.
*
* RETURNS
* Result from EM_SETWORDBREAKPROC message.
*/
LRESULT WINAPI SetPathWordBreakProc(HWND hwnd, BOOL bSet)
{
return SendMessageW(hwnd, EM_SETWORDBREAKPROC, 0,
(LPARAM)(bSet ? PathWordBreakProc : NULL));
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment