Contents |
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.
To do that it is necessary to define them in resource file manually.
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.
To insert Enumerated Text into design, at "Palette->Controls" tab pick "Enumerated Text Popup Setting Item" and drop it to Design.
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";
}
};
}
There is a need to insert a line to ConstructL() method:
void TEnumeratedTextExSettingItemListSettings::ConstructL()
{
SetEnumeratedTextPopup1( NULL );
}
at file:
"<uidesign-name>.cpp"
The considered example can be downloaded as a Carbide C++ project here: File:EnumeratedTextEx.zip
To know how import sources to Carbide look here .
No related wiki articles found