L_TBSetButtonEnabled

#include "LtTLB.h"

L_INT EXT_FUNCTION L_TBSetButtonEnabled(pToolbar, uButtonID, fEnable )

pTOOLBARHANDLE pToolbar;

/* pointer to a toolbar handle */

L_UINT uButtonID;

/* button ID */

L_BOOL fEnable;

/* flag */

Enables or disables the specified button in a toolbar.

Parameter

Description

pToolbar

Pointer to a toolbar handle.

uButtonID

Identifier of the button to enable or disable.

fEnable

Flag that indicates whether to enable or disable the specified button. Possible values are:

 

Value

Meaning

 

TRUE

Enable the specified button.

 

FALSE

Disable the specified button.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes

Comments

To determine whether a button is enabled or disabled, call L_TBIsButtonEnabled.

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:

L_TBIsButtonEnabled.

Topics:

Getting and Setting Toolbar Button Information

Example

L_INT ToggleToolbarButton ( pTOOLBARHANDLE pLeadToolbar, L_UINT uButtonID )
{
   if (SUCCESS == L_TBIsValid ( pLeadToolbar ) ) /* check the validity of the toolbar handle */
   {
      L_BOOL fEnabled;

      /* Get the state of the toolbar button */
      L_TBIsButtonEnabled ( pLeadToolbar, uButtonID, &fEnabled );

       if ( fEnabled ) 
      {
         /* Disable the button */
         L_TBSetButtonEnabled ( pLeadToolbar, uButtonID, FALSE );
      }
      else
      {
         /* Enable the button */
         L_TBSetButtonEnabled ( pLeadToolbar, uButtonID, TRUE );
      }

      return SUCCESS ;
   }
   else
   {
      return FAILURE ;
   }
}