wxListCtrl Horizontal Scroll of images only?

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
faradayent
Earned a small fee
Earned a small fee
Posts: 19
Joined: Sat Dec 12, 2009 3:13 am

wxListCtrl Horizontal Scroll of images only?

Post by faradayent » Thu Jun 12, 2014 8:37 pm

I want to display dozens of small images in a box, horizontally only, with a horizontal scroll bar.

I built a small app using wxListCtrl and can put lots of images in it (SetImageList then multiple InsertItem), but the box will only display 5 images in a line, then wraps to a new line and puts the next 5 there, etc.

Is there any way to disable the vertical scroll bar, and display a horizontal bar to accomplish this?

A better approach?

Rusty at Widgets, appreciate your help.

User avatar
doublemax
Moderator
Moderator
Posts: 15174
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: wxListCtrl Horizontal Scroll of images only?

Post by doublemax » Thu Jun 12, 2014 11:05 pm

I don't think this is possible with wxListCtrl.

Alternatives:
a) Up to a count of around 200-400 images, you could just use a "normal" wxScrolledWindow and a horizontal wxBoxSizer and add the images as wxStaticBitmap or wxBitmapButton

b) For more images, i'd suggest a "virtual" control, e.g. wxHScrolledWindow. But this requires more management code on your side.
http://docs.wxwidgets.org/trunk/classwx ... indow.html
Use the source, Luke!

faradayent
Earned a small fee
Earned a small fee
Posts: 19
Joined: Sat Dec 12, 2009 3:13 am

Re: wxListCtrl Horizontal Scroll of images only?

Post by faradayent » Fri Jun 13, 2014 5:37 am

Thanks DoubleMax. I'll give the first alternative a try.

Post Reply