Namespaces

Variants
Actions

Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

Change the listbox item mark position

From Wiki
Jump to: navigation, search
Article Metadata
Code ExampleArticle
Created: chenziteng (27 Sep 2009)
Last edited: hamishwillee (30 May 2013)

Keywords: listbox CAknSingleGraphicStyleListBox SetItemMarkPosition

Overview

This article takes CAknSingleGraphicStyleListBox as an example to describe how change the item mark position of a S60 listbox by SetItemMarkPosition()

Source Code

Normally the CAknSingleGraphicStyleListBox with marks looks like this (note that the mark position is column one):

Click to download the sample app MulsList.zip

CAknSingleGraphicStyleListBox.JPG

But you can change the mark position to the last column,

Click to download the sample app MulsList(2).zip

CAknSingleGraphicStyleListBox(2).JPG

The changes include:

1. Use SetItemMarkPosition() to set the new mark position

void CMulsListContainer::SizeChanged()
{
iListBox->SetRect(Rect());
iListBox->ItemDrawer()->SetItemMarkPosition(2); // set the new mark position
}

2. Update the format strings

//    _LIT(KItemFormat, "1\tRecord%d\t2"); // "1\tLabel1\tIcon1"
_LIT(KItemFormat, "2\tRecord%d\t1"); // "Icon1\tLabel1\t1"

You can also compare the two sample applications to see the changes.

This page was last modified on 30 May 2013, at 04:37.
42 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×