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 over the next few weeks. Thanks for all your past and future contributions.
How to use custom background for stylus popup menu
S60 5th Edition
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.
// [[[ begin generated region: do not modify [Generated Contents]
BaseConstructL( EAknEnableSkin |
// ]]] 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
Screenshot (first: normal, second: the one with custom background):