Removes a button from the toolbar.
#include "ltTLB.h"
L_LTTLB_API L_INT L_TBRemoveButton( pToolbar, uButtonId)
Pointer to a toolbar handle.
Button identifier that indicates the button to be removed. Note that if this button is the only remaining button in its tool, the whole tool is removed too.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes |
To add a button to a toolbar, call L_TBAddButton.
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.
This example will remove all buttons from a given toolbar.
L_INT TBRemoveButtonExample( pTOOLBARHANDLE pToolbar )
{
L_INT nRet;
LTOOLBARINFO ToolbarInfo;
L_UINT i, j;
/* get toolbar info */
ZeroMemory(&ToolbarInfo, sizeof(LTOOLBARINFO) );
nRet = L_TBGetToolbarInfo ( pToolbar, &ToolbarInfo, sizeof(LTOOLBARINFO) );
if(nRet != SUCCESS)
return nRet;
/* iterate through tools */
for( i = 0; i < ToolbarInfo.uToolsCount; i++ )
{
/* remove all buttons of this tool */
for( j = 0; j < ToolbarInfo.pTools[ i ].uButtonsCount; j++ )
{
nRet = L_TBRemoveButton( pToolbar, ToolbarInfo.pTools[ i ].pButtons[ j ].uID );
if(nRet != SUCCESS)
return nRet;
}
}
/* free the info structure */
nRet = L_TBFreeToolbarInfo ( pToolbar, &ToolbarInfo );
if(nRet != SUCCESS)
return nRet;
return SUCCESS;
}