comctl32: toolbar: Use different function for dumping of TBUTTON_INFO and TBBUTTON.

This commit is contained in:
Mikołaj Zalewski 2009-02-01 13:02:26 +01:00 committed by Alexandre Julliard
parent ca9f7d3140
commit ada088e62d
1 changed files with 16 additions and 9 deletions

View File

@ -277,17 +277,23 @@ TOOLBAR_GetText(const TOOLBAR_INFO *infoPtr, const TBUTTON_INFO *btnPtr)
} }
static void static void
TOOLBAR_DumpButton(const TOOLBAR_INFO *infoPtr, const TBUTTON_INFO *bP, INT btn_num, BOOL internal) TOOLBAR_DumpTBButton(const TBBUTTON *tbb, BOOL fUnicode)
{
TRACE("TBBUTTON: id %d, bitmap=%d, state=%02x, style=%02x, data=%08lx, stringid=0x%08lx (%s)\n",
tbb->idCommand,tbb->iBitmap, tbb->fsState, tbb->fsStyle, tbb->dwData, tbb->iString,
(fUnicode ? wine_dbgstr_w((LPWSTR)tbb->iString) : wine_dbgstr_a((LPSTR)tbb->iString)));
}
static void
TOOLBAR_DumpButton(const TOOLBAR_INFO *infoPtr, const TBUTTON_INFO *bP, INT btn_num)
{ {
if (TRACE_ON(toolbar)){ if (TRACE_ON(toolbar)){
TRACE("button %d id %d, bitmap=%d, state=%02x, style=%02x, data=%08lx, stringid=0x%08lx\n", TRACE("button %d id %d, bitmap=%d, state=%02x, style=%02x, data=%08lx, stringid=0x%08lx\n",
btn_num, bP->idCommand, GETIBITMAP(infoPtr, bP->iBitmap), btn_num, bP->idCommand, GETIBITMAP(infoPtr, bP->iBitmap),
bP->fsState, bP->fsStyle, bP->dwData, bP->iString); bP->fsState, bP->fsStyle, bP->dwData, bP->iString);
TRACE("string %s\n", debugstr_w(TOOLBAR_GetText(infoPtr,bP))); TRACE("string %s\n", debugstr_w(TOOLBAR_GetText(infoPtr,bP)));
if (internal)
TRACE("button %d id %d, hot=%s, row=%d, rect=(%s)\n", TRACE("button %d id %d, hot=%s, row=%d, rect=(%s)\n",
btn_num, bP->idCommand, btn_num, bP->idCommand, (bP->bHot) ? "TRUE":"FALSE", bP->nRow,
(bP->bHot) ? "TRUE":"FALSE", bP->nRow,
wine_dbgstr_rect(&bP->rect)); wine_dbgstr_rect(&bP->rect));
} }
} }
@ -308,7 +314,7 @@ TOOLBAR_DumpToolbar(const TOOLBAR_INFO *iP, INT line)
iP->himlInt, iP->himlDef, iP->himlHot, iP->himlDis, iP->himlInt, iP->himlDef, iP->himlHot, iP->himlDis,
(iP->bDoRedraw) ? "TRUE" : "FALSE"); (iP->bDoRedraw) ? "TRUE" : "FALSE");
for(i=0; i<iP->nNumButtons; i++) { for(i=0; i<iP->nNumButtons; i++) {
TOOLBAR_DumpButton(iP, &iP->buttons[i], i, TRUE); TOOLBAR_DumpButton(iP, &iP->buttons[i], i);
} }
} }
} }
@ -1836,6 +1842,9 @@ TOOLBAR_InternalInsertButtonsT(TOOLBAR_INFO *infoPtr, INT iIndex, UINT nAddButto
/* insert new buttons data */ /* insert new buttons data */
for (iButton = 0; iButton < nAddButtons; iButton++) { for (iButton = 0; iButton < nAddButtons; iButton++) {
TBUTTON_INFO *btnPtr = &infoPtr->buttons[iIndex + iButton]; TBUTTON_INFO *btnPtr = &infoPtr->buttons[iIndex + iButton];
TOOLBAR_DumpTBButton(lpTbb, fUnicode);
ZeroMemory(btnPtr, sizeof(*btnPtr)); ZeroMemory(btnPtr, sizeof(*btnPtr));
btnPtr->iBitmap = lpTbb[iButton].iBitmap; btnPtr->iBitmap = lpTbb[iButton].iBitmap;
btnPtr->idCommand = lpTbb[iButton].idCommand; btnPtr->idCommand = lpTbb[iButton].idCommand;
@ -3776,8 +3785,6 @@ TOOLBAR_InsertButtonT(HWND hwnd, WPARAM wParam, LPARAM lParam, BOOL fUnicode)
if (lpTbb == NULL) if (lpTbb == NULL)
return FALSE; return FALSE;
TOOLBAR_DumpButton(infoPtr, (TBUTTON_INFO *)lpTbb, nIndex, FALSE);
if (nIndex == -1) { if (nIndex == -1) {
/* EPP: this seems to be an undocumented call (from my IE4) /* EPP: this seems to be an undocumented call (from my IE4)
* I assume in that case that: * I assume in that case that: