Text in ToolBarTool

Questions about wxWidgets running on MS.NET, mono or Portable.NET ? Ask it here !
Post Reply
dwmcqueen
Knows some wx things
Knows some wx things
Posts: 26
Joined: Thu Oct 28, 2004 11:02 am

Text in ToolBarTool

Post by dwmcqueen »

Is there a way to add text to a ToolBarTool so it appears right next to the Bitmap loaded? Specifically, I am trying to duplicate the SWF functionality of the System.Windows.Forms.ToolBarButton.Text property (which displays text next to the bitmap)
Bryan Bulten
In need of some credit
In need of some credit
Posts: 8
Joined: Thu Oct 28, 2004 11:45 pm
Location: Victoria, BC, Canada
Contact:

Post by Bryan Bulten »

Do you mean like in this screenshot http://wxnet.sourceforge.net/screenshot ... l-gtk2.jpg ?

Create the toolbar with the wx.ToolBar.wxTB_TEXT style. I don't think wxWidgets has a way to put the text beside the icon though.
dwmcqueen
Knows some wx things
Knows some wx things
Posts: 26
Joined: Thu Oct 28, 2004 11:02 am

Yep

Post by dwmcqueen »

That's it - except I would like it to the right of the icon. But you pointed me in the correct direction...
dwmcqueen
Knows some wx things
Knows some wx things
Posts: 26
Joined: Thu Oct 28, 2004 11:02 am

Post by dwmcqueen »

How in that app are the toolbar buttons without borders? My toolbarbuttons look just like individual buttons (yet I want them to look like how they apeear in PhotoTool w/o borders). I hav even looked at that source an I am doing the same thing...
Bryan Bulten
In need of some credit
In need of some credit
Posts: 8
Joined: Thu Oct 28, 2004 11:45 pm
Location: Victoria, BC, Canada
Contact:

Post by Bryan Bulten »

It's from the wxTB_FLAT style, which is supported on Windows and GTK only (according to the wxWidgets documentation).
dwmcqueen
Knows some wx things
Knows some wx things
Posts: 26
Joined: Thu Oct 28, 2004 11:02 am

Post by dwmcqueen »

I was trying my app in Windows and that is where I noticed it not being flat. Is there a certain version of wxWidgets required?
Bryan Bulten
In need of some credit
In need of some credit
Posts: 8
Joined: Thu Oct 28, 2004 11:45 pm
Location: Victoria, BC, Canada
Contact:

Post by Bryan Bulten »

Not that I know of. The app in the screenshot was compiled with a wxWidgets version of 2.5.something. So I'm not really sure what's going on - I don't have a Windows box to test it on again at the moment.
dwmcqueen
Knows some wx things
Knows some wx things
Posts: 26
Joined: Thu Oct 28, 2004 11:02 am

Figured it out!

Post by dwmcqueen »

When I use the Mono runtime, I get a toolbar that looks like your screenshots (without the button borders). It is only when using the Microsoft.Net framework is when the toolbar looks screwy.

So either Mono is doing something that .Net isn't (and doing it better), or something is strange with wx.net and MS .NET. Either way, I figured it out.
Post Reply