Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries. Thanks for all your past and future contributions.

Carbide.c++ Tutorial 5 - Creating a Settings view - II

From Wiki
Jump to: navigation, search

This Symbian C++ code example shows how to create a settings view using the Carbide.c++ UI Designer

Article Metadata
Code ExampleArticle
Created: vdharankar (21 Sep 2009)
Last edited: hamishwillee (14 Feb 2012)



In Tutorial - 4 we have seen how to design a simple settings view using UI designer. This next tutorial explains how to add a bit complex control that the TextEditor, the EnumeratedTextPopup. This tutorial will explain how to add the control to settings and how to add items to it. Going beyond it also shows how to read the selected text item.

The example has a view with one EnumeratedTextPopup control.


Follow Tutorial one in order to understand basics of creating and running an application: Carbide.c++ Tutorial 1 - Helloworld

And follow Carbide.c++ Tutorial 3 - Using List view to see how to create a view based application using UI designer.

Step 1 - Start a new project

Start with a new project using Carbide.c++ IDE, call it "settings_1" ( or whatever you like). Once you are done with all basic steps you will see this window. In this step you will need to select the settings view type.

Settings 1 1.JPG

Step 2 - Add the EnumeratedTextPopup control

Next step is to add the EnumeratedTextPopup control from the control pallete of UI designer as shown below. You can drag the control to the view.

Settings 1 2.JPG

Step 3 - Add an item to the control

Next step is to add an item to the control. The EnumeratedTextPopup control consist of collection of text items. Items are numbered generally from 0 to n.

  1. Right click on the control.
  2. Select "Edit items array"
    The following screen will appear.
    Settings 1 3.JPG
    The screen will show you the properties of the array which stores the text items.
    Settings 1 4.JPG
  3. Click on the "New" button , following screen will appear
    Settings 1 5.JPG
  4. Enter the details in the fields. "Popup text" and "settings text" can be same, the value should be unique for each item.
  5. Click "OK" to finish or click "New" to add one more
    Settings 1 6.JPG

Step 4 - Adding menu to test the example

Next add a menu option to add the test code for newly designed settings view. Its easy as we have done it in previous tutorials too.

Settings 1 7.JPG

Step 5 - Adding event handler

Add the event handler for the menu.

  1. Right click on menu item.
  2. Select the option "Handle selected event".
    Settings 1 8.JPG
  3. Now add the code to the event handler
    Settings 1 10.JPG

Step 6 - Run the application

  • Execute the application , and it will show following result.
    Settings 1 9.JPG


In above tutorial we have seen how the settings view can be enhanced by adding more controls. There are several controls available and they can be used in code in some what simillar way.

Source Code


Tutorial Main page

Carbide.c++ Tutorials

This page was last modified on 14 February 2012, at 04:10.
37 page views in the last 30 days.