Symbian3/SDK/Source/GUID-A4D8326E-E72F-443D-9CA5-7835D6AE171F.dita
author Graeme Price <GRAEME.PRICE@NOKIA.COM>
Fri, 15 Oct 2010 14:32:18 +0100
changeset 15 307f4279f433
parent 7 51a74ef9ed63
permissions -rw-r--r--
Initial contribution of the Adaptation Documentation.

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
<!-- This component and the accompanying materials are made available under the terms of the License 
"Eclipse Public License v1.0" which accompanies this distribution, 
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
<!-- Initial Contributors:
    Nokia Corporation - initial contribution.
Contributors: 
-->
<!DOCTYPE concept
  PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<concept id="GUID-A4D8326E-E72F-443D-9CA5-7835D6AE171F" xml:lang="en"><title>Setting
toolbar properties</title><prolog><metadata><keywords/></metadata></prolog><conbody>
<section id="GUID-5D2E887B-7646-4CC3-86FE-48D8DF300B92">  <p>Use the following
methods and flags to set toolbar properties:</p>   <ul>
<li>           <p>Vertical orientation: use the method <xref href="jar:GUID-759FBC7F-5384-4487-8457-A8D4B76F6AA6.jar!/html/classCAknToolbar.html#95874e42b6ee5bfe31af0dddbc3a86ec" format="application/java-archive"><codeph>CAknToolbar::SetOrientation()</codeph></xref> with the values <codeph>EAknOrientationVertical</codeph> or <codeph>EAknOrientationHorizontal</codeph> in TAknOrientation (floating toolbar).</p>         </li>
<li>           <p>Semi-transparent outlook: use the <codeph>KAknToolbarTransparent</codeph> flag.</p> 
       </li>
<li>           <p>Flexible positioning: use the <codeph>KAknToolbarFlexiblePosition</codeph> flag
(floating toolbar).</p>         </li>
<li><p>To set the focus on the middle item by default, use the flag <codeph>KAknToolbarMiddleItemFocused</codeph> (floating
toolbar).</p></li>
<li><p>To set the toolbar always focusing, use the flag <codeph>KAknToolbarAlwaysFocusing</codeph> (floating
toolbar). </p></li>
<li><p>To set the focus on the last used item by default, use the flag <codeph>KAknToolbarLastUsedItemFocused</codeph> flag
(floating toolbar). </p></li>
<li><p>To set the toolbar to use no softkeys but still have the focus, use
the flag <codeph>KAknToolbarWithoutCba</codeph> (floating toolbar). </p></li>
<li><p>Small toolbar: use the flag <codeph>KAknToolbarSmall</codeph> flag
(floating toolbar). </p></li>
<li><p>Fixed toolbar: use the flag <codeph>KAknToolbarFixed</codeph>.</p></li>
<li><p>Toolbar with no skin background: use the flag <codeph>KAknToolbarNoBackground</codeph>.</p></li>
</ul><p>Below is an example of a fixed toolbar with three buttons. One of
the fixed toolbar buttons is a toolbar extension with three buttons.</p><codeblock xml:space="preserve">RESOURCE AVKON_TOOLBAR r_myapp_fixed_toolbar 
    { 
    flags = KAknToolbarFixed; 
    items = 
        { 
        TBAR_CTRL 
            { 
            type = EAknCtToolbarExtension; 
            id = ECmdExtExample; 

            control = AVKON_TOOLBAR_EXTENSION 
                { 
                items = 
                    { 
                    TBAR_CTRL 
                        { 
                        type = EAknCtButton; 
                        id = ECmdExtExample1; 
                        control = AVKON_BUTTON 
                            { 
                            flags = 0; 
                            states = 
                                { 
                                AVKON_BUTTON_STATE 
                                    { 
                                    txt = STRING_r_myapp_ext_example1_text; 
                                    helptxt = STRING_r_myapp_ext_example1_help; 
                                    } 
                                }; 
                            }; 
                        }, 
                    TBAR_CTRL 
                        { 
                        type = EAknCtButton; 
                        id = ECmdExtExample2; 
                        control = AVKON_BUTTON 
                            { 
                            flags = 0; 
                            states = 
                                { 
                                AVKON_BUTTON_STATE 
                                    { 
                                    txt = STRING_r_myapp_ext_example2_text; 
                                    helptxt = STRING_r_myapp_ext_example2_help; 
                                    } 
                                }; 
                            }; 
                        }, 
                    TBAR_CTRL 
                        { 
                        type = EAknCtButton; 
                        id = ECmdExtExample3; 
                        control = AVKON_BUTTON 
                            { 
                            flags = 0; 
                            states = 
                                { 
                                AVKON_BUTTON_STATE 
                                    { 
                                    txt = STRING_r_myapp_ext_example3_text; 
                                    helptxt = STRING_r_myapp_ext_example3_help; 
                                    } 
                                }; 
                            }; 
                        } 
                    }; 
                }; 
            }, 
        TBAR_CTRL 
            { 
            type = EAknCtButton; 
            id = ECmdExample1; 
            control = AVKON_BUTTON 
                { 
                flags = 0; 
                states = 
                    { 
                    AVKON_BUTTON_STATE 
                        { 
                        txt = STRING_r_myapp_example1_text; 
                        helptxt = STRING_r_myapp_example1_help; 
                        }  
                    }; 
                }; 
            }, 
        TBAR_CTRL 
            { 
            type = EAknCtButton; 
            id = ECmdExample2; 
            control = AVKON_BUTTON 
                { 
                flags = 0; 
                states = 
                    { 
                    AVKON_BUTTON_STATE 
                        { 
                        txt = STRING_r_myapp_example2_text; 
                        helptxt = STRING_r_myapp_example2_help; 
                        }  
                    }; 
                }; 
            } 
        }; 
    } 
</codeblock><p>Example of a floating toolbar without CBA buttons: </p><codeblock xml:space="preserve">RESOURCE AVKON_TOOLBAR r_myapp_floating_toolbar 
    { 
    flags = KAknToolbarWithoutCba; 
    items = 
        { 
        TBAR_CTRL 
            { 
            type = EAknCtButton; 
            id = ECmdExample3; 
            // A button with two states ("on" and "off") 
            control = AVKON_BUTTON 
                { 
                flags = 0; 
                states = 
                    { 
                    AVKON_BUTTON_STATE 
                        { 
                        txt = STRING_r_myapp_example3_off_text; 
                        helptxt = STRING_r_myapp_example3_off_help; 
                        }, 
                    AVKON_BUTTON_STATE 
                        { 
                        flags = KAknButtonStateHasLatchedFrame; 
                        txt = STRING_r_myapp_example3_on_text; 
                        helptxt = STRING_r_myapp_example3_on_help; 
                        }  
                    }; 
                }; 
            }, 
        TBAR_CTRL 
            { 
            type = EAknCtButton; 
            id = ECmdExample4; 
            control = AVKON_BUTTON 
                { 
                flags = 0; 
                states = 
                    { 
                    AVKON_BUTTON_STATE 
                        { 
                        txt = STRING_r_myapp_example4_text; 
                        helptxt = STRING_r_myapp_example4_help; 
                        } 
                    }; 
                }; 
            }, 
        TBAR_CTRL 
            { 
            type = EAknCtButton; 
            id = ECmdExample5; 
            control = AVKON_BUTTON 
                { 
                flags = 0; 
                states = 
                    { 
                    AVKON_BUTTON_STATE 
                        { 
                        txt = STRING_r_myapp_example5_text; 
                        helptxt = STRING_r_myapp_example5_help; 
                        } 
                    }; 
                }; 
            } 
        }; 
    } 
</codeblock>     </section>
</conbody></concept>