This page was last modified 09:06, 24 August 2007.
TSS000022 - Using CAknIconArray to read icons for listbox from resources
From Forum Nokia Wiki
Subject:
| Using CAknIconArray to read icons for listbox from resources
| TSS000022
|
| Platform(s):
| Device(s), SW version(s):
|
S60 1st Edition S60 2nd Edition
| N/A
|
Category:
| Symbian C++
|
Subcategory:
| General
|
Description:
| Overview The Symbian API contains the helper class CAknIconArray that allows reading icons for the listbox from resources. It uses the AKN_ICON_ARRAY structure. Could you provide an example of how this functionality is used? Solution Fill in the resource the following way: RESOURCE AKN_ICON_ARRAY r_icon_testIcons { type = EAknIconArraySimple; bmpfile = "z:\SYSTEM\DATA\AVKON.MBM"; icons = { AKN_ICON { iconId = EMbmAvkonQgn_indi_checkbox_on; maskId = EMbmAvkonQgn_indi_checkbox_on_mask; }, AKN_ICON { IconId = EMbmAvkonQgn_indi_checkbox_off; maskId = EMbmAvkonQgn_indi_checkbox_off_mask; } }; } This resource contains the default icons for checkboxes. In the source code, call CAknIconArray::ConstructFromResourceL() to construct the icons. ... // CAknSingleGraphicStyleListBox* iListbox; iListbox = new(ELeave)CAknSingleGraphicStyleListBox(); iListbox->SetContainerWindowL(*this); TResourceReader reader; CEikonEnv::Static()->CreateResourceReaderLC(reader, R_LIST); iListbox->ConstructFromResourceL(reader); // Creates a GUI icon array. CAknIconArray* icons =new(ELeave) CAknIconArray(2); CleanupStack::PushL(icons); icons->ConstructFromResourceL(R_ICON_TESTICONS); // Sets graphics as ListBox icon. iListbox->ItemDrawer()->ColumnData()->SetIconArray(icons); CleanupStack::Pop(); // icons CleanupStack::PopAndDestroy(); // reader
|
Creation date:
| February 4, 2004
|
Last modified:
| -
|