Got a bit of a problem. Was playing around with listboxes and created a CAknSingleNumberStyleListBox, which I got to work quite nicely, but then I decided to try out CAknDoubleNumberStyleListBox, and here's where I bumped into the problem. It works fine, apart from the scoll indicators which are nowhere to be seen.
The only thing I changed was the class I use for the listbox (and the formatting of the items of course).
I call CreateScrollBarFrameL() and SetScrollBarVisibilityL() as normal, and I call SetMopParent() when creating my container. Anyone got any ideas what could be missing?
If I switch back to CAknSingleNumberStyleListBox the scroll indicators appear again. Is the double style one a special case or something?
Thanks for the help guys, but it still doesn't seem to work I'm afraid. Tried calling both SetMopParent() and UpdateScrollBarsL(),
but still no scroll indicators. Here's the code. As far as I can see it should work fine, but maybe I've missed something:
iListbox = new (ELeave) CAknDoubleNumberStyleListBox;
Any thoughts? The only thing I can think of is that maybe some of the functions need to be called in different order, but I've tried a bunch of combinations already, including creating the scrollbar before adding the items and after SetRect(). Ah well, nothing is ever simple is it? :-)
Yep, the code is from the ConstructL() of my container class, which is instantiated in my AppUi class, and yes, I do call SetMopParent() on the container class just as in your example.
And that's the bugger, it should work shouldn't it? It does seem to work for some listbox classes. In fact, by the looks of it single style listboxes do not seem to have any problems with the scroll indicators. I get them to display even without calling SetMopParent() and UpdateScrollBarsL() on the listbox, but as soon as I change to a double style list, poof! the scroll indicators are no more.
The problem is that the SetMopParent() in the AppUi is called after the listbox has been constructed. I have two solutions that worked for me:
1.) call SetMopParent() for the container inside ConstructL() of the view:
void CHelloWorldAppView::ConstructL(const TRect& aRect)
// Create a window for this application view