projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added named section 'Property development funcions'
[wxWidgets.git]
/
src
/
univ
/
stattext.cpp
diff --git
a/src/univ/stattext.cpp
b/src/univ/stattext.cpp
index a5f4c03eb0910402f3bd9c41deedd7286f256c06..3fccad27643efa2376a18f8eea8adccaefbc1a3f 100644
(file)
--- a/
src/univ/stattext.cpp
+++ b/
src/univ/stattext.cpp
@@
-1,5
+1,5
@@
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
-// Name: univ/stattext.cpp
+// Name:
src/
univ/stattext.cpp
// Purpose: wxStaticText
// Author: Vadim Zeitlin
// Modified by:
// Purpose: wxStaticText
// Author: Vadim Zeitlin
// Modified by:
@@
-17,10
+17,6
@@
// headers
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
- #pragma implementation "univstattext.h"
-#endif
-
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#include "wx/wxprec.h"
#ifdef __BORLANDC__
@@
-29,9
+25,10
@@
#if wxUSE_STATTEXT
#if wxUSE_STATTEXT
+#include "wx/stattext.h"
+
#ifndef WX_PRECOMP
#include "wx/dcclient.h"
#ifndef WX_PRECOMP
#include "wx/dcclient.h"
- #include "wx/stattext.h"
#include "wx/validate.h"
#endif
#include "wx/validate.h"
#endif
@@
-42,7
+39,7
@@
// implementation
// ============================================================================
// implementation
// ============================================================================
-IMPLEMENT_ABSTRACT_CLASS(wxStaticText, wx
Control
)
+IMPLEMENT_ABSTRACT_CLASS(wxStaticText, wx
GenericStaticText
)
// ----------------------------------------------------------------------------
// creation
// ----------------------------------------------------------------------------
// creation
@@
-58,40
+55,44
@@
bool wxStaticText::Create(wxWindow *parent,
{
if ( !wxControl::Create(parent, id, pos, size, style, wxDefaultValidator, name) )
return false;
{
if ( !wxControl::Create(parent, id, pos, size, style, wxDefaultValidator, name) )
return false;
-
+
SetLabel(label);
SetLabel(label);
- Set
Best
Size(size);
+ Set
Initial
Size(size);
return true;
}
// ----------------------------------------------------------------------------
return true;
}
// ----------------------------------------------------------------------------
-//
size management
+//
drawing
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
-void wxStaticText::
SetLabel(const wxString& label
)
+void wxStaticText::
DoDraw(wxControlRenderer *renderer
)
{
{
-
wxControl::SetLabel(label
);
+
renderer->DrawLabel(
);
}
}
-wxSize wxStaticText::DoGetBestClientSize() const
+void wxStaticText::SetLabel(const wxString& str)
{
{
- wxStaticText *self = wxConstCast(this, wxStaticText);
- wxClientDC dc(self);
- dc.SetFont(GetFont());
- wxCoord width, height;
- dc.GetMultiLineTextExtent(GetLabel(), &width, &height);
+ // save original label
+ m_labelOrig = str;
- return wxSize(width, height);
+ // draw as real label the result of GetEllipsizedLabelWithoutMarkup:
+ DoSetLabel(GetEllipsizedLabelWithoutMarkup());
}
}
-// ----------------------------------------------------------------------------
-// drawing
-// ----------------------------------------------------------------------------
+void wxStaticText::DoSetLabel(const wxString& str)
+{
+ UnivDoSetLabel(str);
+}
-void wxStaticText::DoDraw(wxControlRenderer *renderer)
+wxString wxStaticText::DoGetLabel() const
{
{
- re
nderer->Draw
Label();
+ re
turn wxControl::Get
Label();
}
}
+/*
+ FIXME: UpdateLabel() should be called on size events to allow correct
+ dynamic ellipsizing of the label
+*/
+
#endif // wxUSE_STATTEXT
#endif // wxUSE_STATTEXT