My dynamic Listbox as a control is created. I can add element to it from anywhere.
how can I implement the following? which methods I have to override?
single selection
multiselection
highlighting selected row
scrolling
Printable View
My dynamic Listbox as a control is created. I can add element to it from anywhere.
how can I implement the following? which methods I have to override?
single selection
multiselection
highlighting selected row
scrolling
You can draw a 'Tick' icon in front of list item, whenever there's a touch event in the area of that particular list item. For key(up/down) event you can increase/decrease an index value& based on that, change the focus for that list item(take up a rectangular image which you would draw as a focus for list item, whenever there's key up/down or touch event)
which method do I need to over ride?
I tried with this inside offerkeyevent
but nothing happens
(I am using touch screen)
_LIT(KJ,"abc");
CConsoleBase* console;
switch(aType)
{
case EEventKeyUp:
console=Console ::NewL(KJ,TSize(20,10));
CleanupStack::PushL(console);
console->Printf(KJ);
console->Getch();
CleanupStack::PopAndDestroy();
return EKeyWasConsumed;
break;
case EEventKeyDown:
console=Console ::NewL(KJ,TSize(20,10));
CleanupStack::PushL(console);
console->Printf(KJ);
console->Getch();
CleanupStack::PopAndDestroy();
return EKeyWasConsumed;
break;
default :
return EKeyWasNotConsumed;
Touch screen does not generate key events, and raising the virtual keyboard is not really a good idea just for scrolling a list.
You may want to focus on pointer events, CCoeControl::HandlePointerEventL is a method receiving them. You can find some related examples in the Wiki, like for dragging: [url]http://www.developer.nokia.com/Community/Wiki/How_to_Enable/Disable_Drag_and_Move_Events_in_a_Control[/url], [url]http://www.developer.nokia.com/Community/Wiki/Enabling_drag_events_in_Symbian_C%2B%2B_on_touch-enabled_devices[/url], [url]http://www.developer.nokia.com/Community/Wiki/Interpolating_points_between_drag_events_using_Symbian_C%2B%2B[/url], and for HandlePointerEventL in general: [url]http://www.developer.nokia.com/Community/Wiki/Handling_pointer_events_in_Symbian_C%2B%2B[/url], [url]http://www.developer.nokia.com/Community/Wiki/How_to_Handle_Pointer_Events_in_a_Custom_Control[/url], [url]http://www.developer.nokia.com/Community/Wiki/Using_pointer_events_for_creating_popup_edit_menu[/url], [url]http://www.developer.nokia.com/Community/Wiki/Using_basic_touch_gestures[/url] just to pick some apparently sane ones.
selection of an item is done.
1> I need custom menupane- 2 options are there call, send voice message
a>when no item is selected both are disabled
b>when 1 item is selected both are enabled
c> when multiple items are selected only send voice message is enabled
I tried with DynInitMenuPanel in view, but no results.
DynInitMenuPanel should be good to do that. You can take up an integer variable & store the different states in that(For e.g: no item: iItemState=0, one selected: iItemState=1,&multiple:iItemState=2) & check for these values inside the DynInitMenuPanel & hide-unhide the menu option accordingly.
Also remember to use the MENU_PANE id(from rss) inside the DynInitMenuPanel not MENU_BAR
For scrolling you can implement a ScrollBar in your container, but you need to synchronize its movement with that of your custom listbox. A related wiki article is also present:
[url]http://www.developer.nokia.com/Community/Wiki/Using_scrollbars_in_Symbian_container_control[/url]
Alternatively as suggested you can also handle the drag case inside the HandlePointerEventL() for the movement of listbox(the up & down movement will depend on positioning the control)