/////////////////////////////////////////////////////////////////////////////
-// Name: univ/stattext.cpp
+// Name: src/univ/stattext.cpp
// Purpose: wxStaticText
// Author: Vadim Zeitlin
// Modified by:
// headers
// ----------------------------------------------------------------------------
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
- #pragma implementation "univstattext.h"
-#endif
-
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#if wxUSE_STATTEXT
+#include "wx/stattext.h"
+
#ifndef WX_PRECOMP
#include "wx/dcclient.h"
- #include "wx/stattext.h"
#include "wx/validate.h"
#endif
const wxString &name)
{
if ( !wxControl::Create(parent, id, pos, size, style, wxDefaultValidator, name) )
- return FALSE;
-
+ return false;
+
SetLabel(label);
- SetBestSize(size);
+ SetInitialSize(size);
- return TRUE;
+ return true;
}
// ----------------------------------------------------------------------------
// size management
// ----------------------------------------------------------------------------
-void wxStaticText::SetLabel(const wxString& label)
-{
- wxControl::SetLabel(label);
-}
-
wxSize wxStaticText::DoGetBestClientSize() const
{
wxStaticText *self = wxConstCast(this, wxStaticText);
renderer->DrawLabel();
}
+void wxStaticText::SetLabel(const wxString& str)
+{
+ // save original label
+ m_labelOrig = str;
+
+ // draw as real label the result of GetEllipsizedLabelWithoutMarkup:
+ DoSetLabel(GetEllipsizedLabelWithoutMarkup());
+}
+
+void wxStaticText::DoSetLabel(const wxString& str)
+{
+ UnivDoSetLabel(str);
+}
+
+wxString wxStaticText::DoGetLabel() const
+{
+ return wxControl::GetLabel();
+}
+
+/*
+ FIXME: UpdateLabel() should be called on size events to allow correct
+ dynamic ellipsizing of the label
+*/
+
#endif // wxUSE_STATTEXT