wxToolBar Bitmap Issue Topic is solved

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
miclus
Can't get richer than this
Can't get richer than this
Posts: 741
Joined: Tue Mar 31, 2009 2:11 am

wxToolBar Bitmap Issue

Post by miclus » Fri Oct 23, 2009 3:52 am

Hi. When my toolbar starts out, it looks like this:

http://duke3d.org/before.png

But, when I click a button and set its normal bitmap to another one of the same size, it looks like this:

http://duke3d.org/after.png

It seems to have extended the grey to the right. Any ideas why?

Also, is there a way to get rid of the grey part underneath the buttons?

spectrum
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 207
Joined: Sat Jul 21, 2007 12:17 pm

Post by spectrum » Fri Oct 23, 2009 11:15 am

hi miclus,

seems there is a logic in this, the toolbar seems to resize all the buttons to new different size button.
wxToolBar::SetToolBitmapSize

void SetToolBitmapSize(const wxSize& size)

Sets the default size of each tool bitmap. The default bitmap size is 16 by 15 pixels.
I would solve this using bitmaps of the same 16x15 size, or setting the new size with SetToolBitmapSize.

In this way you should not see the gray part, or anyway, you can try wxTB_FLAT style.

regards,
spectrum

Post Reply