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
This Symbian C++ code example shows how to create a settings view using the Carbide.c++ UI Designer
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.
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.
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.
- Right click on the control.
- Select "Edit items array"
- Click on the "New" button , following screen will appear
- Enter the details in the fields. "Popup text" and "settings text" can be same, the value should be unique for each item.
- Click "OK" to finish or click "New" to add one more
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.
Step 5 - Adding event handler
Add the event handler for the menu.
- Right click on menu item.
- Select the option "Handle selected event".
- Now add the code to the event handler
Step 6 - Run the application
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.