Added set WS_CHILD and CCS_TOP to the toolbar's style.

TOOLBAR_CalcToolbar(): if the bitmap size is 0, use the builtin
defaults.
This commit is contained in:
Francois Gouget 2000-09-24 03:03:52 +00:00 committed by Alexandre Julliard
parent 17acdf26af
commit 0ce209c8fc
1 changed files with 23 additions and 12 deletions

View File

@ -657,8 +657,15 @@ CreateToolbarEx (HWND hwnd, DWORD style, UINT wID, INT nBitmaps,
INT iNumButtons, INT dxButton, INT dyButton, INT iNumButtons, INT dxButton, INT dyButton,
INT dxBitmap, INT dyBitmap, UINT uStructSize) INT dxBitmap, INT dyBitmap, UINT uStructSize)
{ {
HWND hwndTB = HWND hwndTB;
CreateWindowExA (0, TOOLBARCLASSNAMEA, "", style, 0, 0, 0, 0,
/* 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); hwnd, (HMENU)wID, 0, NULL);
if(hwndTB) { if(hwndTB) {
TBADDBITMAP tbab; TBADDBITMAP tbab;
@ -666,17 +673,21 @@ CreateToolbarEx (HWND hwnd, DWORD style, UINT wID, INT nBitmaps,
SendMessageA (hwndTB, TB_BUTTONSTRUCTSIZE, SendMessageA (hwndTB, TB_BUTTONSTRUCTSIZE,
(WPARAM)uStructSize, 0); (WPARAM)uStructSize, 0);
/* set bitmap and button size */ /* set bitmap and button size */
/*If CreateToolbarEx receive 0, windows set default values*/ /*If CreateToolbarEx receives 0, windows sets default values*/
if (dyBitmap < 0) if (dxBitmap <= 0)
dyBitmap = 15; dxBitmap = 16;
if (dxBitmap < 0) if (dyBitmap <= 0)
dxBitmap = 16; dyBitmap = 15;
SendMessageA (hwndTB, TB_SETBITMAPSIZE, 0,
MAKELPARAM((WORD)dxBitmap, (WORD)dyBitmap));
SendMessageA (hwndTB, TB_SETBITMAPSIZE, 0, if (dxButton <= 0)
MAKELPARAM((WORD)dxBitmap, (WORD)dyBitmap)); dxButton = 24;
SendMessageA (hwndTB, TB_SETBUTTONSIZE, 0, if (dyButton <= 0)
MAKELPARAM((WORD)dxButton, (WORD)dyButton)); dyButton = 22;
SendMessageA (hwndTB, TB_SETBUTTONSIZE, 0,
MAKELPARAM((WORD)dxButton, (WORD)dyButton));
/* add bitmaps */ /* add bitmaps */