Http://www.j2mehome.com CLICK: 61 unknown I want to comment (0)
- Abstract: Yesterday, 6.10 was too tired to write. Today, I went on to work hard! Mulslist example in this sectionProgramThe cakndoublestylelistbox class is used as an example to demonstrate how to dynamically create multiple choice lists and delete list items in batches. (Here we still use mymarklist as an example.
- Tags: icons Development Instance //
The mulslist example program in this section uses the cakndoublestylelistbox class as an example to demonstrate how to dynamically create multiple-choice list boxes and delete list items in batches. (Here we will take the mymarklist sample program as an example for adaptation)
1. Create a multiple-choice list box
You must specify "eaknlistboxmultiselectionlist" when creating the multiple-choice list box. When adding data, use the correct format string, when adding an icon, you must ensure that the icon indicating the selected status and the icon indicating the unselected status are the first and second elements of the icon array (that is, the icon must correspond to each other ). Main modifiedCodeAs follows:
Void cmymarklistcontainer: constructl (const trect & arect)
{
Createmediawl ();
// Create ListBox
Ilistbox = new (eleave) cakndoublegraphicstylelistbox;
Ilistbox-> setcontainer1_wl (* This );
Ilistbox-> constructl (this, eaknlistboxmultiselectionlist );
Ilistbox-> setlistboxobserver (this );
// Load items
Ctextlistboxmodel * model = ilistbox-> model ();
Cdescarray * array = static_cast <cdescarray *> (model-> itemtextarray ());
// _ Encode (kitemformat, "1 \ trecord % d \ t % d ");
// "Icon1 \ tlabel1 \ tlabel2"
// If it is 11.3.4mulslist, use the following format string
_ Partition (kitemformat, "1 \ trecord % d \ t % d \ t2 ");
Tbuf <32> record;
Tint I = 1;
For (I = 1; I <9; I ++)
{
Record. Format (kitemformat (), I, 100-i, 1 );
Array-> appendl (record );
}
// Load icons
Ceikonenv * eikonenv = ceikonenv: static ();
Tfilename mbmfile = eikonenv-> eikappui ()-> application ()-> bitmapstorename ();
Carrayptr <cgulicon> * icons = new (eleave) cakniconarray (3 );
Cleanupstack: pushl (icons );
// Icons-> appendl (eikonenv-> createiconl (mbmfile, embmmymarklisttick, embmmymarklisttickmask ));
// Icons-> appendl (eikonenv-> createiconl (mbmfile, embmmymarkliststar, embmmymarkliststarmask ));
// If it is 11.3.4mulslist, use the following icon.
Icons-> appendl (eikonenv-> createiconl (mbmfile, embmmymarklistcheck, embmmymarklistcheckmask ));
Icons-> appendl (eikonenv-> createiconl (mbmfile, embmmymarklistuncheck, embmmymarklistuncheckmask ));
Icons-> appendl (eikonenv-> createiconl (mbmfile, embmmymarkliststar, embmmymarkliststarmask ));
Cleanupstack: Pop (icons );
Ilistbox-> itemdrawer ()-> formattedcelldata ()-> seticonarray (icons );
// Create scrollbar
Ilistbox-> createscrollbarframel (etrue );
Ilistbox-> scrollbarframe ()-> setscrollbarvisibilityl (
Ceikscrollbarframe: eoff, ceikscrollbarframe: eauto );
Setrect (arect );
Activatel ();
}
After half a day, the. mbg file cannot be regenerated. I checked a lot of information and did not explain it.
Method 1: Try to clear the project:
Abld reallyclean
Bldmake clean
Then re-build:
Bldmake bldfiles
Abld build wins udeb
Method 2: run the bmconv command in the group directory.
Bmconv mymarklist. MBM/c12star.bmp
I was so angry that all these two files were deleted... Haha, you can. It is estimated that the two files need to be manually deleted.
Finally, it's done !!!