Change the listbox item mark position
Article Metadata
Code Example
Source file: Media:MulsList(2).zip Media:MulsList.zip
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
But you can change the mark position to the last column,
Click to download the sample app MulsList(2).zip
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.


(no comments yet)