Namespaces

Variants
Actions

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.

Ensuring Scroll Bar Background is drawn properly

From Wiki
Jump to: navigation, search
Article Metadata
Article
Created: bharatuppal (06 Jul 2007)
Last edited: hamishwillee (23 Jul 2012)

Overview:

Platform(s): Symbian 3rd Edition, Symbian 3rd Edition, FP1

When drawing a control (list box, grid, editor, etc.) that uses a scroll bar, the background of the scroll bar may remain white. This happens when a container does not pass the correct object (context-specific skin parameters) to its child controls. Proper skinning for child controls can be can be enabled by implementing the CCoeControl::MopSupplyObject() method for the container class, and making sure that the object provider chain between controls and their parents is set up correctly.

For more information, see SDK documentation on MObjectProvider and CCoeControl::SetMopParent()

Solution:

To correctly draw scroll bar backgrounds:

First, add the following code to the constructor of the view class derived from CCoeControl:

   // make this as member variable
CAknsBasicBackgroundControlContext* iSkinContext;
 
iSkinContext = CAknsBasicBackgroundControlContext::NewL(
KAknsIIDQsnBgAreaMainAppsGrid,
iAvkonAppUi->ApplicationRect(),
EFalse );

Note: When using the 'KAknsIIDQsnBgAreaMainAppsGrid' skinID, provide the application (full screen) rect as above. Then, implement MopSupplyObject() as follows:

   TTypeUid::Ptr CMyCustomGridAppView::MopSupplyObject( TTypeUid aId )
{
if( aId.iUid == MAknsControlContext::ETypeId && iSkinContext != NULL )
{
return MAknsControlContext::SupplyMopObject( aId, iSkinContext );
}
return CCoeControl::MopSupplyObject( aId );
}
This page was last modified on 23 July 2012, at 06:19.
34 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×