From 0ce209c8fc125f3ba846322c341b41c9c174b7b3 Mon Sep 17 00:00:00 2001 From: Francois Gouget Date: Sun, 24 Sep 2000 03:03:52 +0000 Subject: [PATCH] Added set WS_CHILD and CCS_TOP to the toolbar's style. TOOLBAR_CalcToolbar(): if the bitmap size is 0, use the builtin defaults. --- dlls/comctl32/commctrl.c | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/dlls/comctl32/commctrl.c b/dlls/comctl32/commctrl.c index 1c0fc2ef9e9..5e17ca50a79 100644 --- a/dlls/comctl32/commctrl.c +++ b/dlls/comctl32/commctrl.c @@ -657,8 +657,15 @@ CreateToolbarEx (HWND hwnd, DWORD style, UINT wID, INT nBitmaps, INT iNumButtons, INT dxButton, INT dyButton, INT dxBitmap, INT dyBitmap, UINT uStructSize) { - HWND hwndTB = - CreateWindowExA (0, TOOLBARCLASSNAMEA, "", style, 0, 0, 0, 0, + HWND hwndTB; + + /* If not position is specified then put it at the top */ + if ((style & CCS_BOTTOM) == 0) { + style|=CCS_TOP; + } + + hwndTB = + CreateWindowExA (0, TOOLBARCLASSNAMEA, "", style|WS_CHILD, 0, 0, 0, 0, hwnd, (HMENU)wID, 0, NULL); if(hwndTB) { TBADDBITMAP tbab; @@ -666,17 +673,21 @@ CreateToolbarEx (HWND hwnd, DWORD style, UINT wID, INT nBitmaps, SendMessageA (hwndTB, TB_BUTTONSTRUCTSIZE, (WPARAM)uStructSize, 0); - /* set bitmap and button size */ - /*If CreateToolbarEx receive 0, windows set default values*/ - if (dyBitmap < 0) - dyBitmap = 15; - if (dxBitmap < 0) - dxBitmap = 16; + /* set bitmap and button size */ + /*If CreateToolbarEx receives 0, windows sets default values*/ + if (dxBitmap <= 0) + dxBitmap = 16; + if (dyBitmap <= 0) + dyBitmap = 15; + SendMessageA (hwndTB, TB_SETBITMAPSIZE, 0, + MAKELPARAM((WORD)dxBitmap, (WORD)dyBitmap)); - SendMessageA (hwndTB, TB_SETBITMAPSIZE, 0, - MAKELPARAM((WORD)dxBitmap, (WORD)dyBitmap)); - SendMessageA (hwndTB, TB_SETBUTTONSIZE, 0, - MAKELPARAM((WORD)dxButton, (WORD)dyButton)); + if (dxButton <= 0) + dxButton = 24; + if (dyButton <= 0) + dyButton = 22; + SendMessageA (hwndTB, TB_SETBUTTONSIZE, 0, + MAKELPARAM((WORD)dxButton, (WORD)dyButton)); /* add bitmaps */