fixed redraw problems in wxStaticText
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13083 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -63,9 +63,16 @@ Unix ports:
|
|||||||
2.3.3
|
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:
|
wxMSW:
|
||||||
|
|
||||||
- fixed flicker in wxTreeCtrl::SetItemXXX()
|
- fixed flicker in wxTreeCtrl::SetItemXXX()
|
||||||
|
- fixed redraw problems in dynamically resized wxStaticText
|
||||||
|
|
||||||
2.3.2
|
2.3.2
|
||||||
-----
|
-----
|
||||||
|
@@ -16,12 +16,8 @@
|
|||||||
#pragma interface "stattext.h"
|
#pragma interface "stattext.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/control.h"
|
class WXDLLEXPORT wxStaticText : public wxStaticTextBase
|
||||||
|
|
||||||
class WXDLLEXPORT wxStaticText : public wxControl
|
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxStaticText)
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
wxStaticText() { }
|
wxStaticText() { }
|
||||||
|
|
||||||
@@ -44,18 +40,16 @@ public:
|
|||||||
long style = 0,
|
long style = 0,
|
||||||
const wxString& name = wxStaticTextNameStr);
|
const wxString& name = wxStaticTextNameStr);
|
||||||
|
|
||||||
// accessors
|
// override some methods to resize the window properly
|
||||||
void SetLabel(const wxString& label);
|
virtual void SetLabel(const wxString& label);
|
||||||
bool SetFont( const wxFont &font );
|
virtual 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);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
virtual void DoSetSize(int x, int y, int w, int h,
|
||||||
|
int sizeFlags = wxSIZE_AUTO);
|
||||||
virtual wxSize DoGetBestSize() const;
|
virtual wxSize DoGetBestSize() const;
|
||||||
|
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxStaticText)
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: stattext.cpp
|
// Name: src/msw/stattext.cpp
|
||||||
// Purpose: wxStaticText
|
// Purpose: wxStaticText
|
||||||
// Author: Julian Smart
|
// Author: Julian Smart
|
||||||
// Modified by:
|
// Modified by:
|
||||||
@@ -82,13 +82,6 @@ bool wxStaticText::Create(wxWindow *parent, wxWindowID id,
|
|||||||
|
|
||||||
wxCHECK_MSG( m_hWnd, FALSE, wxT("Failed to create static ctrl") );
|
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);
|
SubclassWin(m_hWnd);
|
||||||
|
|
||||||
wxControl::SetFont(parent->GetFont());
|
wxControl::SetFont(parent->GetFont());
|
||||||
@@ -141,17 +134,24 @@ wxSize wxStaticText::DoGetBestSize() const
|
|||||||
return wxSize(widthTextMax, heightTextTotal);
|
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)
|
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
|
// adjust the size of the window to fit to the label unless autoresizing is
|
||||||
// disabled
|
// disabled
|
||||||
if ( !(GetWindowStyle() & wxST_NO_AUTORESIZE) )
|
if ( !(GetWindowStyle() & wxST_NO_AUTORESIZE) )
|
||||||
{
|
{
|
||||||
DoSetSize(-1, -1, -1, -1, wxSIZE_AUTO_WIDTH | wxSIZE_AUTO_HEIGHT);
|
DoSetSize(-1, -1, -1, -1, wxSIZE_AUTO_WIDTH | wxSIZE_AUTO_HEIGHT);
|
||||||
|
|
||||||
Refresh();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -170,15 +170,4 @@ bool wxStaticText::SetFont(const wxFont& font)
|
|||||||
return ret;
|
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
|
#endif // wxUSE_STATTEXT
|
||||||
|
Reference in New Issue
Block a user