Symbian3/PDK/Source/GUID-A4D8326E-E72F-443D-9CA5-7835D6AE171F.dita
author Dominic Pinkman <Dominic.Pinkman@Nokia.com>
Fri, 22 Jan 2010 18:26:19 +0000
changeset 1 25a17d01db0c
child 3 46218c8b8afa
permissions -rw-r--r--
Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608

<?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>  <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 <xref href="jar:GUID-759FBC7F-5384-4487-8457-A8D4B76F6AA6.jar!/html/avkon_8hrh.html#4b729387cba7879c1c51f2be8f4a6ff7" format="application/java-archive">TAknOrientation</xref> (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>