LToolbar::SetButtonInfo
#include "ltwrappr.h"
L_INT LToolbar::SetButtonInfo (uButtonId, pButtonInfo )
L_UINT uButtonId; |
/* button Id */ |
const pLBUTTONINFO pButtonInfo; |
/* pointer to a structure */ |
Sets the information for the specified toolbar button.
Parameter |
Description |
uButtonId |
Identifier that indicates the button for which to set the specified information. |
pButtonInfo |
Pointer to an LBUTTONINFO structure that contains the button information to set. |
Returns
SUCCESS |
The function was successful. |
< 1 |
An error occurred. Refer to Return Codes. |
Comments
To get the current information for a toolbar button call LToolbar::GetButtonInfo.
Required DLLs and Libraries
LTTLB
For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.
See Also
Functions: |
LToolbar::AddButton, LToolbar::RemoveButton, LToolbar::GetButtonInfo, LToolbar::GetToolbarInfo, LToolbar::SetToolbarInfo, Class Members |
Topics: |
Example
/*This example will change the tool tip text of each button in a toolbar*/
LToolbar tlb;
L_VOID ToolbarTest ( HWND hWnd )
{
LTOOLBARINFO ToolbarInfo;
LBUTTONINFO ButtonInfo;
L_UINT i, j;
/* get toolbar info */
ToolbarInfo.uStructSize = sizeof( LTOOLBARINFO );
tlb.GetToolbarInfo (&ToolbarInfo, sizeof(LTOOLBARINFO) );
/* iterate through tools */
for( i = 0; i < ToolbarInfo.uToolsCount; i++ )
{
/* change the text */
for( j = 0; j < ToolbarInfo.pTools[ i ].uButtonsCount; j++ )
{
tlb.GetButtonInfo (ToolbarInfo.pTools[ i ].pButtons[ j ].uID, &ButtonInfo, sizeof(LBUTTONINFO));
wsprintf(ButtonInfo.szToolTipText, TEXT("Tool[%d] Button[%d]"), i, j);
tlb.SetButtonInfo (ToolbarInfo.pTools[ i ].pButtons[ j ].uID, &ButtonInfo);
}
}
/* free the info structure */
tlb.FreeToolbarInfo (&ToolbarInfo);
}