hi all,
i want to create a theme for my app, by which in my app view i can see the theme as background , can any one suggest me abt this???
thanks
hi all,
i want to create a theme for my app, by which in my app view i can see the theme as background , can any one suggest me abt this???
thanks
try this Code:
TTypeUid::Ptr MopSupplyObject(TTypeUid aId);
CAknsBasicBackgroundControlContext* iBgContext;
and forward declaration:
-----------------------
class MAknsControlContext;
class CAknsBasicBackgroundControlContext;
In code I made this changes:
---------------------------
#include <AknsDrawUtils.h>// skin
#include <AknsBasicBackgroundControlContext.h> //skin
ConstructL():
-------------
iBgContext = CAknsBasicBackgroundControlContext::NewL(
KAknsIIDSkinBmpMainPaneUsual, TRect(0,0,1,1), ETrue);
Draw() was modified:
--------------------
MAknsSkinInstance* skin = AknsUtils::SkinInstance();
MAknsControlContext* cc = AknsDrawUtils::ControlContext( this );
if( AknsDrawUtils::HasBitmapBackground( skin, cc ) )
{
AknsDrawUtils::Background( skin, cc, this, iCoeEnv->SystemGc(), aRect );
}
instead of "standard" filling code:
-------------------------------
gc.SetBrushColor( KRgbWhite );
gc.SetPenStyle( CWindowGc::ENullPen );
gc.SetBrushStyle( CWindowGc::ESolidBrush );
TRect rect = aRect;
rect.iTl = TPoint( 0, 0 );
gc.DrawRect( rect );
SizeChanged():
--------------
if ( iBgContext )
{
iBgContext->SetRect( Rect() );
if ( &Window() )
{
iBgContext->SetParentPos( PositionRelativeToScreen() );
}
}
MopSupplyObject:
-----------------
TTypeUid::Ptr CPCContainer::MopSupplyObject(TTypeUid aId)
{
if (iBgContext)
{
return MAknsControlContext::SupplyMopObject(aId, iBgContext );
}
return CCoeControl::MopSupplyObject(aId);
}
hi.. i tries using this code but when i built my application , it just showed a plain blank screen.. plz help...
Just to make sure: have you enabled skinning for your application? You should pass EAknEnableSkin to BaseConstructL in AppUi::ConstructL.
yes that was enabled..
actually tha problem was with this line..
iBgContext = CAknsBasicBackgroundControlContext::NewL(
KAknsIIDSkinBmpMainPaneUsual, TRect(0,0,1,1), ETrue);
i changed it to iBgContext = CAknsBasicBackgroundControlContext::NewL(
KAknsIIDSkinBmpMainPaneUsual, TRect(0,0,Rect().Width,Rect().Height), ETrue);
and it worked...
but the entire screen still isn't showing the theme.. in terms of rect().height... it isn't covering the window's height..
how to show it in full screen??(i used even applicationRect() instead of clientRect() and still the problem persists..
You are probably using AppUi::ClientRect, that is sized to have a status and a navigation pane, so it is not full screen. Use AppUi::ApplicationRect. CCoeControl also has a SetExtentToWholeScreen method.