×

Discussion Board

Page 2 of 2 FirstFirst 12
Results 16 to 21 of 21
  1. #16
    Registered User
    Join Date
    Nov 2012
    Posts
    34

    Re: can i make a custom control

    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

  2. #17
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    3,956

    Re: can i make a custom control

    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)

  3. #18
    Registered User
    Join Date
    Nov 2012
    Posts
    34

    Re: can i make a custom control

    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;

  4. #19
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,567

    Re: can i make a custom control

    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: http://www.developer.nokia.com/Commu...s_in_a_Control, http://www.developer.nokia.com/Commu...nabled_devices, http://www.developer.nokia.com/Commu...ymbian_C%2B%2B, and for HandlePointerEventL in general: http://www.developer.nokia.com/Commu...ymbian_C%2B%2B, http://www.developer.nokia.com/Commu...Custom_Control, http://www.developer.nokia.com/Commu...opup_edit_menu, http://www.developer.nokia.com/Commu...touch_gestures just to pick some apparently sane ones.

  5. #20
    Registered User
    Join Date
    Nov 2012
    Posts
    34

    Re: can i make a custom control

    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.
    Last edited by sandeepmhptr3; 2012-12-15 at 09:25.

  6. #21
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    3,956

    Re: can i make a custom control

    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:
    http://www.developer.nokia.com/Commu...tainer_control

    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)

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Custom control in form
    By patriot2009 in forum Symbian User Interface
    Replies: 1
    Last Post: 2012-05-03, 10:37
  2. Custom Tab Control
    By fazlay.rabbi in forum Symbian User Interface
    Replies: 2
    Last Post: 2011-02-23, 05:44
  3. Custom control doesn't display in a custom dialog
    By curiouswalker in forum Symbian User Interface
    Replies: 9
    Last Post: 2010-07-14, 06:20
  4. custom control help!!!!!!!!!!!!!
    By raj8nokiaforum in forum Symbian C++
    Replies: 13
    Last Post: 2009-06-08, 04:33
  5. Custom Tab Control
    By murthy.pramod in forum Symbian User Interface
    Replies: 2
    Last Post: 2008-11-05, 09:47

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •