LToolbar::SetButtonChecked

#include "ltwrappr.h"

L_INT LToolbar::SetButtonChecked (uButtonID )

L_UINT uButtonID;

/* button ID */

Checks (press) the given button in the toolbar.

Parameter

Description

uButtonID

Identifier of the button to check ( to press ).

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

The toolbar has only one checked (pressed) button at a time.

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::GetButtonChecked, Class Members

Topics:

Getting and Setting Toolbar Button Information

Example

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 ;
}