Join Now
Quality Rating:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)
Expertise Level:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)

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:

-
Related Discussions
Thread Thread Starter Forum Replies Last Post
Nokia application icon strike_noir Symbian User Interface 2 2007-11-02 04:15
Error on thumbnail creation??? shocy Symbian User Interface 5 2004-01-22 18:13
about delete the point of ListBox cipper General Symbian C++ 9 2007-08-29 10:04
ListBox error Meredith1219 General Symbian C++ 1 2008-01-24 05:18
Using Icons GENERAL_INFO Symbian User Interface 1 2001-12-05 17:53
 
Powered by MediaWiki
     
     RDF Facets:
     
     
     qfnZtypeQUqfnTypeZCommunityContentQ
     qfnZtypeQUqfnTypeZKnowledgeBaseContentQ
     qfnZtypeQUqfnTypeZTechnicalSolutionQ
     qfnZtypeQUqfnTypeZWebpageQ
     qfnZtypeQUqfnTypeZWikiContentQ
     qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX