How to create MultiSelectionListBox or Markable ListBox?
| Wed, 2007-10-17 09:15 | |
|
Please see the code.ListBox is created having checkBoxes.But in CheckBoxes Iam getting cross marks.But I want tick marks in checkBoxes.Is there any mistake in code.
|
|






Forum posts: 10
hi ,
To create a check box with tick mark you will have to get customised icon with on state shown by tick mark in it,compile it to create .mbm file and include in u r application .
In avkon.mbg (EMbmAvkonQgn_prop_checkbox_on ) is check box image icon with cross
to show on state .
Forum posts: 71
hi i created the Multiselectlist box.. however the listbox control is not handling the selection of item..
is there a seperate code that i need to write to do the same in Offerkeyevent or Handlelistboxeventl ?
Thanks
Forum posts: 65
Hi Sohil,
If u have sample code pls post it.
Forum posts: 71
Thanks shilpa for replying..
here is the code below...
i m using a listbox and find box
//container constructl code...
iContactListBox = new (ELeave) CAknSingleGraphicStyleListBox;
iContactListBox->ConstructL(this,EAknListBoxMultiselectionList);
iContactListBox->SetContainerWindowL(*this);
iContactListBox->SetListBoxObserver(this);
iContactListBox->SetCurrentItemIndex( 0 );
iContactListBox->CreateScrollBarFrameL(ETrue);
iContactListBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto);
iContactListBox->ActivateL();
iContactListBox->DrawNow();
iFilteredTextListBoxModel = static_cast<CAknFilteredTextListBoxModel*>( iContactListBox->Model() );
iFindBox = CAknSearchField::NewL( *this, CAknSearchField::EFixed, NULL, 30 );
CleanupStack::PushL(iFindBox);
iContactListBox->SetContainerWindowL(*this);
iFilteredTextListBoxModel->CreateFilterL( iContactListBox, iFindBox );
CleanupStack::Pop(iFindBox);
iFindBox->MakeVisible(ETrue);
iFindBox->SetFocus(ETrue);
iFindBox->ActivateL();
iFindBox->DrawNow();
SizeChanged();
CAknIconArray* icons =new(ELeave) CAknIconArray(2);
CleanupStack::PushL(icons);
icons->ConstructFromResourceL(R_ICON_TESTICONS);
// Sets graphics as ListBox icon.
iContactListBox->ItemDrawer()->ColumnData()->SetIconArray(icons);
CleanupStack::Pop(); // icons
//offerkeyevent code
if (iContactListBox)
{
iFindBox->OfferKeyEventL(aKeyEvent, aType);
// if it's enter or ok key Container::cmdMark will handle it
if (!( aKeyEvent.iCode == EKeyEnter || aKeyEvent.iCode == EKeyOK))
{
iContactListBox->OfferKeyEventL (aKeyEvent, aType);
}
return EKeyWasNotConsumed;
}
Please sugget me if i m making a mistake..
also i have not put down any code in handlelistboxeventl function
Thanks...
Forum posts: 71
in the above earlier post i had by mistake mentioned i have create a markable listbox however i m creating a multiselection slist box...which i have modified in the above post also
Thanks for the help...
Forum posts: 148
Hi
Take a look at
http://www.newlc.com/article.php3?id_article=240
and I am not remember the exact name but there is a handle for Markable listbox also . I think it is HandleMarkableListDynInitMenuItem not sure just check it out.
Regards
Isha
"To the question of your life , you are the only Answer. To the problems of your life,you are the only Solution".
Forum posts: 71
Thank you for getting that into my notice...
Appreciate your help
Forum posts: 71
hi will browsing thru api's i came across this api
IMPORT_C void AknSelectionService::HandleMarkableListProcessCommandL ( TInt aCommand,
CEikListBox * aListBox
) [static]
however could not get what command i should send to the function to make it work ?
any one put put some light on the same will be a great help..
thanks...
Forum posts: 148
Again I am not remember the exact name as I haven't SDK but I can give you hint that may help you...
EAknMarkAll
EAknMark
EAknUnMarkALL
EAknUnMark
You have four option in menu i.e mark , markall ,unmark , unmarkall and handle these in HandleCommandl () and from there call that handle ans pass the corresponding command.
Regards
Isha
"To the question of your life , you are the only Answer. To the problems of your life,you are the only Solution".
Forum posts: 65
Hi Sohil,
Thanks for ur help.What u have written in R_ICON_TESTICONS.Pls post it.