From 8f23c28713735c2f2f5fc70cc3961a25bc5d9c62 Mon Sep 17 00:00:00 2001 From: Francesco Montorsi Date: Mon, 29 Dec 2008 00:39:12 +0000 Subject: [PATCH] call SetLabel() in Create() in order to run markup/ellipsization-support code git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57627 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/stattext.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/msw/stattext.cpp b/src/msw/stattext.cpp index c16b89c12b..7a20a94ae0 100644 --- a/src/msw/stattext.cpp +++ b/src/msw/stattext.cpp @@ -94,9 +94,18 @@ bool wxStaticText::Create(wxWindow *parent, if ( !CreateControl(parent, id, pos, size, style, wxDefaultValidator, name) ) return false; - if ( !MSWCreateControl(wxT("STATIC"), label, pos, size) ) + if ( !MSWCreateControl(wxT("STATIC"), wxEmptyString, pos, size) ) return false; + // we set the label here and not through MSWCreateControl() because we + // need to do many operation on it for ellipsization&markup support + SetLabel(label); + + // 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 + // focusing by TAB traversal (e.g. wxPanel). + return true; } -- 2.45.2