[ wxwindows-Bugs-1665390 ] wxStaticText cannot be centered vertically
in wxToolBar
SourceForge.net
noreply at sourceforge.net
Wed Feb 13 21:32:25 PST 2008
Bugs item #1665390, was opened at 2007-02-21 08:23
Message generated for change (Settings changed) made by pcor
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1665390&group_id=9863
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: wxGTK specific
Group: Must fix
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: Stefan Scheler (sscheler)
Assigned to: Nobody/Anonymous (nobody)
Summary: wxStaticText cannot be centered vertically in wxToolBar
Initial Comment:
When a wxStaticText is added to a wxToolBar via AddControl, it is not vertically centered. It's aligned to the top instead. And there is apparently no way to change the position. This looks very ugly if you try to add a label to e.g. a wxComboBox.
Please fix and let me know if you need further details. Thank you.
----------------------------------------------------------------------
>Comment By: Paul Cornett (pcor)
Date: 2008-02-13 21:32
Message:
Logged In: YES
user_id=1084745
Originator: NO
Fixed in trunk and 2.8 branch.
----------------------------------------------------------------------
Comment By: p_michalczyk (p_michalczyk)
Date: 2007-02-22 14:17
Message:
Logged In: YES
user_id=1409236
Originator: NO
I've checked, that assuming source available in CVS all controls added to
wxToolBar are centered verticaly. However, current implementation of
wxToolBar has significant error that makes impossible adding some controls
with wxDefaultSize (namely wxStaticText). wxToolBar works without problems
only with wxStaticText (and possibly other controls) which have specified
size. I will try to get rid of this bug ASAP.
----------------------------------------------------------------------
Comment By: Stefan Scheler (sscheler)
Date: 2007-02-22 06:32
Message:
Logged In: YES
user_id=1385950
Originator: YES
2.10.7
----------------------------------------------------------------------
Comment By: p_michalczyk (p_michalczyk)
Date: 2007-02-22 06:23
Message:
Logged In: YES
user_id=1409236
Originator: NO
And what is your version of libGTK?
----------------------------------------------------------------------
Comment By: Stefan Scheler (sscheler)
Date: 2007-02-22 05:41
Message:
Logged In: YES
user_id=1385950
Originator: YES
> StaticText looks like it is aligned to top because its height is same
> as height of toolbar. And StaticText doesn't center its text on itself.
> Try to specify smaller StaticText height and see results.
That doesn't help :). I tried that before.
> BTW what version of wxWidgets are you using (I use CVS WX_2_8_BRANCH)?
I'm using 2.8.0 from the wxwidgets website.
> It seems to me that all controls placed on toolbar are vertically
centered.
Hmm, try also a wxComboBox. It's vertically maximized here.
----------------------------------------------------------------------
Comment By: p_michalczyk (p_michalczyk)
Date: 2007-02-22 05:15
Message:
Logged In: YES
user_id=1409236
Originator: NO
I am still investigating this problem. It seems to me that all controls
placed on toolbar are vertically centered. StaticText looks like it is
aligned to top because its height is same as height of toolbar. And
StaticText doesn't center its text on itself. Try to specify smaller
StaticText height and see results. BTW what version of wxWidgets are you
using (I use CVS WX_2_8_BRANCH)?
What I found harmful is that it is impossible to add to toolbar controls
with wxDefaultSize specified. This simply starts endless loop, which I'm
investigating right now. Seems to me that you don't have that problem. Once
againg wxWidgets version could explain something.
----------------------------------------------------------------------
Comment By: Stefan Scheler (sscheler)
Date: 2007-02-22 04:57
Message:
Logged In: YES
user_id=1385950
Originator: YES
The whole adding-controls-to-toolbar-thing doesn't work to well imho. If I
add a wxComboText and a wxTextCtrl with same size parameters, they all look
totally different. wxTextCtrl looks as expected, wxComboBox is vertically
stretched and wxStaticText is aligned to the top. And there's apparently no
way to change that behaviour. That's frustrating.
----------------------------------------------------------------------
Comment By: Stefan Scheler (sscheler)
Date: 2007-02-21 08:48
Message:
Logged In: YES
user_id=1385950
Originator: YES
This is what I basically want to do:
wxToolBar *toolbar = new wxToolBar(this, wxID_ANY, wxDefaultPosition,
wxDefaultSize,
wxBORDER_NONE|wxTB_HORIZONTAL|wxTB_NODIVIDER|wxTB_FLAT|wxEXPAND);
wxStaticText *text = new wxStaticText(toolbar, wxID_ANY, _T("Path:"),
wxDefaultPosition, wxDefaultSize, 0, _T("staticText"));
toolbar->AddControl(text);
wxTextCtrl *textctrl = new wxTextCtrl(toolbar, -1, _T("/"),
wxDefaultPosition, wxSize(200, 24) , wxTE_PROCESS_ENTER,
wxDefaultValidator, wxTextCtrlNameStr);
toolbar->AddControl(textctrl)
Please see the attached file. Maybe the problem is GTK-related? GTK
doesn't seem to center the text of a label in the surrounding "box".
File Added: toolbar.png
----------------------------------------------------------------------
Comment By: p_michalczyk (p_michalczyk)
Date: 2007-02-21 08:35
Message:
Logged In: YES
user_id=1409236
Originator: NO
Please send some example code showing described problem.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1665390&group_id=9863
More information about the wx-dev
mailing list