INT idCommand;
BYTE fsState;
BYTE fsStyle;
- BYTE bHot;
- BYTE bDropDownPressed;
+ BOOL bHot;
+ BOOL bDropDownPressed;
DWORD_PTR dwData;
INT_PTR iString;
INT nRow;
/* Used to find undocumented extended styles */
#define TBSTYLE_EX_ALL (TBSTYLE_EX_DRAWDDARROWS | \
- TBSTYLE_EX_UNDOC1 | \
+ TBSTYLE_EX_VERTICAL | \
TBSTYLE_EX_MIXEDBUTTONS | \
TBSTYLE_EX_DOUBLEBUFFER | \
TBSTYLE_EX_HIDECLIPPEDBUTTONS)
/* draws a blank frame for a toolbar button */
static void
-TOOLBAR_DrawFrame(const TOOLBAR_INFO *infoPtr, const NMTBCUSTOMDRAW *tbcd, DWORD dwItemCDFlag)
+TOOLBAR_DrawFrame(const TOOLBAR_INFO *infoPtr, const NMTBCUSTOMDRAW *tbcd, const RECT *rect, DWORD dwItemCDFlag)
{
HDC hdc = tbcd->nmcd.hdc;
- RECT rc = tbcd->nmcd.rc;
+ RECT rc = *rect;
/* if the state is disabled or indeterminate then the button
* cannot have an interactive look like pressed or hot */
BOOL non_interactive_state = (tbcd->nmcd.uItemState & CDIS_DISABLED) ||
/* empirical tests show that iBitmap can/will be non-zero */
/* when drawing the vertical bar... */
if ((dwStyle & TBSTYLE_FLAT) /* && (btnPtr->iBitmap == 0) */) {
- if (dwStyle & CCS_VERT)
- TOOLBAR_DrawFlatHorizontalSeparator (&rc, hdc, infoPtr);
+ if (dwStyle & CCS_VERT) {
+ RECT rcsep = rc;
+ InflateRect(&rcsep, -infoPtr->szPadding.cx, -infoPtr->szPadding.cy);
+ TOOLBAR_DrawFlatHorizontalSeparator (&rcsep, hdc, infoPtr);
+ }
else
TOOLBAR_DrawFlatSeparator (&rc, hdc, infoPtr);
}
tbcd.rcText.bottom = rcText.bottom - rc.top;
tbcd.nmcd.uItemState = TOOLBAR_TranslateState(btnPtr);
tbcd.nmcd.hdc = hdc;
- tbcd.nmcd.rc = rc;
+ tbcd.nmcd.rc = btnPtr->rect;
tbcd.hbrMonoDither = COMCTL32_hPattern55AABrush;
/* FIXME: what are these used for? */
ntfret = TOOLBAR_SendNotify(&tbcd.nmcd.hdr, infoPtr, NM_CUSTOMDRAW);
/* reset these fields so the user can't alter the behaviour like native */
tbcd.nmcd.hdc = hdc;
- tbcd.nmcd.rc = rc;
+ tbcd.nmcd.rc = btnPtr->rect;
dwItemCustDraw = ntfret & 0xffff;
dwItemCDFlag = ntfret & 0xffff0000;
|| (drawSepDropDownArrow && btnPtr->bDropDownPressed))
stateId = TS_HOT;
- DrawThemeBackground (theme, hdc, partId, stateId, &tbcd.nmcd.rc, NULL);
+ DrawThemeBackground (theme, hdc, partId, stateId, &rc, NULL);
}
else
- TOOLBAR_DrawFrame(infoPtr, &tbcd, dwItemCDFlag);
+ TOOLBAR_DrawFrame(infoPtr, &tbcd, &rc, dwItemCDFlag);
if (drawSepDropDownArrow)
{
* the toolbar wrapping on its own, it can use the TBSTYLE_WRAPABLE
* flag, and set the TBSTATE_WRAP flags manually on the appropriate items.
*
-* Note: TBSTYLE_WRAPABLE or TBSTYLE_EX_UNDOC1 can be used also to allow
+* Note: TBSTYLE_WRAPABLE or TBSTYLE_EX_VERTICAL can be used also to allow
* vertical toolbar lists.
*/
/* no layout is necessary. Applications may use this style */
/* to perform their own layout on the toolbar. */
if( !(infoPtr->dwStyle & TBSTYLE_WRAPABLE) &&
- !(infoPtr->dwExStyle & TBSTYLE_EX_UNDOC1) ) return;
+ !(infoPtr->dwExStyle & TBSTYLE_EX_VERTICAL) ) return;
btnPtr = infoPtr->buttons;
x = infoPtr->nIndent;
if (btnPtr->fsStyle & BTNS_SEP) {
if (infoPtr->dwStyle & CCS_VERT) {
cy = (btnPtr->iBitmap > 0) ? btnPtr->iBitmap : SEPARATOR_WIDTH;
- cx = (btnPtr->cx > 0) ? btnPtr->cx : infoPtr->nWidth;
+ cx = (btnPtr->cx > 0) ? btnPtr->cx : infoPtr->nButtonWidth;
}
else
cx = (btnPtr->cx > 0) ? btnPtr->cx :
cy = TOP_BORDER + infoPtr->nRows * infoPtr->nButtonHeight + BOTTOM_BORDER;
cx = parent_rect.right - parent_rect.left;
- if ((infoPtr->dwStyle & TBSTYLE_WRAPABLE) || (infoPtr->dwExStyle & TBSTYLE_EX_UNDOC1))
+ if ((infoPtr->dwStyle & TBSTYLE_WRAPABLE) || (infoPtr->dwExStyle & TBSTYLE_EX_VERTICAL))
{
TOOLBAR_LayoutToolbar(infoPtr);
InvalidateRect( infoPtr->hwndSelf, NULL, TRUE );
if (lpTbInfo == NULL)
return -1;
- /* MSDN documents a iImageLabel field added in Vista but it is not present in
+ /* MSDN documents an iImageLabel field added in Vista but it is not present in
* the headers and tests shows that even with comctl 6 Vista accepts only the
* original TBBUTTONINFO size
*/
{
/* separator */
nmtbr.tbButton.fsStyle = TBSTYLE_SEP;
- /* when inserting separators, iBitmap controls it's size.
+ /* when inserting separators, iBitmap controls its size.
0 sets default size (width) */
nmtbr.tbButton.iBitmap = 0;
}