×

Discussion Board

Results 1 to 4 of 4

Thread: CAknGrid Issues

  1. #1
    Regular Contributor
    Join Date
    Mar 2008
    Posts
    226

    CAknGrid Issues

    Hi,
    I am facing two issues with the CAknGrid.
    1. On N95: I am trying to change the highlighted grid text to red by the following code
    colorTableEntry[EAknsCIQsnTextColorsCG11].m_indexed = KErrNotFound;
    colorTableEntry[EAknsCIQsnTextColorsCG11].m_rgb = KRgbRed.Value();
    It works fine in Emulator but not happening on N95.

    2. On E65: Grid text is not getting displayed at all on E65 for the same application.

    Pls help


    Thanks,
    Jinu

  2. #2
    Registered User
    Join Date
    Feb 2007
    Location
    Tampere
    Posts
    370

    Re: CAknGrid Issues

    Hi,

    Can you please post some part of your code. What is m_rgb and what is m_indexed? probably member variables of your class. we would like to know how your class is declared and used before one can give some suggestion
    Regards

    - MVP
    "Dare To Dream" - A.P.J.Kalam

  3. #3
    Regular Contributor
    Join Date
    Mar 2008
    Posts
    226

    Re: CAknGrid Issues

    Pls hind the code snippet below


    void CUi::doSetDefaultColorsL()
    {
    MAknsSkinInstance* skin = AknsUtils::SkinInstance();
    if(skin)
    {
    CAknsItemData* itemData = skin->GetCachedItemData(KAknsIIDQsnTextColors, EAknsITColorTable);
    if(itemData)
    {
    RArray<TInt> indexList;
    CleanupClosePushL(indexList);
    RArray<TUint32> rgbList;
    CleanupClosePushL(rgbList);

    CAknsColorTableItemData* colorTable = static_cast<CAknsColorTableItemData*>(itemData);
    TInt error = KErrNone;
    TInt index = 0;
    TRgb colorRgb;
    do
    {
    TRAP(error, colorTable->GetColorL(index, colorRgb));
    if(error == KErrNone)
    {
    indexList.Append(colorTable->ColorIndexed(index));
    rgbList.Append(colorRgb.Value());
    ++index;
    }

    } while(error == KErrNone);

    TAknsColorTableEntry* colorTableEntry = new(ELeave) TAknsColorTableEntry[index];
    CleanupArrayDeletePushL(colorTableEntry);

    for(TInt i = 0; i < index; ++i)
    {
    colorTableEntry[i].m_indexed = indexList[i];
    colorTableEntry[i].m_rgb = rgbList[i];
    }

    // override the list text color and highlighted text color
    colorTableEntry[EAknsCIQsnTextColorsCG6].m_indexed = KErrNotFound;
    colorTableEntry[EAknsCIQsnTextColorsCG6].m_rgb = KDefaultTextColor.Value();
    colorTableEntry[EAknsCIQsnTextColorsCG10].m_indexed = KErrNotFound;
    colorTableEntry[EAknsCIQsnTextColorsCG10].m_rgb = KDefaultHighLightedTextColor.Value();
    colorTableEntry[EAknsCIQsnTextColorsCG11].m_indexed = KErrNotFound;
    colorTableEntry[EAknsCIQsnTextColorsCG11].m_rgb = KRgbRed.Value();


    colorTable->SetColorsL(index, colorTableEntry);

    CleanupStack::PopAndDestroy(3); // colorTableEntry, rgbList, indexList
    }
    //for list
    itemData = skin->GetCachedItemData(KAknsIIDQsnFrList, EAknsITImage);
    if(itemData)
    {
    CAknsImageItemData* imageData = static_cast<CAknsImageItemData*>(itemData);
    if(EAknsITImageTable == imageData->Type() ||
    EAknsITBmpAnim == imageData->Type())
    {
    itemData = skin->GetCachedItemData(KAknsIIDQsnFrListCornerTl);
    doSetDefaultHighlightedBackground(itemData);
    itemData = skin->GetCachedItemData(KAknsIIDQsnFrListCornerTr);
    doSetDefaultHighlightedBackground(itemData);
    itemData = skin->GetCachedItemData(KAknsIIDQsnFrListCornerBl);
    doSetDefaultHighlightedBackground(itemData);
    itemData = skin->GetCachedItemData(KAknsIIDQsnFrListCornerBr);
    doSetDefaultHighlightedBackground(itemData);
    itemData = skin->GetCachedItemData(KAknsIIDQsnFrListSideT);
    doSetDefaultHighlightedBackground(itemData);
    itemData = skin->GetCachedItemData(KAknsIIDQsnFrListSideB);
    doSetDefaultHighlightedBackground(itemData);
    itemData = skin->GetCachedItemData(KAknsIIDQsnFrListSideL);
    doSetDefaultHighlightedBackground(itemData);
    itemData = skin->GetCachedItemData(KAknsIIDQsnFrListSideR);
    doSetDefaultHighlightedBackground(itemData);
    itemData = skin->GetCachedItemData(KAknsIIDQsnFrListCenter);
    // override the list highlighted background color
    doSetDefaultHighlightedBackground(itemData);
    }
    else if(EAknsITBitmap == imageData->Type() ||
    EAknsITMaskedBitmap == imageData->Type())
    {
    // override the list highlighted background color
    doSetDefaultHighlightedBackground(itemData);

    }
    }
    // for grid
    itemData = skin->GetCachedItemData(KAknsIIDQsnFrGrid, EAknsITImage);
    if(itemData)
    {
    CAknsImageItemData* imageData = static_cast<CAknsImageItemData*>(itemData);
    if(EAknsITImageTable == imageData->Type() ||
    EAknsITBmpAnim == imageData->Type())
    {
    itemData = skin->GetCachedItemData(KAknsIIDQsnFrGridCornerTl);
    doSetDefaultHighlightedBackground(itemData, EGrid);
    itemData = skin->GetCachedItemData(KAknsIIDQsnFrGridCornerTr);
    doSetDefaultHighlightedBackground(itemData, EGrid);
    itemData = skin->GetCachedItemData(KAknsIIDQsnFrGridCornerBl);
    doSetDefaultHighlightedBackground(itemData, EGrid);
    itemData = skin->GetCachedItemData(KAknsIIDQsnFrGridCornerBr);
    doSetDefaultHighlightedBackground(itemData, EGrid);
    itemData = skin->GetCachedItemData(KAknsIIDQsnFrGridSideT);
    doSetDefaultHighlightedBackground(itemData, EGrid);
    itemData = skin->GetCachedItemData(KAknsIIDQsnFrGridSideB);
    doSetDefaultHighlightedBackground(itemData, EGrid);
    itemData = skin->GetCachedItemData(KAknsIIDQsnFrGridSideL);
    doSetDefaultHighlightedBackground(itemData, EGrid);
    itemData = skin->GetCachedItemData(KAknsIIDQsnFrGridSideR);
    doSetDefaultHighlightedBackground(itemData, EGrid);
    itemData = skin->GetCachedItemData(KAknsIIDQsnFrGridCenter);
    // override the list highlighted background color
    doSetDefaultHighlightedBackground(itemData, EGrid);
    }
    else if(EAknsITBitmap == imageData->Type() ||
    EAknsITMaskedBitmap == imageData->Type())
    {
    // override the list highlighted background color
    doSetDefaultHighlightedBackground(itemData, EGrid);

    }
    }
    }
    }

    // -----------------------------------------------------------------------------
    // CIUi::doSetDefaultHighlightedBackground
    // Set the list highlighted background color.
    // -----------------------------------------------------------------------------
    //
    void CUi::doSetDefaultHighlightedBackground(CAknsItemData* aItemData,
    TInt aDataType, TBool aClearData)
    {
    if(aItemData)
    {
    if(EAknsITMaskedBitmap == aItemData->Type())
    {
    CAknsMaskedBitmapItemData* imageData = static_cast<CAknsMaskedBitmapItemData*>(aItemData);

    CFbsBitmap* bmp = 0;
    CFbsBitmap* mask = 0;
    if(!aClearData)
    {
    TFileName mbmFilename(KBitmapFilename());
    User::LeaveIfError(CompleteWithAppPath(mbmFilename));

    TSize imageSize = ClientRect().Size();
    imageSize.iHeight >>= 1;
    if(aDataType == EGrid)
    AknIconUtils::CreateIconL(bmp, mask, mbmFilename, EMbmInhandBackground, EMbmInhandBackground_mask);
    else
    AknIconUtils::CreateIconL(bmp, mask, mbmFilename, EMbmInhandList_background, EMbmInhandList_background_mask);
    AknIconUtils::SetSize(bmp, imageSize);
    AknIconUtils::SetSize(mask, imageSize);
    }
    imageData->DestroyAndSetBitmap(bmp);
    imageData->DestroyAndSetMask(mask);
    }
    }
    }

  4. #4
    Regular Contributor
    Join Date
    Mar 2008
    Posts
    226

    Re: CAknGrid Issues

    Some one pls help

    I am facing two issues with the CAknGrid.
    1. On N95: I am trying to change the highlighted grid text to red by the following code
    colorTableEntry[EAknsCIQsnTextColorsCG11].m_indexed = KErrNotFound;
    colorTableEntry[EAknsCIQsnTextColorsCG11].m_rgb = KRgbRed.Value();
    It works fine in Emulator but not happening on N95.

    2. On E65: Grid text is not getting displayed at all on E65 for the same application.

    Thanks.
    Jinu

Similar Threads

  1. Nokia 6085 - Push Registry Issues
    By alam.sher in forum Mobile Java Networking & Messaging & Security
    Replies: 9
    Last Post: 2009-02-10, 21:09
  2. Help : CAknGrid gives me "No Data"
    By Mark-07 in forum Symbian User Interface
    Replies: 1
    Last Post: 2008-12-19, 06:34
  3. Windows Vista Issues and Patches
    By synchrnzr in forum Symbian Tools & SDKs
    Replies: 3
    Last Post: 2007-07-23, 06:29
  4. N91 WiFi (WLAN) and Bluetooth Issues.
    By danscoop in forum General Development Questions
    Replies: 12
    Last Post: 2007-06-05, 20:07
  5. 3gp streaming issues
    By njahan in forum Streaming and Video
    Replies: 0
    Last Post: 2006-11-02, 19:05

Posting Permissions

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