wxST_NO_AUTORESIZE.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9387
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
// accessors
void SetLabel(const wxString& label);
// accessors
void SetLabel(const wxString& label);
+ bool SetFont( const wxFont &font );
// overriden base class virtuals
virtual bool AcceptsFocus() const { return FALSE; }
// overriden base class virtuals
virtual bool AcceptsFocus() const { return FALSE; }
- SetFont(parent->GetFont());
+ wxControl::SetFont(parent->GetFont());
SetSize(x, y, width, height);
return TRUE;
SetSize(x, y, width, height);
return TRUE;
+
+bool wxStaticText::SetFont(const wxFont& font)
+{
+ bool ret = wxControl::SetFont(font);
+
+ // adjust the size of the window to fit to the label unless autoresizing is
+ // disabled
+ if ( !(GetWindowStyle() & wxST_NO_AUTORESIZE) )
+ {
+ DoSetSize(-1, -1, -1, -1, wxSIZE_AUTO_WIDTH | wxSIZE_AUTO_HEIGHT);
+ }
+
+ return ret;
+}
+
+
long wxStaticText::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
{
// Ensure that static items get messages. Some controls don't like this
long wxStaticText::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
{
// Ensure that static items get messages. Some controls don't like this