View resource statements in the view architecture

If defined, the Symbian platform uses the VIEW resources statements to define separate menu bars and CBAs for different views in your application. For more information on views, see Views.

To define specific GUI component resources for a view:

  1. Determine the view requirements of your application.

  2. Create a AVKON_VIEW resource in your resource file. The AVKON_VIEW structure is defined in the avkon.rh file. The syntax is as follows:

    RESOURCE AVKON_VIEW r_myapp_view1
    {
    menubar = r_myapp_menubar1;
    cba = R_AVKON_SOFTKEYS_OPTIONS_BACK;
    }

    where:

    • r_myapp_view1 is a unique name for the resource declaration.

    • menubar defines the menubar resource.

    • cba defines the control pane resource.

    All values refer to other resources defined either in the resource file or to precompiled values available from the Symbian platform.

    Note: If an element is not declared, then the default value declared in the structure is used. By default, all elements are not used.

  3. Call the view resource in the UI implementation.

Note: You can call BaseConstructL() without any parameters, in which case the default application menu and CBA are used for the view.