Hi,
> > I try to create a virtual listcontrol for an image list. But there's no
> > call to virtually get the image.
>
> Sorry, what do you mean? You know about OnGetItemImage() existence, what
> is it if not a call to virtually get the image?
I read about it. I also read about SetImageList()
The point is, I read items from Database, which contain text as well as an
image. So I already have a list, that contains the images.
Therefore I expected something similar than OnGetItemText() - which returns
text from custom storage.
Unfortunately the return value of OnGetItemImage is only an index for an
internal list (which I have to create and populate). A function that directly
returns the image/bitmap would have been more helpful.
With your API I always have to copy images ...
> > Hm, is there some docs about the functions that need to get overridden
> > virtual mode?
> > I looked at listbox samples, but aparently I missed something.
>
> There is listctrl (not listbox) sample and the documentation of
> wxListCtrl, explaining how to use its virtual mode seems reasonably
> complete to me.
Well, when you know everything and just need the docs to refresh your memory
its an absolutely different situation.
For a beginner *imho* documentation is not complete
> > For that I subclassed wxListCtrl and added a wxVector which holds tuple
> > items with text and image. OnGetItemText returns that text.
> >
> > When I start that page, this error happens:
> >
> > ../include/wx/generic/private/listctrl.h(276): assert "!IsVirtual()"
> > failed in IsHighlighted(): unexpected call to IsHighlighted
>
> You'll have to reproduce this problem in some way to allow us to do
> something about it because the sample doesn't show it by default, even when
> using virtual mode.
Ok. You find my prototype at
https://github.com/DjangoReinhard/wxProto
The prototype is to become an application that is operated in full screen mode
via touchscreen - so the Frame-controls are just to ease development.
The screen is divided into three areas (from top to bottom):
- title area
- client area
- button bar
Title area contains some static texts, that should reflect current application
status (instead of using a status bar). The central static text widget shall
show the title of the current client area page.
That static text has style horizontally centered text.
The client area is a wxSimpleBook control, which flips the pages at button
press or application signal.
Buttons lead to these pages:
1) list control to show list of images (crashes the app)
2) login screen
3) calculator
4) input control
hitting leftmost button (1) will crash app.
------------------------------------------------------------------------
There are several issues found with this prototype:
------------------------------------------------------------------------
- static text control looses style (about centering its text)
change pages by clicking on some buttons from button bar. Whenever you hit
the same page for second time, static text in title control looses its
style information and text will be displayed left oriented instead of
centered.
- grid layout does not calculate growing columns
hit button 3 to display a page to enter a number. The number buttons are
all in a resizable grid column, thus all should have the same width.
- listCtrl
leftmost button starts a page, that should display a list created in
MainWindow (simulated database access).