×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Jun 2007
    Posts
    11

    Arrow how to create a theme to my app?

    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

  2. #2
    Regular Contributor
    Join Date
    Jun 2007
    Posts
    52

    Re: how to create a theme to my app?

    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);

    }

  3. #3
    Registered User
    Join Date
    Feb 2011
    Posts
    12

    Re: how to create a theme to my app?

    hi.. i tries using this code but when i built my application , it just showed a plain blank screen.. plz help...

  4. #4
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,674

    Re: how to create a theme to my app?

    Just to make sure: have you enabled skinning for your application? You should pass EAknEnableSkin to BaseConstructL in AppUi::ConstructL.

  5. #5
    Registered User
    Join Date
    Feb 2011
    Posts
    12

    Re: how to create a theme to my app?

    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..

  6. #6
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,674

    Re: how to create a theme to my app?

    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.

Similar Threads

  1. Series 60 Theme Studio - unable to create a New Theme
    By yukimi in forum Symbian Tools & SDKs
    Replies: 6
    Last Post: 2007-03-19, 18:47
  2. Replies: 7
    Last Post: 2006-09-22, 03:27
  3. How to create DCF for theme (.nth) S40
    By ricky_chen83 in forum Digital Rights Management & Content Downloading
    Replies: 0
    Last Post: 2006-09-06, 03:10
  4. Theme Studio 3 and n90 / n70 Problems
    By Ezz666 in forum Streaming and Video
    Replies: 0
    Last Post: 2006-02-04, 13:18
  5. Replies: 0
    Last Post: 2005-04-18, 05:38

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×