×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Regular Contributor
    Join Date
    Jan 2005
    Location
    Malmö, Sweden
    Posts
    157

    Skin list highlight problem (WSERV 7)

    Hi,

    I try to get the skin bitmap for the list highlight and draw it..
    But I get WSERV 7 (Invalid bitmap) when I try.
    I do get a pointer returned by GetCachedBitmap.
    Anyone have any idea what I'm missing?

    Code:
    void CMyListItemDrawer::DrawActualItem(TInt aItemIndex, const TRect& aActualItemRect,
            TBool aItemIsCurrent, TBool aViewIsEmphasized, TBool aViewIsDimmed, 
            TBool aItemIsSelected) const
            {
        	MAknsSkinInstance* skin = AknsUtils::SkinInstance();
        	MAknsControlContext* cc = AknsDrawUtils::ControlContext( &iListBox ); 
        	AknsDrawUtils::Background(skin,cc,&iListBox,*iGc,aActualItemRect);  //skin background works fine.
    
        	///// draw highlight 
        	if(aItemIsSelected || aItemIsCurrent)
        		{
        		CFbsBitmap* hlc = AknsUtils::GetCachedBitmap(skin,KAknsIIDQsnFrListCenter); //non-NULL pointer is returned here.
        		iGc->DrawBitmap(aActualItemRect, hlc); //without this line, no wserv 7 panic
        		}
        	/////
        	
        	CFbsBitmap* bmp = (*iListBox.iIcons)[aItemIndex]->Bitmap();
        	CFbsBitmap* mask = (*iListBox.iIcons)[aItemIndex]->Mask();
        	TPoint pos( aActualItemRect.iTl.iX + aActualItemRect.Width()/8, aActualItemRect.iTl.iY + aActualItemRect.Height()/2 - bmp->SizeInPixels().iHeight/2); 
        	iGc->BitBltMasked(pos, bmp, TRect(TPoint(0,0), bmp->SizeInPixels()), mask, EFalse);
            }

  2. #2
    Nokia Developer Champion
    Join Date
    Jan 2008
    Location
    Moscow, Russia
    Posts
    3,348

    Re: Skin list highlight problem (WSERV 7)

    Try to replace
    Code:
    CFbsBitmap* hlc = AknsUtils::GetCachedBitmap(skin,KAknsIIDQsnFrListCenter);
    iGc->DrawBitmap(aActualItemRect, hlc);
    with
    Code:
    TRect outer = aActualItemRect;
    TRect inner = outer;
    AknsDrawUtils::DrawFrame(skin, *iGc, outer, inner, KAknsIIDQsnFrList, KAknsIIDQsnFrListCenter);

  3. #3
    Regular Contributor
    Join Date
    Jan 2005
    Location
    Malmö, Sweden
    Posts
    157

    Re: Skin list highlight problem (WSERV 7)

    Thanks,

    I just tried that, found it in this thread: http://discussion.forum.nokia.com/fo...d.php?t=121827

    Works now.

Similar Threads

  1. Problem with Skin enabling - disabling and Setting List in S60
    By sauvikds in forum Symbian User Interface
    Replies: 1
    Last Post: 2008-08-22, 13:45
  2. File Browsing Problem
    By Marwa in forum Mobile Java Networking & Messaging & Security
    Replies: 13
    Last Post: 2007-10-10, 15:52
  3. Faceing problem regarding list content
    By PankajNeve in forum Symbian
    Replies: 3
    Last Post: 2006-06-20, 12:55
  4. problem with list box
    By srkreddy999 in forum Symbian User Interface
    Replies: 2
    Last Post: 2005-09-30, 10:44
  5. Setting List Problem
    By vinayakak in forum Symbian Tools & SDKs
    Replies: 0
    Last Post: 2005-09-17, 10:34

Posting Permissions

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