+#ifdef SS_ENDELLIPSIS
+ long styleReal = ::GetWindowLong(GetHwnd(), GWL_STYLE);
+ if ( HasFlag(wxST_ELLIPSIZE_END) &&
+ wxGetOsVersion() == wxOS_WINDOWS_NT )
+ {
+ // adding SS_ENDELLIPSIS or SS_ENDELLIPSIS "disables" the correct
+ // newline handling in static texts: the newlines in the labels are
+ // shown as square. Thus we don't use it even on newer OS when
+ // the static label contains a newline.
+ if ( label.Contains(wxT('\n')) )
+ styleReal &= ~SS_ENDELLIPSIS;
+ else
+ styleReal |= SS_ENDELLIPSIS;
+
+ ::SetWindowLong(GetHwnd(), GWL_STYLE, styleReal);
+ }
+ else // style not supported natively
+ {
+ styleReal &= ~SS_ENDELLIPSIS;
+ ::SetWindowLong(GetHwnd(), GWL_STYLE, styleReal);
+ }
+#endif // SS_ENDELLIPSIS
+
+ // save the label in m_labelOrig with both the markup (if any) and
+ // the mnemonics characters (if any)
+ m_labelOrig = label;
+
+#ifdef SS_ENDELLIPSIS
+ if ( styleReal & SS_ENDELLIPSIS )
+ DoSetLabel(GetLabel());
+ else
+#endif // SS_ENDELLIPSIS
+ DoSetLabel(GetEllipsizedLabel());
+
+ // adjust the size of the window to fit to the label unless autoresizing is
+ // disabled
+ if ( !HasFlag(wxST_NO_AUTORESIZE) &&
+ !IsEllipsized() ) // if ellipsize is ON, then we don't want to get resized!
+ {
+ InvalidateBestSize();
+ DoSetSize(wxDefaultCoord, wxDefaultCoord, wxDefaultCoord, wxDefaultCoord,
+ wxSIZE_AUTO_WIDTH | wxSIZE_AUTO_HEIGHT);
+ }
+}
+
+bool wxStaticText::SetFont(const wxFont& font)
+{
+ bool ret = wxControl::SetFont(font);