Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries. Thanks for all your past and future contributions.

How to use custom background for stylus popup menu

From Wiki
Jump to: navigation, search
Article Metadata
Tested with
Devices(s): S60 Emulator
Platform(s): Symbian
S60 5th Edition
Keywords: KAknsIIDQsnFrPopupSub, MAknsSkinInstance, AknsUtils, SkinInstance, CAknsItemData, GetCachedItemData, EAknsITMaskedBitmap, CreateMaskedBitmapItemDefL, CreateBitmapItemDefL
Created: chenziteng (03 Jun 2010)
Last edited: hamishwillee (24 Jun 2011)


Just as other standard controls, the stylus pop-up menu introduced in S60 5th Edition is skinned, and its background is an image identified by the ID KAknsIIDQsnFrPopupSub. You can find the definition of the IDs in the system header file AknsConstants.h.

The following code shows how to override the skin background for stylus pop-up menu by a self-created bitmap.

void CStylusPopupTextAppUi::ConstructL()
// [[[ begin generated region: do not modify [Generated Contents]
BaseConstructL( EAknEnableSkin |
EAknEnableMSK );
// ]]] end generated region [Generated Contents]
// begin by chen
// _LIT(fn, "z:\\resource\\apps\\StylusPopupText.mbm");
TFileName fn = Application()->BitmapStoreName();
const TAknsItemID id = KAknsIIDQsnFrPopupSub;//KAknsIIDQsnFrPopupPreview;
MAknsSkinInstance* skin = AknsUtils::SkinInstance();
CAknsItemData* item = skin->GetCachedItemData(id);
if (item == NULL)
item = skin->CreateUncachedItemDataL(id);
if (item->Type() == EAknsITMaskedBitmap)
CAknsItemDef* def = AknsUtils::CreateMaskedBitmapItemDefL(
id, fn, EMbmStyluspopuptextList_icon,
CAknsItemDef* def = AknsUtils::CreateBitmapItemDefL(
id, fn, EMbmStyluspopuptextList_icon);
// end by chen

Source Code

Full example:

Screenshot (first: normal, second: the one with custom background):

StylusPopupMenu(DefaultBackground).PNG StylusPopupMenu(CustomizedBackground).PNG

Relative documents

How to use custom background for listbox

How to change the highlighted listbox item background

How to use custom background for text editors

This page was last modified on 24 June 2011, at 09:22.
33 page views in the last 30 days.