Join Now
Quality Rating:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)
Expertise Level:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)

This page was last modified 11:44, 3 December 2007.

Enumerated Text Popup Example

From Forum Nokia Wiki


Contents

1. Introduction to the example

This example shows how to instantiate "Enumerated Text Popup" control using Carbide C++ UI Designer. After adding "Enumerated Text Popup" to the setting list the compiler reported: "The list of popup items in 'enumeratedTextPopup1' is empty; this will cause a panic at runtime."

In some reason there was no way to add items into this control using it's properties.

Image:Contrib_001_i01_enumerated_properties.jpg

To do that it is necessary to define them in resource file manually.


2. Create project.

With Carbide C++ IDE select:

"File"->"New"->"Symbian OS C++ Project"->"3rd Ed GUI with UI Designer"


Then give the name to your project as: "EnumeratedTextEx" and select "Setting Item List" UI Design template.

3. Insert Enumerated Text Popup control

To insert Enumerated Text into design, at "Palette->Controls" tab pick "Enumerated Text Popup Setting Item" and drop it to Design.


4. Redefine and expand resource file

There are two attributes that should be redefined. They are:

r_enumerated_text_ex_setting_item_list_enumerated_text_popup1_setting_texts_resource
r_enumerated_text_ex_setting_item_list_enumerated_text_popup1_popped_up_texts_resource

at following resource file:

<project_path>/data/EnumeratedTextExSettingItemList.rssi


Defenition of items that show current Enumerted Text's state:

RESOURCE ARRAY r_enumerated_text_ex_setting_item_list_enumerated_text_popup1_setting_texts_resource
{
   items =
   {
   AVKON_ENUMERATED_TEXT
   {
      value = 0;
      text = "item_0";
   },
   AVKON_ENUMERATED_TEXT
   {
      value = 1;
      text = "item_1";
   },
   AVKON_ENUMERATED_TEXT
   {
      value = 2;
      text = "item_2";
   },
   AVKON_ENUMERATED_TEXT
   {
      value = 3;
      text = "item_3";
   },
   AVKON_ENUMERATED_TEXT
   {
      value = 4;
      text = "item_4";
   },
   AVKON_ENUMERATED_TEXT
   {
      value = 5;
      text = "item_5";
   },
   AVKON_ENUMERATED_TEXT
   {
      value = 6;
      text = "item_6";
   },
   AVKON_ENUMERATED_TEXT
   {
      value = 7;
      text = "item_7";
   },
   AVKON_ENUMERATED_TEXT
   {
      value = 8;
      text = "item_8";
   }
   };
 
}

Defenition of items that will be shown during user choice process:

RESOURCE ARRAY r_enumerated_text_ex_setting_item_list_enumerated_text_popup1_popped_up_texts_resource
{
  items =
  {
     LBUF
     {
        txt = "choose_0";
     },
     LBUF
     {
        txt = "choose_1";
     },
     LBUF
     {
        txt = "choose_2";
     },
     LBUF
     {
        txt = "choose_3";
     },
     LBUF
     {
        txt = "choose_4";
     },
     LBUF
     {
        txt = "choose_5";
     },
     LBUF
     {
        txt = "choose_6";
     },
     LBUF
     {
        txt = "choose_7";
     },
     LBUF
     {
        txt = "choose_8";
     }
  };
}


5. Code implementation

There is a need to insert a line to ConstructL() method:

void TEnumeratedTextExSettingItemListSettings::ConstructL()
{
 
  SetEnumeratedTextPopup1( NULL );
 
}

at file:

"<uidesign-name>.cpp"


6. Source code

The considered example can be downloaded as a Carbide C++ project here: Image:EnumeratedTextEx.zip

To know how import sources to Carbide look here .

Related Discussions
Thread Thread Starter Forum Replies Last Post
MMS Example mark_williams General Symbian C++ 4 2004-04-22 10:11
AknExGrid Example, Menu Grid, Bug ? eracer Symbian User Interface 0 2002-11-11 15:18
In CEikEdwin the shift-key dialog is not displaying mike.b General Symbian C++ 1 2006-09-06 11:08
how to list the text(*.txt) in 'e:\a' anyko38155285 Python 10 2008-07-03 23:24
Text file viewer Jeepy General Symbian C++ 5 2003-06-24 15:14
 
Powered by MediaWiki
     
     RDF Facets:
     
     
     qfnZtopicQUqfnTopicZcarbideQ
     qfnZtopicQUqfnTopicZseriesE5f60Q
     qfnZtypeQUqfnTypeZCommunityContentQ
     qfnZtypeQUqfnTypeZWebpageQ
     qfnZtypeQUqfnTypeZWikiContentQ
     qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX