Hi,
I found something strange. First this thing is happened when i try to change the status pane skin. I am using this code on S60 5th edition.
Code:
void CMTN_STK_MenuAppView::ConstructL() {
_LIT(KMbmFile, "z:\\resource\\apps\\header.mbm");
/**
* Obtain a reference to the status pane .This delivers a pointer to a
* CEikStatusPane, which can then be manipulated.
* Although CAknAppUi::StatusPane() returns a pointer to a CEikStatusPane object,
* the CAknAppUi object maintains ownership. Therefore, it would be inappropriate
* to place the object on the cleanup stack.
*/
CEikStatusPane* statusPane = StatusPane();
/**
* To make the status pane invisible in the StatusPane example, two methods are used:
* CEikStatusPane::CurrentLayoutResId()— This returns the resource ID for the
* current layout.
* CEikStatusPane::SwitchLayoutL()— This changes the status pane layout to the
* resource ID specified.
*
*/
if (statusPane->CurrentLayoutResId() != R_AVKON_STATUS_PANE_LAYOUT_EMPTY) {
statusPane->SwitchLayoutL(R_AVKON_STATUS_PANE_LAYOUT_USUAL_MIRRORED);
//statusPane->SwitchLayoutL(R_AVKON_STATUS_PANE_LAYOUT_VT); // working
} //end of if
TAknsItemID id = KAknsIIDQsnBgAreaStatus;
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, KMbmFile, 0, 0);
skin->SetLocalItemDefL(def);
} else {
CAknsItemDef* def = AknsUtils::CreateBitmapItemDefL(id, KMbmFile, 0);
skin->SetLocalItemDefL(def);
}
/**
* This resource is defined in AppViewContainer.rssi, which is in data subfolder.
* When the resource file is compiled, a constant representing the resource will
* be added to an .rsg header file generated by the resource compiler. The
* name given to this constant is the same as the name given to the resource in
* the resource file, but in uppercase. So, for the example resource defined above,
* a constant named R_MTN_STK_MENU_SELECTION_VIEW will be created.
*
*/
BaseConstructL(R_MTN_STK_MENU_SELECTION_VIEW);
} //end of ConstructL()
strange thing is when i set "Build Configurations->Set Active->Emulator debug" then code works fine. Status pane skin changes. But when i set it to " Build Configurations->Set Active->Phone Release". Then code is not working. No error. But when emulator launches then there is no icon to click. And if I install sis on my phone then the same thing happens, means like page refresh.
why i am facing this issue? what could be the reason? On emulator working fine, but on phone release no icon in the emulator.
I want to ask one thing more. Suppose i added mbm image , say header.mbm and i use this code
Code:
if(item->Type()==EAknsITMaskedBitmap) {
CAknsItemDef* def = AknsUtils::CreateMaskedBitmapItemDefL(id, KMbmFile, 0, 0);
skin->SetLocalItemDefL(def);
} else {
CAknsItemDef* def = AknsUtils::CreateBitmapItemDefL(id, KMbmFile, 0);
skin->SetLocalItemDefL(def);
}
Now i add another bmp say background and now what should i use, the same thing like
Code:
if(item->Type()==EAknsITMaskedBitmap) {
CAknsItemDef* def = AknsUtils::CreateMaskedBitmapItemDefL(id, KMbmFile, 0, 0);
skin->SetLocalItemDefL(def);
} else {
CAknsItemDef* def = AknsUtils::CreateBitmapItemDefL(id, KMbmFile, 0);
skin->SetLocalItemDefL(def);
}
or do i need to chnage the number form 0 to 1 like this
Code:
if(item->Type()==EAknsITMaskedBitmap) {
CAknsItemDef* def = AknsUtils::CreateMaskedBitmapItemDefL(id, KMbmFile, 1, 1);
skin->SetLocalItemDefL(def);
} else {
CAknsItemDef* def = AknsUtils::CreateBitmapItemDefL(id, KMbmFile, 1);
skin->SetLocalItemDefL(def);
}
Thanks