LToolbar::SetButtonInfo

Summary

Sets the information for the specified toolbar button.

Syntax

#include "ltwrappr.h"

L_INT LToolbar::SetButtonInfo (uButtonId, pButtonInfo )

Parameters

L_UINT uButtonId

Identifier that indicates the button for which to set the specified information.

const pLBUTTONINFO pButtonInfo

Pointer to an LBUTTONINFO structure that contains the button information to set.

Returns

Value Meaning
SUCCESS The function was successful.
< An error occurred. Refer to Return Codes.

Comments

To get the current information for a toolbar button call LToolbar::GetButtonInfo.

Required DLLs and Libraries

See Also

Functions

Topics

Example

This example will change the tool tip text of each button in a toolbar.

L_INT LToolbar__SetButtonInfoExample( HWND hWnd, LToolbar* tlb) 
 
{ 
   UNREFERENCED_PARAMETER(hWnd); 
 
   L_INT          nRet; 
   LTOOLBARINFO   ToolbarInfo; 
   LBUTTONINFO    ButtonInfo; 
   L_UINT         i, j; 
 
   /* get toolbar info */ 
 
   ToolbarInfo.uStructSize = sizeof( LTOOLBARINFO ); 
 
   nRet = tlb->GetToolbarInfo (&ToolbarInfo, sizeof(LTOOLBARINFO) ); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   /* iterate through tools */ 
 
   for( i = 0; i < ToolbarInfo.uToolsCount; i++ ) 
 
   { 
 
      /* change the text */ 
 
      for( j = 0; j < ToolbarInfo.pTools[ i ].uButtonsCount; j++ ) 
 
      { 
 
         nRet = tlb->GetButtonInfo (ToolbarInfo.pTools[ i ].pButtons[ j ].uID, &ButtonInfo, sizeof(LBUTTONINFO)); 
         if(nRet != SUCCESS) 
            return nRet; 
 
         wsprintf(ButtonInfo.szToolTipText, TEXT("Tool[%d]  Button[%d]"), i, j); 
 
         nRet = tlb->SetButtonInfo (ToolbarInfo.pTools[ i ].pButtons[ j ].uID, &ButtonInfo); 
         if(nRet != SUCCESS) 
            return nRet; 
 
      } 
 
   } 
 
   /* free the info structure */ 
 
   nRet = tlb->FreeToolbarInfo (&ToolbarInfo); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   return SUCCESS; 
} 

Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Toolbar C++ Class Library Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.