diff -r 4816d766a08a -r f345bda72bc4 Symbian3/PDK/Source/GUID-CDBBD44F-C5F6-4D51-B4BA-23DA9BB58D69.dita --- a/Symbian3/PDK/Source/GUID-CDBBD44F-C5F6-4D51-B4BA-23DA9BB58D69.dita Tue Mar 30 11:42:04 2010 +0100 +++ b/Symbian3/PDK/Source/GUID-CDBBD44F-C5F6-4D51-B4BA-23DA9BB58D69.dita Tue Mar 30 11:56:28 2010 +0100 @@ -1,66 +1,66 @@ - - - - - -Creating -generic button -

Create the CAknButton object -either dynamically from program code or from a resource structure. The constructed -button can then be used as a component control of a compound control.

-

Use the resource structures AVKON_BUTTON, AVKON_BUTTON_STATE, -and AVKON_BUTTON_STATE_EXTENSION for the button object (defined -in the file eikon.rh). The following example shows how to -construct a button with the help of a button resource. The button is placed -in a compound control (container) and it occupies the whole rectangle of the -container. The container is set as the observer of the button.

-

Example: Button resource

-RESOURCE AVKON_BUTTON r_myapp_button - { - flags = KAknButtonTextLeft; - states = - { - AVKON_BUTTON_STATE - { - txt = “Text”; - helptxt = “Help text”; - } - }; - } - -

Example: Constructing button from resource

-void CMyButtonContainer::CreateButtonL() - { - CAknButton* iAknButton = CAknButton::NewL(); - iAknButton->ConstructFromResourceL(R_MYAPP_BUTTON); - iAknButton->SetContainerWindowL(*this); - iAknButton->SetRect(Rect()); - iAknButton->SetObserver(this); - iAknButton->MakeVisible(ETrue); - iAknButton->ActivateL(); - } - -

Example: Constructing button from program code

-void CMyButtonContainer::CreateButtonL() - { - HBufC* buttonText = StringLoader::LoadLC( R_MYAPP_TEXT ); - HBufC* helpText = - StringLoader::LoadLC( R_MYAPP_HELPTEXT ); - CAknButton* iAknButton = CAknButton::NewL( - 0, 0, 0, 0, - *buttonText, *helpText, KAknButtonTextLeft, 0); - CleanupStack::PopAndDestroy( 2 ); // helpText, buttonText - iAknButton->SetContainerWindowL(*this); - iAknButton->SetRect(Rect()); - iAknButton->SetObserver(this); - iAknButton->MakeVisible(ETrue); - iAknButton->ActivateL(); - } - + + + + + +Creating +generic button +

Create the CAknButton object +either dynamically from program code or from a resource structure. The constructed +button can then be used as a component control of a compound control.

+

Use the resource structures AVKON_BUTTON, AVKON_BUTTON_STATE, +and AVKON_BUTTON_STATE_EXTENSION for the button object (defined +in the file eikon.rh). The following example shows how to +construct a button with the help of a button resource. The button is placed +in a compound control (container) and it occupies the whole rectangle of the +container. The container is set as the observer of the button.

+

Example: Button resource

+RESOURCE AVKON_BUTTON r_myapp_button + { + flags = KAknButtonTextLeft; + states = + { + AVKON_BUTTON_STATE + { + txt = “Text”; + helptxt = “Help text”; + } + }; + } + +

Example: Constructing button from resource

+void CMyButtonContainer::CreateButtonL() + { + CAknButton* iAknButton = CAknButton::NewL(); + iAknButton->ConstructFromResourceL(R_MYAPP_BUTTON); + iAknButton->SetContainerWindowL(*this); + iAknButton->SetRect(Rect()); + iAknButton->SetObserver(this); + iAknButton->MakeVisible(ETrue); + iAknButton->ActivateL(); + } + +

Example: Constructing button from program code

+void CMyButtonContainer::CreateButtonL() + { + HBufC* buttonText = StringLoader::LoadLC( R_MYAPP_TEXT ); + HBufC* helpText = + StringLoader::LoadLC( R_MYAPP_HELPTEXT ); + CAknButton* iAknButton = CAknButton::NewL( + 0, 0, 0, 0, + *buttonText, *helpText, KAknButtonTextLeft, 0); + CleanupStack::PopAndDestroy( 2 ); // helpText, buttonText + iAknButton->SetContainerWindowL(*this); + iAknButton->SetRect(Rect()); + iAknButton->SetObserver(this); + iAknButton->MakeVisible(ETrue); + iAknButton->ActivateL(); + } +
\ No newline at end of file