From: Vadim Zeitlin Date: Wed, 19 Dec 2001 01:27:26 +0000 (+0000) Subject: fixed redraw problems in wxStaticText X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/1e3a888e72809aa28931d7cd7737b0ace9b2e482 fixed redraw problems in wxStaticText git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13083 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/docs/changes.txt b/docs/changes.txt index 0497feedc1..b35add0afe 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -63,9 +63,16 @@ Unix ports: 2.3.3 ----- +All: + +- fixes to the command line parsing error and usage messages +- modified wxFileName::CreateTempFileName() to open the file atomically + (if possible) and, especially, not to leak the file descriptors under Unix + wxMSW: - fixed flicker in wxTreeCtrl::SetItemXXX() +- fixed redraw problems in dynamically resized wxStaticText 2.3.2 ----- diff --git a/include/wx/msw/stattext.h b/include/wx/msw/stattext.h index 781b5878ab..20c49b73a4 100644 --- a/include/wx/msw/stattext.h +++ b/include/wx/msw/stattext.h @@ -16,12 +16,8 @@ #pragma interface "stattext.h" #endif -#include "wx/control.h" - -class WXDLLEXPORT wxStaticText : public wxControl +class WXDLLEXPORT wxStaticText : public wxStaticTextBase { -DECLARE_DYNAMIC_CLASS(wxStaticText) - public: wxStaticText() { } @@ -44,18 +40,16 @@ public: long style = 0, const wxString& name = wxStaticTextNameStr); - // accessors - void SetLabel(const wxString& label); - bool SetFont( const wxFont &font ); - - // overriden base class virtuals - virtual bool AcceptsFocus() const { return FALSE; } - - // callbacks - virtual long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam); + // override some methods to resize the window properly + virtual void SetLabel(const wxString& label); + virtual bool SetFont( const wxFont &font ); protected: + virtual void DoSetSize(int x, int y, int w, int h, + int sizeFlags = wxSIZE_AUTO); virtual wxSize DoGetBestSize() const; + + DECLARE_DYNAMIC_CLASS(wxStaticText) }; #endif diff --git a/src/msw/stattext.cpp b/src/msw/stattext.cpp index a83000876e..1c0810694c 100644 --- a/src/msw/stattext.cpp +++ b/src/msw/stattext.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: stattext.cpp +// Name: src/msw/stattext.cpp // Purpose: wxStaticText // Author: Julian Smart // Modified by: @@ -82,13 +82,6 @@ bool wxStaticText::Create(wxWindow *parent, wxWindowID id, wxCHECK_MSG( m_hWnd, FALSE, wxT("Failed to create static ctrl") ); -#if wxUSE_CTL3D -/* - if (!(GetParent()->GetWindowStyleFlag() & wxUSER_COLOURS)) - Ctl3dSubclassCtl(static_item); -*/ -#endif - SubclassWin(m_hWnd); wxControl::SetFont(parent->GetFont()); @@ -141,17 +134,24 @@ wxSize wxStaticText::DoGetBestSize() const return wxSize(widthTextMax, heightTextTotal); } +void wxStaticText::DoSetSize(int x, int y, int w, int h, int sizeFlags) +{ + // we need to refresh the window after changing its size as the standard + // control doesn't always update itself properly + wxStaticTextBase::DoSetSize(x, y, w, h, sizeFlags); + + Refresh(); +} + void wxStaticText::SetLabel(const wxString& label) { - SetWindowText(GetHwnd(), label); + wxStaticTextBase::SetLabel(label); // 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); - - Refresh(); } } @@ -170,15 +170,4 @@ bool wxStaticText::SetFont(const wxFont& font) return ret; } - -long wxStaticText::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam) -{ - // Ensure that static items get messages. Some controls don't like this - // message to be intercepted (e.g. RichEdit), hence the tests. - if (nMsg == WM_NCHITTEST) - return (long)HTCLIENT; - - return wxWindow::MSWWindowProc(nMsg, wParam, lParam); -} - #endif // wxUSE_STATTEXT