Don't create labels with wxST_NO_AUTORESIZE flag with empty size by default.

Since r57627 wxStaticText objects with wxST_NO_AUTORESIZE flag created with
wxDefaultSize were created with zero width. This accounted for the
disappearance of the labels for the toolbar controls (as could be seen in the
toolbar sample where the combobox label was not shown any more).

Fix this by explicitly setting the correct initial size after the correct
label is set.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62935 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2009-12-18 22:31:54 +00:00
parent 8c118ca4cb
commit fab9753681

View File

@ -101,6 +101,11 @@ bool wxStaticText::Create(wxWindow *parent,
// need to do many operation on it for ellipsization&markup support
SetLabel(label);
// as we didn't pass the correct label to MSWCreateControl(), it didn't set
// the initial size correctly -- do it now
InvalidateBestSize();
SetInitialSize(size);
// NOTE: if the label contains ampersand characters which are interpreted as
// accelerators, they will be rendered (at least on WinXP) only if the
// static text is placed inside a window class which correctly handles