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:
...Get the current control from the model...
control = (*(iModel->ItemArray())[aItemIndex];
...Set the controls background based on whether it is current...
... set the backgroung etc....
// Finally, draw the item
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?