+#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
+
+ // this call will save the label in m_labelOrig and set it into this window
+ // (through wxWindow::SetLabel)
+ m_labelOrig = label;
+
+#ifdef SS_ENDELLIPSIS
+ if ( styleReal & SS_ENDELLIPSIS )
+ DoSetLabel(RemoveMarkup(label));
+ else
+#endif // SS_ENDELLIPSIS
+ DoSetLabel(GetEllipsizedLabelWithoutMarkup());