Setting properties for button states

The state-specific properties and the methods used for setting them for the generic button include the following:

Property

Method in CAknButtonState

Text

SetTextL()

Icon

Flags

SetFlags()

Help text

SetHelpTextL()

// Set second state as having latched frame 
button->State( 1 )->SetFlags( KAknButtonStateHasLatchedFrame ); 

// Set text and help text to second state 
HBufC* buttonText = StringLoader::LoadLC( R_MYAPP_BUTTON_TEXT );    
HBufC* buttonHelpText = StringLoader::LoadLC( R_MYAPP_BUTTON_HELP_TEXT );    
button->State( 1 )->SetTextL( *buttonText ); 
button->State( 1 )->SetHelpTextL( *buttonHelpText ); 
CleanupStack::PopAndDestroy( 2 ); // buttonText, buttonHelpText