These two days are watching the Listbox example of SDK EXAMPLE, and some have to share with you, if any mistakes, please point out.
In the example, use 2 listbox classes, one is CEIKCOLUMNLISTBOX; the other is CEIKFORMATTE
DcellListbox. They correspond to both of the SINGLE and DOUBLE. The following uses the code to explain
.
Code:
CEIKCOLUMNLISTBOX * ICOLLISTBOX;
CeikformattedCellListBox * iForlistbox;
Icollistbox = new (eleive) caknsingLestyleListbox ();
iForlistBox = New (elefee) CakndoublegraphicStyleListBox ();
Icollistbox-> setContainerWindowl (* this);
iForlistBox-> setContainerWindowl (* this);
/ / Generate Listbox from the resource file
TResourceReader Reader;
Ceikonenv :: Static () -> CreateresourceReaderlc (Reader, r_test_single);
Icollistbox-> ConstructFromResourcel (Reader);
Ceikonenv :: static () -> CreateresourceReaderlc (Reader, r_test_double);
IforlistBox-> ConstructFromResourcel (Reader);
// Set scrollbar
Icollistbox-> CreateScrollBarframel (ETRUE);
Icollistbox-> scrollbarframe () -> setscrollbarvisibilityl
CEIKSCROLLBARFRAME :: Eoff, CeikscrollBarframe :: EAUTO);
iForlistBox-> CreateScrollBarframel (ETRUE);
Iforlistbox-> scrollbarframe () -> setscrollbarvisibilityl
CEIKSCROLLBARFRAME :: Eoff, CeikscrollBarframe :: EAUTO);
/ / Suitable window size
Icollistbox-> setRect (Rect ());
iForlistBox-> setRect (Rect ());
//activation
Icollistbox-> actiVatel ();
Iforlistbox-> actiVatel ();
// Resources.RSS
Resource Listbox r_text_sis
{
/ / Given a given Items for ListBox
Array_id = r_Array_sis;
// ListBox sign
Flags = EaknListBoxSelectionList;
}
Resource ListBox r_text_double
{
Array_id = r_Array_double;
Flags = EaknListBoxSelectionList;
}
/ / Please pay attention to the difference between R_Array_single and R_Array_double.
// / t is the split.
// "0 / taaaaa / taaaaa" The first 0 is indicated in the * .mbm number 0, adding to ListBox Item
Resource Array R_Array_Single
{
items =
{
LBUF
{
TXT = "/ taaaaa";},
LBUF
{
TXT = "/ tbbbbb";
}
}
}
Resource Array R_Array_double
{
items =
{
LBUF
{
TXT = "0 / Taaaaa / Taaaaa";
}
LBUF
{
TXT = "0 / tbbbbb / tbbbbb";
}
}
}