×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Registered User
    Join Date
    Sep 2008
    Posts
    3

    Exclamation Display icons in Grid

    Dear all,

    I think I have encount several problem when display the grid.
    And I am using carbide 3.1 in visual studio 2005.

    1)VS provided a edit multi-icon definition when right click on teh miflist. Therefore, I used it, and it will generate the mbm/mbg. I assume it generate correct enum in the mbg although, the number started from 16384...

    when I use where EMbmGrid1Fonetvcustom is a svg file :

    AknIconUtils::CreateIconLC( GridEmailcustom,
    GridEmailcustomM,
    imagePath,
    EMbmGrid1Fonetvcustom_m,
    -1 );

    CGulIcon* markIcon = CGulIcon::NewL( GridEmailcustom, GridEmailcustomM );

    again no panic code happened.

    but for bmp file, there is no way I can get pass this line. Most of the time I have is system error (-1001);

    2)it leaves after

    iGrid->HandleItemAdditionL();

    code were follow
    http://wiki.forum.nokia.com/index.php/Grid_example

  2. #2
    Registered User
    Join Date
    Sep 2008
    Posts
    3

    Re: Display icons in Grid

    One more thing I am not sure, Is that it generate mif,mbm.
    for the imagePath above, should I use mif/mbm

  3. #3
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,170

    Re: Display icons in Grid

    With Mif files the index starts usually with quite high number, but with MBM's the index should start with zero, so check that you are using correct index for different types of image files.

  4. #4
    Registered User
    Join Date
    Sep 2008
    Posts
    3

    Re: Display icons in Grid

    thx there, at least I learnt something about the mbg...

  5. #5
    Registered User
    Join Date
    Jun 2008
    Posts
    21

    Re: Display icons in Grid

    _LIT(KMyExFileName,"z:\\resource\\apps\\Gridtest1.mbm");
    CFbsBitmap* aBitmap = new (ELeave) CFbsBitmap();
    CleanupStack::PushL(aBitmap);
    User::LeaveIfError(aBitmap->Load(KMyExFileName, 0));
    gc.DrawBitmap(drawRect,aBitmap);
    CleanupStack::PopAndDestroy();

    after several days revisit, I have ensured that the mbm path is correct as the above display icons in the screen.

    For the grid... following the example:...

    http://wiki.forum.nokia.com/index.php/Grid_example

    however, nothing show up when run, and if any navigation key presses, AknGridView 6 panics...

  6. #6
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,170

    Re: Display icons in Grid

    have you modified the code ?
    Also how many icons do you have & what index values are you using in the text array.

  7. #7
    Registered User
    Join Date
    Jun 2008
    Posts
    21

    Re: Display icons in Grid

    For the GetArrayL function, I implemented as below, with only one icon mbm added to the grid. Could it be the "CreateIconLC"
    not quite correct

    Thanks

    CDesCArray* CGridtestView::GetArrayL(CArrayPtr<CGulIcon>* aIcon,
    const TSize& aIconsize)
    {
    CDesCArrayFlat* MyArray = new(ELeave)CDesCArrayFlat(1);

    CleanupStack::PushL(MyArray);

    MyArray->AppendL( _L("1\tItem1") );
    MyArray->AppendL( _L("1\tItem2") );
    MyArray->AppendL( _L("1\tItem3") );
    MyArray->AppendL( _L("1\tItem4") );
    MyArray->AppendL( _L("1\tItem5") );
    MyArray->AppendL( _L("1\tItem6") );
    MyArray->AppendL( _L("1\tItem7") );
    MyArray->AppendL( _L("1\tItem8") );
    MyArray->AppendL( _L("1\tItem9") );
    MyArray->AppendL( _L("1\tItem10") );

    CFbsBitmap* GridEmailcustom = NULL;
    CFbsBitmap* GridEmailcustomM = NULL;


    TFileName fullName(imagePath);
    //CompleteWithAppPath(fullName);//

    AknIconUtils::CreateIconLC( GridEmailcustom,
    GridEmailcustomM,
    imagePath,
    0,
    1 );
    CGulIcon* markIcon = CGulIcon::NewL( GridEmailcustom, GridEmailcustomM );
    CleanupStack::Pop( 2 ); // gridMarkIcon, gridMarkIconMask
    CleanupStack::PushL( markIcon );
    aIcon->AppendL( markIcon );

    // Append Text string to MyArray in here as "1\tMytext",
    // where 1 is the zero based icon index
    // also remember to load and add icons in here... and also set them
    // to the right size */
    CleanupStack::Pop(markIcon);
    CleanupStack::Pop(MyArray);
    return MyArray;
    }

  8. #8
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,170

    Re: Display icons in Grid

    at least the indexing for icons is zero based, thus change the index 1 to 0 and it has a chance on working with only one icon in the icon array.

Similar Threads

  1. Nokia N-Series Complete Model Line-Up
    By Dopod in forum General Development Questions
    Replies: 6
    Last Post: 2008-07-22, 20:16
  2. How can we display a grid after click on a list box
    By jyotideep in forum Symbian User Interface
    Replies: 5
    Last Post: 2006-12-14, 04:59
  3. How to display different .bmps in different items of same Grid as icon
    By jyotideep in forum Symbian User Interface
    Replies: 0
    Last Post: 2006-12-13, 10:05
  4. Display jpeg on grid list gives kern-exec 3?
    By flicker82 in forum Symbian User Interface
    Replies: 1
    Last Post: 2005-01-18, 05:18

Posting Permissions

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