For those previously following the thread of my learning the toolbar (and
putting two on a panel), I've another question.
I've done the above, got my bitmaps on and have noticed that the separators
are always blank. Sometimes one would like a separator that contains a faint
vertical line, to visually separate off logical button groupings.
I can easly contructed a bitmap and place on an ordinary button to acheive
this look,however it takes up a complete button width, not a separator width.
Is it possibe to acheive this on an ordinary separator, as I couldn't find in
the docs how to add a bitmap?
Thanks for any replies.
Dr Richard Terry
gnuMed Project.
I've done the above, got my bitmaps on and have noticed that the
separators
are always blank. Sometimes one would like a separator that
contains a faint
vertical line, to visually separate off logical button groupings.
Can't this be achieved with the wxStaticLine class? Something like ...
****COMPLETELY UNTESTED*****
toolbar.AddControl(wxStaticLine(parent, -1, style = wxLI_VERTICAL))
****COMPLETELY UNTESTED*****
// Jeff Grimmett
// http://www.livejournal.com/users/grimmtooth/
`--------------------------------------------'
richard terry wrote:
I've done the above, got my bitmaps on and have noticed that the separators
are always blank. Sometimes one would like a separator that contains a faint
vertical line, to visually separate off logical button groupings.
I'm assuming you used:
wxToolBar.AddSeparator
From the docs:
"""Due to the use of native toolbars on the various platforms, certain
adaptions will often have to be made in order to get optimal look on all
platforms as some platforms ignore the values for explicit placement and
use their own layout and the meaning of a "separator" is a vertical line
under Windows95 vs. simple space under GTK etc.
"""
If you are using GTK, that explains the space.
You can probably use wxToolBar.AddControl to add a wxStaticBitmap, that
had a picture of the line you want, and is the sizeyou want. I can't say
I've tried it, but I imagine it will work.
By the way, as you figure out many of these details, perhaps you could
put it all together into a Page for the Wiki...I'll help.
-Chris
···
--
Christopher Barker, Ph.D.
Oceanographer
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chris.Barker@noaa.gov
I did just make up my own bitmap as a separator (see png file enclosed),
however it wastes space as it occupies a whole buton width, and not the
smaller separator space.
···
On Thursday 30 May 2002 10:00 am, you wrote:
richard terry wrote:
> I've done the above, got my bitmaps on and have noticed that the
> separators are always blank. Sometimes one would like a separator that
> contains a faint vertical line, to visually separate off logical button
> groupings.
I'm assuming you used:
wxToolBar.AddSeparator
From the docs:
"""Due to the use of native toolbars on the various platforms, certain
adaptions will often have to be made in order to get optimal look on all
platforms as some platforms ignore the values for explicit placement and
use their own layout and the meaning of a "separator" is a vertical line
under Windows95 vs. simple space under GTK etc.
"""
If you are using GTK, that explains the space.
You can probably use wxToolBar.AddControl to add a wxStaticBitmap, that
had a picture of the line you want, and is the sizeyou want. I can't say
I've tried it, but I imagine it will work.
By the way, as you figure out many of these details, perhaps you could
put it all together into a Page for the Wiki...I'll help.
-Chris
"""Due to the use of native toolbars on the various platforms, certain
adaptions will often have to be made in order to get optimal look on all
platforms as some platforms ignore the values for explicit placement and
use their own layout and the meaning of a "separator" is a vertical line
under Windows95 vs. simple space under GTK etc.
"""
If you are using GTK, that explains the space.
I've recently created a toolbar under W2K and the seperator was a very
distinct empty space, so he ain't imagining things
*sounds* like we have an issue here...
(I decided to use a popup menu instead of a toolbar, anyway, so no big loss
for me..)
// Jeff Grimmett
// http://www.livejournal.com/users/grimmtooth/
`--------------------------------------------'
richard terry wrote:
I did just make up my own bitmap as a separator (see png file enclosed),
however it wastes space as it occupies a whole buton width, and not the
smaller separator space.
Since we've been talking about this, I tried a few experiments. Adding a
wxStaticBitmap to the toolbar worked just fine for me as a custom
separator, and it only takes up the width it should.
I've enclosed a small sample app that demonstrates a few tricks with
toolbars, including that one. Please take a look at it and make
suggestions (and send me code) for things to add, or changes to make to
make it more robust and/or elegant. In particular, it would be geat if
someone could test it out on Windows, as I've done it all in GTK/Linux.
I plan make a Wiki page out of it if people think it's useful.
-Chris
···
--
Christopher Barker, Ph.D.
Oceanographer
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chris.Barker@noaa.gov
opps, forgot to actually include the code.
see the attachment.
-Chris
toolbardemo.py (10.7 KB)
···
--
Christopher Barker, Ph.D.
Oceanographer
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chris.Barker@noaa.gov