You Are Here:

Community: Wiki

This page was last modified on 18 September 2009, at 02:14.

Enumerated Text Popup Example

From Forum Nokia Wiki

Reviewer Approved   


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: File:EnumeratedTextEx.zip

To know how import sources to Carbide look here .

Related Wiki Articles

No related wiki articles found

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fwikiE2eforumE2enokiaE2ecomE2findeE78E2ephpE2fE45numeratedE5fTeE78tE5fPopupE5fE45E78ampleX qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqfntypeZWikiContentQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtopicQUqfnTopicZcarbideQ qfnZtopicQUqfnTopicZideQ qfnZtopicQUqfnTopicZseriesE5f60Q qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qfnZtypeQUqfntypeZWikiContentQ qfnZuserE5ftagQSxs60X qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqfntypeZWikiContentQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ
User Rating: qfnZuserE5FratingQNx3E2E0000X