Commit 92b0ad98 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

comctl32/tab: Implement TCM_[G,S]ETEXTENDEDSTYLE and TCS_EX_FLATSEPARATORS style.

parent b896b920
...@@ -40,7 +40,6 @@ ...@@ -40,7 +40,6 @@
* TCIF_RTLREADING * TCIF_RTLREADING
* *
* Extended Styles: * Extended Styles:
* TCS_EX_FLATSEPARATORS
* TCS_EX_REGISTERDROP * TCS_EX_REGISTERDROP
* *
* States: * States:
...@@ -54,8 +53,6 @@ ...@@ -54,8 +53,6 @@
* *
* Messages: * Messages:
* TCM_DESELECTALL * TCM_DESELECTALL
* TCM_GETEXTENDEDSTYLE
* TCM_SETEXTENDEDSTYLE
* *
* Macros: * Macros:
* TabCtrl_AdjustRect * TabCtrl_AdjustRect
...@@ -126,6 +123,9 @@ typedef struct ...@@ -126,6 +123,9 @@ typedef struct
BOOL bUnicode; /* Unicode control? */ BOOL bUnicode; /* Unicode control? */
HWND hwndUpDown; /* Updown control used for scrolling */ HWND hwndUpDown; /* Updown control used for scrolling */
INT cbInfo; /* Number of bytes of caller supplied info per tab */ INT cbInfo; /* Number of bytes of caller supplied info per tab */
DWORD exStyle; /* Extended style used, currently:
TCS_EX_FLATSEPARATORS, TCS_EX_REGISTERDROP */
} TAB_INFO; } TAB_INFO;
/****************************************************************************** /******************************************************************************
...@@ -1947,7 +1947,7 @@ static void TAB_DrawItem(const TAB_INFO *infoPtr, HDC hdc, INT iItem) ...@@ -1947,7 +1947,7 @@ static void TAB_DrawItem(const TAB_INFO *infoPtr, HDC hdc, INT iItem)
r = itemRect; r = itemRect;
/* Separators between flat buttons */ /* Separators between flat buttons */
if (lStyle & TCS_FLATBUTTONS) if ((lStyle & TCS_FLATBUTTONS) && (infoPtr->exStyle & TCS_EX_FLATSEPARATORS))
{ {
r1 = r; r1 = r;
r1.right += (FLAT_BTN_SPACINGX -2); r1.right += (FLAT_BTN_SPACINGX -2);
...@@ -2978,6 +2978,8 @@ static LRESULT TAB_Create (HWND hwnd, LPARAM lParam) ...@@ -2978,6 +2978,8 @@ static LRESULT TAB_Create (HWND hwnd, LPARAM lParam)
dwStyle = GetWindowLongW(hwnd, GWL_STYLE); dwStyle = GetWindowLongW(hwnd, GWL_STYLE);
SetWindowLongW(hwnd, GWL_STYLE, dwStyle|WS_CLIPSIBLINGS); SetWindowLongW(hwnd, GWL_STYLE, dwStyle|WS_CLIPSIBLINGS);
infoPtr->exStyle = (dwStyle & TCS_FLATBUTTONS) ? TCS_EX_FLATSEPARATORS : 0;
if (dwStyle & TCS_TOOLTIPS) { if (dwStyle & TCS_TOOLTIPS) {
/* Create tooltip control */ /* Create tooltip control */
infoPtr->hwndToolTip = infoPtr->hwndToolTip =
...@@ -3129,6 +3131,39 @@ static LRESULT TAB_RemoveImage (TAB_INFO *infoPtr, INT image) ...@@ -3129,6 +3131,39 @@ static LRESULT TAB_RemoveImage (TAB_INFO *infoPtr, INT image)
return 0; return 0;
} }
static LRESULT
TAB_SetExtendedStyle (TAB_INFO *infoPtr, DWORD exMask, DWORD exStyle)
{
DWORD prevstyle = infoPtr->exStyle;
/* zero mask means all styles */
if (exMask == 0) exMask = ~0;
if (exMask & TCS_EX_REGISTERDROP)
{
FIXME("TCS_EX_REGISTERDROP style unimplemented\n");
exMask &= ~TCS_EX_REGISTERDROP;
exStyle &= ~TCS_EX_REGISTERDROP;
}
if (exMask & TCS_EX_FLATSEPARATORS)
{
if ((prevstyle ^ exStyle) & TCS_EX_FLATSEPARATORS)
{
infoPtr->exStyle ^= TCS_EX_FLATSEPARATORS;
TAB_InvalidateTabArea(infoPtr);
}
}
return prevstyle;
}
static inline LRESULT
TAB_GetExtendedStyle (TAB_INFO *infoPtr)
{
return infoPtr->exStyle;
}
static LRESULT WINAPI static LRESULT WINAPI
TAB_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) TAB_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{ {
...@@ -3226,12 +3261,10 @@ TAB_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) ...@@ -3226,12 +3261,10 @@ TAB_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return 0; return 0;
case TCM_GETEXTENDEDSTYLE: case TCM_GETEXTENDEDSTYLE:
FIXME("Unimplemented msg TCM_GETEXTENDEDSTYLE\n"); return TAB_GetExtendedStyle (infoPtr);
return 0;
case TCM_SETEXTENDEDSTYLE: case TCM_SETEXTENDEDSTYLE:
FIXME("Unimplemented msg TCM_SETEXTENDEDSTYLE\n"); return TAB_SetExtendedStyle (infoPtr, wParam, lParam);
return 0;
case WM_GETFONT: case WM_GETFONT:
return TAB_GetFont (infoPtr); return TAB_GetFont (infoPtr);
......
...@@ -768,12 +768,10 @@ static void test_getters_setters(HWND parent_wnd, INT nTabs) ...@@ -768,12 +768,10 @@ static void test_getters_setters(HWND parent_wnd, INT nTabs)
/* Testing Flat Separators */ /* Testing Flat Separators */
extendedStyle = SendMessage(hTab, TCM_GETEXTENDEDSTYLE, 0, 0); extendedStyle = SendMessage(hTab, TCM_GETEXTENDEDSTYLE, 0, 0);
prevExtendedStyle = SendMessage(hTab, TCM_SETEXTENDEDSTYLE, 0, TCS_EX_FLATSEPARATORS); prevExtendedStyle = SendMessage(hTab, TCM_SETEXTENDEDSTYLE, 0, TCS_EX_FLATSEPARATORS);
expect(extendedStyle, prevExtendedStyle); expect(extendedStyle, prevExtendedStyle);
extendedStyle = SendMessage(hTab, TCM_GETEXTENDEDSTYLE, 0, 0); extendedStyle = SendMessage(hTab, TCM_GETEXTENDEDSTYLE, 0, 0);
todo_wine{ expect(TCS_EX_FLATSEPARATORS, extendedStyle);
expect(TCS_EX_FLATSEPARATORS, extendedStyle);
}
/* Testing Register Drop */ /* Testing Register Drop */
prevExtendedStyle = SendMessage(hTab, TCM_SETEXTENDEDSTYLE, 0, TCS_EX_REGISTERDROP); prevExtendedStyle = SendMessage(hTab, TCM_SETEXTENDEDSTYLE, 0, TCS_EX_REGISTERDROP);
......
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