Checks (selects or presses) the given button in the toolbar.
#include "ltwrappr.h"
L_INT LToolbar::SetButtonChecked (uButtonID )
Identifier of the button to check (or press).
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
The toolbar can have only one checked (pressed) button at a time.
This example will check the current check button in the toolbar
and then if the checked button is not equal the required button,
the required button will be checked.
L_INT LToolbar__SetButtonCheckedExample(L_UINT uButtonID, LToolbar* tlb)
{
L_INT nRet;
if ( tlb->IsValid () ) /* check the validity of the toolbar handle */
{
L_INT nCheckedID ;
/* Get the current checked button in the toolbar */
nCheckedID = tlb->GetButtonChecked () ;
if ( nCheckedID != ( L_INT ) uButtonID )
{
/* Check the required button */
nRet = tlb->SetButtonChecked (uButtonID ) ;
if(nRet != SUCCESS)
return nRet;
}
}
else
{
return FAILURE ;
}
return SUCCESS ;
}