Namespaces
Variants
Actions

Change the listbox item mark position

Jump to: navigation, search
Article Metadata

Code Example
Article
Created: chenziteng (27 Sep 2009)
Last edited: hamishwillee (18 Sep 2012)

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 18 September 2012, at 08:59.
151 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved