winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
November 2006
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
3 participants
792 discussions
Start a n
N
ew thread
Alexandre Julliard : ntdll: Maintain a file descriptor cache on the client side.
by Alexandre Julliard
02 Nov '06
02 Nov '06
Module: wine Branch: master Commit: 28418cc91900ae8e5497e69fac2392779b8f4bd5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=28418cc91900ae8e5497e69fa…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Nov 2 20:48:19 2006 +0100 ntdll: Maintain a file descriptor cache on the client side. --- dlls/ntdll/file.c | 2 +- dlls/ntdll/ntdll_misc.h | 1 + dlls/ntdll/om.c | 7 ++- dlls/ntdll/server.c | 119 +++++++++++++++++++++++++++++++++------- include/wine/server_protocol.h | 8 +- server/fd.c | 12 +--- server/handle.c | 6 +- server/protocol.def | 6 +- server/trace.c | 7 +- 9 files changed, 122 insertions(+), 46 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=28418cc91900ae8e5497e…
1
0
0
0
Mikołaj Zalewski : comctl32: toolbar: Add buttons size tests.
by Alexandre Julliard
02 Nov '06
02 Nov '06
Module: wine Branch: master Commit: 258008012cbd2aebf96da5d6f830069725c08b82 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=258008012cbd2aebf96da5d6f…
Author: Mikołaj Zalewski <mikolaj(a)zalewski.pl> Date: Wed Nov 1 23:07:05 2006 +0100 comctl32: toolbar: Add buttons size tests. --- dlls/comctl32/tests/toolbar.c | 324 +++++++++++++++++++++++++++++++++++++++++ 1 files changed, 324 insertions(+), 0 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=258008012cbd2aebf96da…
1
0
0
0
Mikołaj Zalewski : comctl32: toolbar: Use the width of the current button instead of nButtonWidth to position the icon .
by Alexandre Julliard
02 Nov '06
02 Nov '06
Module: wine Branch: master Commit: 0559afda80b79a0d948aa496a3b90d0bc5900628 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0559afda80b79a0d948aa496a…
Author: Mikołaj Zalewski <mikolaj(a)zalewski.pl> Date: Wed Nov 1 23:38:30 2006 +0100 comctl32: toolbar: Use the width of the current button instead of nButtonWidth to position the icon. --- dlls/comctl32/toolbar.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/comctl32/toolbar.c b/dlls/comctl32/toolbar.c index 42ec39e..8875ca0 100644 --- a/dlls/comctl32/toolbar.c +++ b/dlls/comctl32/toolbar.c @@ -896,7 +896,7 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_I rcBitmap.left += GetSystemMetrics(SM_CXEDGE) + infoPtr->iListGap / 2; } else - rcBitmap.left += (infoPtr->nButtonWidth - infoPtr->nBitmapWidth) / 2; + rcBitmap.left += ((rc.right - rc.left) - infoPtr->nBitmapWidth) / 2; rcBitmap.top += infoPtr->szPadding.cy / 2;
1
0
0
0
Mikołaj Zalewski : comctl32: toolbar: The SetButtonSize should not allow too small buttons.
by Alexandre Julliard
02 Nov '06
02 Nov '06
Module: wine Branch: master Commit: 420f7cb076dde39941ccd46ef3a6e12a5e6efb3a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=420f7cb076dde39941ccd46ef…
Author: Mikołaj Zalewski <mikolaj(a)zalewski.pl> Date: Wed Nov 1 23:04:05 2006 +0100 comctl32: toolbar: The SetButtonSize should not allow too small buttons. --- dlls/comctl32/toolbar.c | 13 +++++++++++-- 1 files changed, 11 insertions(+), 2 deletions(-) diff --git a/dlls/comctl32/toolbar.c b/dlls/comctl32/toolbar.c index dd63e1c..42ec39e 100644 --- a/dlls/comctl32/toolbar.c +++ b/dlls/comctl32/toolbar.c @@ -4646,8 +4646,17 @@ TOOLBAR_SetButtonSize (HWND hwnd, WPARAM * either size, the system changes it to the default of 24 wide and * 22 high. Demonstarted in ControlSpy Toolbar. GLA 3/02 */ - infoPtr->nButtonWidth = (cx) ? cx : 24; - infoPtr->nButtonHeight = (cy) ? cy : 22; + if (cx == 0) cx = 24; + if (cy == 0) cx = 22; + + cx = max(cx, infoPtr->szPadding.cx + infoPtr->nBitmapWidth); + cy = max(cy, infoPtr->szPadding.cy + infoPtr->nVBitmapHeight); + + infoPtr->nButtonWidth = cx; + infoPtr->nButtonHeight = cy; + + infoPtr->iTopMargin = default_top_margin(infoPtr); + TOOLBAR_LayoutToolbar(hwnd); return TRUE; }
1
0
0
0
Mikołaj Zalewski : comctl32: toolbar: The top margin should be computed and saved in CalcToolbar.
by Alexandre Julliard
02 Nov '06
02 Nov '06
Module: wine Branch: master Commit: 3bfcacc54c2c4705ec60813d4ed1f9d8f3e07aee URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3bfcacc54c2c4705ec60813d4…
Author: Mikołaj Zalewski <mikolaj(a)zalewski.pl> Date: Wed Nov 1 23:02:45 2006 +0100 comctl32: toolbar: The top margin should be computed and saved in CalcToolbar. --- dlls/comctl32/toolbar.c | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/dlls/comctl32/toolbar.c b/dlls/comctl32/toolbar.c index 99c329e..dd63e1c 100644 --- a/dlls/comctl32/toolbar.c +++ b/dlls/comctl32/toolbar.c @@ -141,6 +141,7 @@ typedef struct INT nOldHit; INT nHotItem; /* index of the "hot" item */ SIZE szPadding; /* padding values around button */ + INT iTopMargin; /* the top margin */ INT iListGap; /* default gap between text and image for toolbar with list style */ HFONT hDefaultFont; HFONT hFont; /* text font */ @@ -255,6 +256,10 @@ static void TOOLBAR_TooltipSetRect(TOOLB static LRESULT TOOLBAR_NotifyFormat(TOOLBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam); +inline static int default_top_margin(TOOLBAR_INFO *infoPtr) +{ + return (infoPtr->dwStyle & TBSTYLE_FLAT ? 0 : TOP_BORDER); +} static LPWSTR TOOLBAR_GetText(TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr) @@ -1628,6 +1633,7 @@ TOOLBAR_CalcToolbar (HWND hwnd) sizeButton = TOOLBAR_MeasureButton(infoPtr, sizeString, TRUE, validImageList); infoPtr->nButtonWidth = sizeButton.cx; infoPtr->nButtonHeight = sizeButton.cy; + infoPtr->iTopMargin = default_top_margin(infoPtr); if ( infoPtr->cxMin >= 0 && infoPtr->nButtonWidth < infoPtr->cxMin ) infoPtr->nButtonWidth = infoPtr->cxMin; @@ -1652,7 +1658,7 @@ TOOLBAR_LayoutToolbar(HWND hwnd) TOOLBAR_WrapToolbar(hwnd, infoPtr->dwStyle); x = infoPtr->nIndent; - y = (infoPtr->dwStyle & TBSTYLE_FLAT ? 0 : TOP_BORDER); + y = infoPtr->iTopMargin; cx = infoPtr->nButtonWidth; cy = infoPtr->nButtonHeight; @@ -5393,6 +5399,7 @@ TOOLBAR_Create (HWND hwnd, WPARAM wParam infoPtr->szPadding.cx = DEFPAD_CX; infoPtr->szPadding.cy = DEFPAD_CY; infoPtr->iListGap = DEFLISTGAP; + infoPtr->iTopMargin = default_top_margin(infoPtr); infoPtr->dwStyle = dwStyle; infoPtr->tbim.iButton = -1; GetClientRect(hwnd, &infoPtr->client_rect);
1
0
0
0
Mikołaj Zalewski : comctl32: toolbar: Add a LayoutToolbar that works like CalcToolbar but doesn' t overwrite the button sizes.
by Alexandre Julliard
02 Nov '06
02 Nov '06
Module: wine Branch: master Commit: a8a0a655153a9d835f2482ead564b72463ac1726 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a8a0a655153a9d835f2482ead…
Author: Mikołaj Zalewski <mikolaj(a)zalewski.pl> Date: Wed Nov 1 23:00:35 2006 +0100 comctl32: toolbar: Add a LayoutToolbar that works like CalcToolbar but doesn't overwrite the button sizes. --- dlls/comctl32/toolbar.c | 59 +++++++++++++++++++++++++++++++--------------- 1 files changed, 40 insertions(+), 19 deletions(-) diff --git a/dlls/comctl32/toolbar.c b/dlls/comctl32/toolbar.c index 22ba6c9..99c329e 100644 --- a/dlls/comctl32/toolbar.c +++ b/dlls/comctl32/toolbar.c @@ -247,6 +247,7 @@ static VOID TOOLBAR_DeleteImageList(PIML static HIMAGELIST TOOLBAR_InsertImageList(PIMLENTRY **pies, INT *cies, HIMAGELIST himl, INT id); static LRESULT TOOLBAR_LButtonDown(HWND hwnd, WPARAM wParam, LPARAM lParam); static void TOOLBAR_SetHotItemEx (TOOLBAR_INFO *infoPtr, INT nHit, DWORD dwReason); +static void TOOLBAR_LayoutToolbar(HWND hwnd); static LRESULT TOOLBAR_AutoSize(HWND hwnd); static void TOOLBAR_CheckImageListIconSize(TOOLBAR_INFO *infoPtr); static void TOOLBAR_TooltipSetRect(TOOLBAR_INFO *infoPtr, TBUTTON_INFO *button); @@ -1615,14 +1616,8 @@ static void TOOLBAR_CalcToolbar (HWND hwnd) { TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(hwnd); - DWORD dwStyle = infoPtr->dwStyle; - TBUTTON_INFO *btnPtr; - INT i, nRows, nSepRows; - INT x, y, cx, cy; SIZE sizeString, sizeButton; - BOOL bWrap; BOOL validImageList = FALSE; - BOOL hasDropDownArrows = TOOLBAR_HasDropDownArrows(infoPtr->dwExStyle); TOOLBAR_CalcStrings (hwnd, &sizeString); @@ -1639,15 +1634,25 @@ TOOLBAR_CalcToolbar (HWND hwnd) if ( infoPtr->cxMax > 0 && infoPtr->nButtonWidth > infoPtr->cxMax ) infoPtr->nButtonWidth = infoPtr->cxMax; - TOOLBAR_WrapToolbar( hwnd, dwStyle ); + TOOLBAR_LayoutToolbar(hwnd); +} - x = infoPtr->nIndent; - if (infoPtr->dwStyle & TBSTYLE_FLAT) - y = 0; - else - y = TOP_BORDER; +static void +TOOLBAR_LayoutToolbar(HWND hwnd) +{ + TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(hwnd); + TBUTTON_INFO *btnPtr; + SIZE sizeButton; + INT i, nRows, nSepRows; + INT x, y, cx, cy; + BOOL bWrap; + BOOL validImageList = TOOLBAR_IsValidImageList(infoPtr, 0); + BOOL hasDropDownArrows = TOOLBAR_HasDropDownArrows(infoPtr->dwExStyle); + + TOOLBAR_WrapToolbar(hwnd, infoPtr->dwStyle); - /* from above, minimum is a button, and possible text */ + x = infoPtr->nIndent; + y = (infoPtr->dwStyle & TBSTYLE_FLAT ? 0 : TOP_BORDER); cx = infoPtr->nButtonWidth; cy = infoPtr->nButtonHeight; @@ -2867,6 +2872,7 @@ TOOLBAR_AddButtonsT(HWND hwnd, WPARAM wP TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd); LPTBBUTTON lpTbb = (LPTBBUTTON)lParam; INT nOldButtons, nNewButtons, nAddButtons, nCount; + BOOL fHasString = FALSE; TRACE("adding %d buttons (unicode=%d)!\n", wParam, fUnicode); @@ -2892,6 +2898,7 @@ TOOLBAR_AddButtonsT(HWND hwnd, WPARAM wP Str_SetPtrW ((LPWSTR*)&btnPtr->iString, (LPWSTR)lpTbb[nCount].iString ); else Str_SetPtrAtoW((LPWSTR*)&btnPtr->iString, (LPSTR)lpTbb[nCount].iString); + fHasString = TRUE; } else btnPtr->iString = lpTbb[nCount].iString; @@ -2899,7 +2906,10 @@ TOOLBAR_AddButtonsT(HWND hwnd, WPARAM wP TOOLBAR_TooltipAddTool(infoPtr, btnPtr); } - TOOLBAR_CalcToolbar (hwnd); + if (infoPtr->nNumStrings > 0 || fHasString) + TOOLBAR_CalcToolbar(hwnd); + else + TOOLBAR_LayoutToolbar(hwnd); TOOLBAR_AutoSize (hwnd); TOOLBAR_DumpToolbar (infoPtr, __LINE__); @@ -2915,6 +2925,7 @@ TOOLBAR_AddStringW (HWND hwnd, WPARAM wP { #define MAX_RESOURCE_STRING_LENGTH 512 TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd); + BOOL fFirstString = (infoPtr->nNumStrings == 0); INT nIndex = infoPtr->nNumStrings; if ((wParam) && (HIWORD(lParam) == 0)) { @@ -2971,6 +2982,8 @@ #define MAX_RESOURCE_STRING_LENGTH 512 } } + if (fFirstString) + TOOLBAR_CalcToolbar(hwnd); return nIndex; } @@ -2979,6 +2992,7 @@ static LRESULT TOOLBAR_AddStringA (HWND hwnd, WPARAM wParam, LPARAM lParam) { TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd); + BOOL fFirstString = (infoPtr->nNumStrings == 0); LPSTR p; INT nIndex; INT len; @@ -3003,6 +3017,8 @@ TOOLBAR_AddStringA (HWND hwnd, WPARAM wP p += (len+1); } + if (fFirstString) + TOOLBAR_CalcToolbar(hwnd); return nIndex; } @@ -3035,7 +3051,7 @@ TOOLBAR_AutoSize (HWND hwnd) if ((infoPtr->dwStyle & TBSTYLE_WRAPABLE) || (infoPtr->dwExStyle & TBSTYLE_EX_UNDOC1)) { - TOOLBAR_CalcToolbar(hwnd); + TOOLBAR_LayoutToolbar(hwnd); InvalidateRect( hwnd, NULL, TRUE ); } @@ -3261,7 +3277,7 @@ TOOLBAR_DeleteButton (HWND hwnd, WPARAM Free (oldButtons); } - TOOLBAR_CalcToolbar (hwnd); + TOOLBAR_LayoutToolbar(hwnd); InvalidateRect (hwnd, NULL, TRUE); @@ -3864,7 +3880,10 @@ TOOLBAR_InsertButtonT(HWND hwnd, WPARAM TOOLBAR_TooltipAddTool(infoPtr, &infoPtr->buttons[nIndex]); - TOOLBAR_CalcToolbar (hwnd); + if (infoPtr->nNumStrings > 0) + TOOLBAR_CalcToolbar(hwnd); + else + TOOLBAR_LayoutToolbar(hwnd); TOOLBAR_AutoSize (hwnd); InvalidateRect (hwnd, NULL, TRUE); @@ -4483,6 +4502,7 @@ TOOLBAR_SetBitmapSize (HWND hwnd, WPARAM infoPtr->nBitmapHeight); } + TOOLBAR_CalcToolbar(hwnd); InvalidateRect(infoPtr->hwndSelf, NULL, FALSE); return TRUE; } @@ -5387,8 +5407,6 @@ TOOLBAR_Create (HWND hwnd, WPARAM wParam TOOLBAR_CheckStyle (hwnd, dwStyle); - TOOLBAR_CalcToolbar(hwnd); - return 0; } @@ -6589,6 +6607,9 @@ TOOLBAR_StyleChanged (HWND hwnd, INT nTy infoPtr->dwStyle = lpStyle->styleNew; + if ((dwOldStyle ^ lpStyle->styleNew) & (TBSTYLE_WRAPABLE | CCS_VERT)) + TOOLBAR_LayoutToolbar(hwnd); + /* only resize if one of the CCS_* styles was changed */ if ((dwOldStyle ^ lpStyle->styleNew) & COMMON_STYLES) {
1
0
0
0
Mikołaj Zalewski : comctl32: toolbar: Fix buttons heights.
by Alexandre Julliard
02 Nov '06
02 Nov '06
Module: wine Branch: master Commit: f7f1479a082dc1d1d363529649a8bdc5d33fe57d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f7f1479a082dc1d1d36352964…
Author: Mikołaj Zalewski <mikolaj(a)zalewski.pl> Date: Wed Nov 1 22:57:31 2006 +0100 comctl32: toolbar: Fix buttons heights. --- dlls/comctl32/toolbar.c | 19 +++++++++++++------ 1 files changed, 13 insertions(+), 6 deletions(-) diff --git a/dlls/comctl32/toolbar.c b/dlls/comctl32/toolbar.c index 2024314..22ba6c9 100644 --- a/dlls/comctl32/toolbar.c +++ b/dlls/comctl32/toolbar.c @@ -125,6 +125,7 @@ typedef struct INT nButtonHeight; INT nButtonWidth; INT nBitmapHeight; + INT nVBitmapHeight; /* see TOOLBAR_Create for an explanation */ INT nBitmapWidth; INT nIndent; INT nRows; /* number of button rows */ @@ -1553,7 +1554,7 @@ static inline SIZE TOOLBAR_MeasureButton if (infoPtr->dwStyle & TBSTYLE_LIST) { /* set button height from bitmap / text height... */ - sizeButton.cy = max((bHasBitmap ? infoPtr->nBitmapHeight : 0), + sizeButton.cy = max((bHasBitmap ? infoPtr->nVBitmapHeight : 0), sizeString.cy); /* ... add on the necessary padding */ @@ -1582,8 +1583,9 @@ static inline SIZE TOOLBAR_MeasureButton { if (bHasBitmap) { - sizeButton.cy = infoPtr->nBitmapHeight + 1 + - sizeString.cy + DEFPAD_CY; + sizeButton.cy = infoPtr->nVBitmapHeight + DEFPAD_CY; + if (sizeString.cy > 0) + sizeButton.cy += 1 + sizeString.cy; sizeButton.cx = infoPtr->szPadding.cx + max(sizeString.cx, infoPtr->nBitmapWidth); } @@ -4472,8 +4474,7 @@ TOOLBAR_SetBitmapSize (HWND hwnd, WPARAM LOWORD(lParam), HIWORD(lParam)); infoPtr->nBitmapWidth = (INT)LOWORD(lParam); - infoPtr->nBitmapHeight = (INT)HIWORD(lParam); - + infoPtr->nVBitmapHeight = infoPtr->nBitmapHeight = (INT)HIWORD(lParam); if ((himlDef == infoPtr->himlInt) && (ImageList_GetImageCount(infoPtr->himlInt) == 0)) @@ -4873,6 +4874,7 @@ TOOLBAR_SetImageList (HWND hwnd, WPARAM infoPtr->nBitmapWidth = 1; infoPtr->nBitmapHeight = 1; } + infoPtr->nVBitmapHeight = infoPtr->nBitmapHeight; TRACE("hwnd %p, new himl=%p, id = %d, count=%d, bitmap w=%d, h=%d\n", hwnd, infoPtr->himlDef, id, infoPtr->nNumBitmaps, @@ -5338,10 +5340,15 @@ TOOLBAR_Create (HWND hwnd, WPARAM wParam TRACE("hwnd = %p\n", hwnd); /* initialize info structure */ + infoPtr->nButtonWidth = 23; infoPtr->nButtonHeight = 22; - infoPtr->nButtonWidth = 24; infoPtr->nBitmapHeight = 15; infoPtr->nBitmapWidth = 16; + /* By default Windows creates an image list with 16x15 icons but computes the button size as + * if the icons were 16x16. That's why we keep infoPtr->nVBitmapHeight. After a call to + * TB_SETBITMAPSIZE or TB_SETIMAGELIST the nVBitmapHeight = nBitmapHeight. + */ + infoPtr->nVBitmapHeight = 16; infoPtr->nMaxTextRows = 1; infoPtr->cxMin = -1;
1
0
0
0
Mikołaj Zalewski : comctl32: toolbar: The string should be included in the height of a button-less toolbar only if there is a string in the pool .
by Alexandre Julliard
02 Nov '06
02 Nov '06
Module: wine Branch: master Commit: 9ec280c25846357d2355ef107f958e3127bf2faf URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9ec280c25846357d2355ef107…
Author: Mikołaj Zalewski <mikolaj(a)zalewski.pl> Date: Wed Nov 1 22:47:20 2006 +0100 comctl32: toolbar: The string should be included in the height of a button-less toolbar only if there is a string in the pool. --- dlls/comctl32/toolbar.c | 9 +++------ 1 files changed, 3 insertions(+), 6 deletions(-) diff --git a/dlls/comctl32/toolbar.c b/dlls/comctl32/toolbar.c index 1a6f603..2024314 100644 --- a/dlls/comctl32/toolbar.c +++ b/dlls/comctl32/toolbar.c @@ -1226,7 +1226,7 @@ TOOLBAR_CalcStrings (HWND hwnd, LPSIZE l hdc = GetDC (hwnd); hOldFont = SelectObject (hdc, infoPtr->hFont); - if (infoPtr->nNumButtons == 0) + if (infoPtr->nNumButtons == 0 && infoPtr->nNumStrings > 0) { TEXTMETRICW tm; @@ -3460,11 +3460,8 @@ TOOLBAR_GetButtonSize (HWND hwnd) { TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd); - if (infoPtr->nNumButtons > 0) - return MAKELONG((WORD)infoPtr->nButtonWidth, - (WORD)infoPtr->nButtonHeight); - else - return MAKELONG(23,22); + return MAKELONG((WORD)infoPtr->nButtonWidth, + (WORD)infoPtr->nButtonHeight); }
1
0
0
0
Mikołaj Zalewski : comctl32: toolbar: Add support for WM_SETFONT.
by Alexandre Julliard
02 Nov '06
02 Nov '06
Module: wine Branch: master Commit: d57a61f831c964438090cbdbc3ee6bfc5fe01d1c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d57a61f831c964438090cbdbc…
Author: Mikołaj Zalewski <mikolaj(a)zalewski.pl> Date: Wed Nov 1 22:41:50 2006 +0100 comctl32: toolbar: Add support for WM_SETFONT. --- dlls/comctl32/toolbar.c | 24 ++++++++++++++++++++++-- 1 files changed, 22 insertions(+), 2 deletions(-) diff --git a/dlls/comctl32/toolbar.c b/dlls/comctl32/toolbar.c index 9b96f90..1a6f603 100644 --- a/dlls/comctl32/toolbar.c +++ b/dlls/comctl32/toolbar.c @@ -5425,8 +5425,7 @@ TOOLBAR_Destroy (HWND hwnd, WPARAM wPara TOOLBAR_DeleteImageList(&infoPtr->himlHot, &infoPtr->cimlHot); /* delete default font */ - if (infoPtr->hFont) - DeleteObject (infoPtr->hDefaultFont); + DeleteObject (infoPtr->hDefaultFont); CloseThemeData (GetWindowTheme (hwnd)); @@ -6466,6 +6465,24 @@ TOOLBAR_SetFocus (HWND hwnd, WPARAM wPar return 0; } +static LRESULT +TOOLBAR_SetFont(HWND hwnd, WPARAM wParam, LPARAM lParam) +{ + TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(hwnd); + + TRACE("font=%p redraw=%ld\n", (HFONT)wParam, lParam); + + if (wParam == 0) + infoPtr->hFont = infoPtr->hDefaultFont; + else + infoPtr->hFont = (HFONT)wParam; + + TOOLBAR_CalcToolbar(hwnd); + + if (lParam) + InvalidateRect(hwnd, NULL, TRUE); + return 1; +} static LRESULT TOOLBAR_SetRedraw (HWND hwnd, WPARAM wParam, LPARAM lParam) @@ -6976,6 +6993,9 @@ ToolbarWindowProc (HWND hwnd, UINT uMsg, case WM_SETFOCUS: return TOOLBAR_SetFocus (hwnd, wParam); + case WM_SETFONT: + return TOOLBAR_SetFont(hwnd, wParam, lParam); + case WM_SETREDRAW: return TOOLBAR_SetRedraw (hwnd, wParam, lParam);
1
0
0
0
Paul Vriens : comctl32: Move documented functions to string.c.
by Alexandre Julliard
02 Nov '06
02 Nov '06
Module: wine Branch: master Commit: d44b0dba6fa95ff236473f8004c18956d630e99b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d44b0dba6fa95ff236473f800…
Author: Paul Vriens <paul.vriens.wine(a)gmail.com> Date: Thu Nov 2 10:25:01 2006 +0100 comctl32: Move documented functions to string.c. --- dlls/comctl32/comctl32undoc.c | 142 ----------------------------------------- dlls/comctl32/string.c | 139 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 139 insertions(+), 142 deletions(-) diff --git a/dlls/comctl32/comctl32undoc.c b/dlls/comctl32/comctl32undoc.c index ad70a0b..b8c8ef8 100644 --- a/dlls/comctl32/comctl32undoc.c +++ b/dlls/comctl32/comctl32undoc.c @@ -883,148 +883,6 @@ INT WINAPI EnumMRUListA (HANDLE hList, I return datasize; } - -/************************************************************************** - * Str_GetPtrA [COMCTL32.233] - * - * Copies a string into a destination buffer. - * - * PARAMS - * lpSrc [I] Source string - * lpDest [O] Destination buffer - * nMaxLen [I] Size of buffer in characters - * - * RETURNS - * The number of characters copied. - */ -INT WINAPI Str_GetPtrA (LPCSTR lpSrc, LPSTR lpDest, INT nMaxLen) -{ - INT len; - - TRACE("(%p %p %d)\n", lpSrc, lpDest, nMaxLen); - - if (!lpDest && lpSrc) - return strlen (lpSrc); - - if (nMaxLen == 0) - return 0; - - if (lpSrc == NULL) { - lpDest[0] = '\0'; - return 0; - } - - len = strlen (lpSrc); - if (len >= nMaxLen) - len = nMaxLen - 1; - - RtlMoveMemory (lpDest, lpSrc, len); - lpDest[len] = '\0'; - - return len; -} - - -/************************************************************************** - * Str_SetPtrA [COMCTL32.234] - * - * Makes a copy of a string, allocating memory if necessary. - * - * PARAMS - * lppDest [O] Pointer to destination string - * lpSrc [I] Source string - * - * RETURNS - * Success: TRUE - * Failure: FALSE - * - * NOTES - * Set lpSrc to NULL to free the memory allocated by a previous call - * to this function. - */ -BOOL WINAPI Str_SetPtrA (LPSTR *lppDest, LPCSTR lpSrc) -{ - TRACE("(%p %p)\n", lppDest, lpSrc); - - if (lpSrc) { - LPSTR ptr = ReAlloc (*lppDest, strlen (lpSrc) + 1); - if (!ptr) - return FALSE; - strcpy (ptr, lpSrc); - *lppDest = ptr; - } - else { - if (*lppDest) { - Free (*lppDest); - *lppDest = NULL; - } - } - - return TRUE; -} - - -/************************************************************************** - * Str_GetPtrW [COMCTL32.235] - * - * See Str_GetPtrA. - */ -INT WINAPI Str_GetPtrW (LPCWSTR lpSrc, LPWSTR lpDest, INT nMaxLen) -{ - INT len; - - TRACE("(%p %p %d)\n", lpSrc, lpDest, nMaxLen); - - if (!lpDest && lpSrc) - return strlenW (lpSrc); - - if (nMaxLen == 0) - return 0; - - if (lpSrc == NULL) { - lpDest[0] = L'\0'; - return 0; - } - - len = strlenW (lpSrc); - if (len >= nMaxLen) - len = nMaxLen - 1; - - RtlMoveMemory (lpDest, lpSrc, len*sizeof(WCHAR)); - lpDest[len] = L'\0'; - - return len; -} - - -/************************************************************************** - * Str_SetPtrW [COMCTL32.236] - * - * See Str_SetPtrA. - */ -BOOL WINAPI Str_SetPtrW (LPWSTR *lppDest, LPCWSTR lpSrc) -{ - TRACE("(%p %p)\n", lppDest, lpSrc); - - if (lpSrc) { - INT len = strlenW (lpSrc) + 1; - LPWSTR ptr = ReAlloc (*lppDest, len * sizeof(WCHAR)); - if (!ptr) - return FALSE; - strcpyW (ptr, lpSrc); - *lppDest = ptr; - } - else { - if (*lppDest) { - Free (*lppDest); - *lppDest = NULL; - } - } - - return TRUE; -} - - /************************************************************************** * Str_GetPtrWtoA [internal] * diff --git a/dlls/comctl32/string.c b/dlls/comctl32/string.c index 82bfa5e..e083ea6 100644 --- a/dlls/comctl32/string.c +++ b/dlls/comctl32/string.c @@ -34,6 +34,8 @@ #include "winbase.h" #include "winuser.h" #include "winnls.h" +#include "comctl32.h" + #include "wine/unicode.h" #include "wine/debug.h" @@ -145,6 +147,143 @@ static BOOL COMCTL32_ChrCmpIW(WCHAR ch1, } /************************************************************************** + * Str_GetPtrA [COMCTL32.233] + * + * Copies a string into a destination buffer. + * + * PARAMS + * lpSrc [I] Source string + * lpDest [O] Destination buffer + * nMaxLen [I] Size of buffer in characters + * + * RETURNS + * The number of characters copied. + */ +INT WINAPI Str_GetPtrA (LPCSTR lpSrc, LPSTR lpDest, INT nMaxLen) +{ + INT len; + + TRACE("(%p %p %d)\n", lpSrc, lpDest, nMaxLen); + + if (!lpDest && lpSrc) + return strlen (lpSrc); + + if (nMaxLen == 0) + return 0; + + if (lpSrc == NULL) { + lpDest[0] = '\0'; + return 0; + } + + len = strlen (lpSrc); + if (len >= nMaxLen) + len = nMaxLen - 1; + + RtlMoveMemory (lpDest, lpSrc, len); + lpDest[len] = '\0'; + + return len; +} + +/************************************************************************** + * Str_SetPtrA [COMCTL32.234] + * + * Makes a copy of a string, allocating memory if necessary. + * + * PARAMS + * lppDest [O] Pointer to destination string + * lpSrc [I] Source string + * + * RETURNS + * Success: TRUE + * Failure: FALSE + * + * NOTES + * Set lpSrc to NULL to free the memory allocated by a previous call + * to this function. + */ +BOOL WINAPI Str_SetPtrA (LPSTR *lppDest, LPCSTR lpSrc) +{ + TRACE("(%p %p)\n", lppDest, lpSrc); + + if (lpSrc) { + LPSTR ptr = ReAlloc (*lppDest, strlen (lpSrc) + 1); + if (!ptr) + return FALSE; + strcpy (ptr, lpSrc); + *lppDest = ptr; + } + else { + if (*lppDest) { + Free (*lppDest); + *lppDest = NULL; + } + } + + return TRUE; +} + +/************************************************************************** + * Str_GetPtrW [COMCTL32.235] + * + * See Str_GetPtrA. + */ +INT WINAPI Str_GetPtrW (LPCWSTR lpSrc, LPWSTR lpDest, INT nMaxLen) +{ + INT len; + + TRACE("(%p %p %d)\n", lpSrc, lpDest, nMaxLen); + + if (!lpDest && lpSrc) + return strlenW (lpSrc); + + if (nMaxLen == 0) + return 0; + + if (lpSrc == NULL) { + lpDest[0] = L'\0'; + return 0; + } + + len = strlenW (lpSrc); + if (len >= nMaxLen) + len = nMaxLen - 1; + + RtlMoveMemory (lpDest, lpSrc, len*sizeof(WCHAR)); + lpDest[len] = L'\0'; + + return len; +} + +/************************************************************************** + * Str_SetPtrW [COMCTL32.236] + * + * See Str_SetPtrA. + */ +BOOL WINAPI Str_SetPtrW (LPWSTR *lppDest, LPCWSTR lpSrc) +{ + TRACE("(%p %p)\n", lppDest, lpSrc); + + if (lpSrc) { + INT len = strlenW (lpSrc) + 1; + LPWSTR ptr = ReAlloc (*lppDest, len * sizeof(WCHAR)); + if (!ptr) + return FALSE; + strcpyW (ptr, lpSrc); + *lppDest = ptr; + } + else { + if (*lppDest) { + Free (*lppDest); + *lppDest = NULL; + } + } + + return TRUE; +} + +/************************************************************************** * StrChrA [COMCTL32.350] * * Find a given character in a string.
1
0
0
0
← Newer
1
...
74
75
76
77
78
79
80
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
Results per page:
10
25
50
100
200