]> git.saurik.com Git - wxWidgets.git/commitdiff
fixed redraw problems in wxStaticText
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 19 Dec 2001 01:27:26 +0000 (01:27 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 19 Dec 2001 01:27:26 +0000 (01:27 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13083 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/changes.txt
include/wx/msw/stattext.h
src/msw/stattext.cpp

index 0497feedc1f94e2b2395598a99d3c78fcef964d0..b35add0afea05387aca403ecd3f0e79702626688 100644 (file)
@@ -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
 -----
index 781b5878ab406c7250d863a379a409242eb87be4..20c49b73a4f1e1e6db79adcb1d1db9bb78e6fa1b 100644 (file)
     #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
index a83000876e9251987e139f10fc554f7c0902be96..1c0810694c1ed5be5834f28b96fcdd23aa61e728 100644 (file)
@@ -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