Backgroun skin in 3rd edition
| Mon, 2007-04-02 10:02 | |||||
|
hi, i am working on symbian os 9.1 i want to add my own skin in background. i have studied and implement the tutorial provided by eric. i am able to add my own skin but skin is not coming on whole screen . Lower portion of the screen remains white. Also svg icons added to the listbox are not displayed properly(a white boundary created around each icon ). you can have a look at the attatched image for more clear view. code i implement is written below: In header file Code: CAknsBasicBackgroundControlContext*Â iBackGround; In .cpp file in constructL function Code: TRect rect = CEikonEnv::Static()->EikAppUi()->ApplicationRect(); TAknsItemID skinItemId; skinItemId.iMinor =EAknsMinorQsnBgAreaStatus; skinItemId.iMajor = EAknsMajorSkin ; Â Â iBackGround = CAknsBasicBackgroundControlContext::NewL( skinItemId , rect, ETrue ); MAknsSkinInstance* aknsSkinInstance = AknsUtils::SkinInstance(); CAknsItemDef *bgItemDef = AknsUtils::CreateBitmapItemDefL(skinItemId, myUi.GetMbmPathL( CMyUi::EMbmSkin ),EMbmFonobackupBack_screen); Â Â aknsSkinInstance->SetLocalItemDefL( bgItemDef ); TAknsItemID skinItemId2; skinItemId2.iMinor =Â Â EAknsMinorQsnBgAreaMainListGene; skinItemId2.iMajor = EAknsMajorSkin ; Â Â MAknsSkinInstance* aknsSkinInstance2 = AknsUtils::SkinInstance(); CAknsItemDef *bgItemDef2 = AknsUtils::CreateBitmapItemDefL(skinItemId2, myUi.GetMbmPathL( CMyUi::EMbmSkin ),EMbmFonobackupRegistrationimage); Â Â aknsSkinInstance2->SetLocalItemDefL( bgItemDef2 ); In draw function Code: MAknsSkinInstance* skin = AknsUtils::SkinInstance(); Â MAknsControlContext* cc = AknsDrawUtils::ControlContext( this ); Â Â Â TBool aa = AknsDrawUtils::Background( skin, cc, this, gc, aRect ); In sizechanged function Code: if(iBackGround) { Â iBackGround->SetRect(Rect()); Â Â Â Â Â Â Â if ( &Window() ) Â Â Â Â Â Â Â { Â Â Â Â Â Â Â Â Â iBackGround->SetParentPos( PositionRelativeToScreen() ); Â Â Â Â Â Â Â } } In MopSupplyObject function Code: if(aId.iUid == MAknsControlContext::ETypeId && iBackGround) Â { Â Â Â Â return MAknsControlContext::SupplyMopObject( aId, iBackGround); Â Â Â } Â Â Â Â return CCoeControl::MopSupplyObject( aId ); if my question is not cleaner then let me know. regards Himanshu
|
|||||






Forum posts: 106
there is no one in the forum who can help me out.
regards
Himanshu
Forum posts: 732
Forum posts: 106
thanks for replying.
actually i don't want to hide cba area. i just want to display my own skin on full screen excluding cba. i have also set the background skin rect as you can see in size changed function.
regards
Himanshu
Forum posts: 106
Pls help me.
i have made an observation that if i remove listbox from my view than skin comes on whole screen. This means that i am facing problem because of listbox.
Although i insert the statement
please help me in this regard.
regards
Himanshu
Forum posts: 106
there is no body in the forum who can help me???
regards
Himanshu
Forum posts: 3
Pls help me.
i have made an observation that if i remove listbox from my view than skin comes on whole screen. This means that i am facing problem because of listbox.
Although i insert the statement
please help me in this regard.
regards
Himanshu
TRect lbrect=aRect;
context->SetRect(lbrect);
context->SetBitmap(iBackgroundId);
(use your id!)
iBgContext->SetRect(Rect());
if ( &Window() ) {
iBgContext->SetParentPos( PositionRelativeToScreen() );
}
}
to get a different rect you can use
I used all this code inside SizeChanged() method, also I set listbox rect, so there are no problem even when I switch from landscape to portrait
also bg context instanciated this way
(with relative setted to true)
Hope that this help,
Daniele
Forum posts: 2
Forum posts: 55
HI friends,
I have used whatever u posted for listbox with background image in 3rd edition.but the application getting closed in
this line
aknsSkinInstance->SetLocalItemDefL( bgItemDef );
Here exception generated.
so please tell me how can i do it.
Regards
mitu
Forum posts: 1
you have also to change the listbox background context rect
on listbox contrusction
iListBox->ItemDrawer()->ColumnData()->SetSkinEnabledL(ETrue);(iListBox->ItemDrawer()->ColumnData()->SkinBackgroundContext());
CAknsListBoxBackgroundControlContext* context =
static_cast
TRect bgRect = aRect; //aRect - listbox rect
bgRect.iTl.iY -= 20; //for example i editing this rect
context->SetRect(bgRect); //change the rect of context