×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    2

    drawing composite controls within CListItemDrawer::DrawActual Item

    I've attempted to create a ListBox of items that are fairly complex to draw (more so than an icon and text), and therefore are represented internally as composite controls.

    In doing so I've derived CEikListBox, CListItemDrawer, and MListBoxModel, overriding a minimum number of methods.

    Rather than reimplement the drawing of these item controls in the CListItemDrawer::DrawActualItem, which I'm not sure I'd be able to accomplish, I'm attempting to call the control's ::DrawNow function instead.

    The following psuedocode illustrates:
    void CDerivedListItemDrawer::DrawActualItem(...)
    {
    ...Get the current control from the model...
    control = (*(iModel->ItemArray())[aItemIndex];

    ...Set the controls background based on whether it is current...
    if (aItemIsCurrent)
    ... set the backgroung etc....

    // Finally, draw the item
    control->SetRect(aActualItemRect);
    control->DrawNow();
    }

    The symptoms of the problem are as follows:

    The CEikListBox border is drawn, but the item is not. When DrawActualItem is changed to draw a black rectangle, then a black rectangle appears -- the DrawActualItem method is being called correctly. I've also tried changing DrawNow() to DrawDeferred() and even Draw().

    Interestingly, even when DrawNow is called on the item, its CountComponentControls and ComponentControl methods are never called. Is what I am trying to do feasible?

    -Josh

  2. #2
    Registered User
    Join Date
    Jul 2003
    Posts
    7
    Were u able to display ur controls using the Listbox...Pl let me know how u did it

Posting Permissions

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