content clipping becomes a runtime attribute
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33210 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -184,10 +184,6 @@ public:
|
|||||||
// Called by layout algorithm to retrieve information about the window.
|
// Called by layout algorithm to retrieve information about the window.
|
||||||
void OnQueryLayoutInfo(wxQueryLayoutInfoEvent& event);
|
void OnQueryLayoutInfo(wxQueryLayoutInfoEvent& event);
|
||||||
|
|
||||||
#ifdef __WXMAC__
|
|
||||||
virtual bool MacClipChildren() const { return true ; }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void Init();
|
void Init();
|
||||||
|
|
||||||
|
@@ -79,9 +79,6 @@ public:
|
|||||||
// (this isn't a virtual size, this is a sensible size for the window)
|
// (this isn't a virtual size, this is a sensible size for the window)
|
||||||
virtual wxSize DoGetBestSize() const;
|
virtual wxSize DoGetBestSize() const;
|
||||||
|
|
||||||
#ifdef __WXMAC__
|
|
||||||
virtual bool MacClipChildren() const { return true ; }
|
|
||||||
#endif
|
|
||||||
protected:
|
protected:
|
||||||
// this is needed for wxEVT_PAINT processing hack described in
|
// this is needed for wxEVT_PAINT processing hack described in
|
||||||
// wxScrollHelperEvtHandler::ProcessEvent()
|
// wxScrollHelperEvtHandler::ProcessEvent()
|
||||||
|
@@ -209,7 +209,8 @@ public:
|
|||||||
|
|
||||||
wxRegion MacGetVisibleRegion( bool includeOuterStructures = false ) ;
|
wxRegion MacGetVisibleRegion( bool includeOuterStructures = false ) ;
|
||||||
// returns true if children have to clipped to the content area (eg scrolled window)
|
// returns true if children have to clipped to the content area (eg scrolled window)
|
||||||
virtual bool MacClipChildren() const { return false ; }
|
bool MacClipChildren() const { return m_clipChildren ; }
|
||||||
|
void MacSetClipChildren( bool clip ) { m_clipChildren = clip ; }
|
||||||
// returns true if the grandchildren have to be clipped to the children's content area (eg
|
// returns true if the grandchildren have to be clipped to the children's content area (eg
|
||||||
// splitter window)
|
// splitter window)
|
||||||
virtual bool MacClipGrandChildren() const { return false ; }
|
virtual bool MacClipGrandChildren() const { return false ; }
|
||||||
@@ -274,6 +275,10 @@ protected:
|
|||||||
wxScrollBar* m_hScrollBar ;
|
wxScrollBar* m_hScrollBar ;
|
||||||
wxScrollBar* m_vScrollBar ;
|
wxScrollBar* m_vScrollBar ;
|
||||||
wxString m_label ;
|
wxString m_label ;
|
||||||
|
// returns true if we do a sharp clip at the content area of this window
|
||||||
|
// must be dynamic as eg a panel normally is not clipping precisely, but if
|
||||||
|
// it becomes the target window of a scrolled window it has to...
|
||||||
|
bool m_clipChildren ;
|
||||||
|
|
||||||
void MacCreateScrollBars( long style ) ;
|
void MacCreateScrollBars( long style ) ;
|
||||||
void MacRepositionScrollBars() ;
|
void MacRepositionScrollBars() ;
|
||||||
|
@@ -54,6 +54,9 @@ void wxSashLayoutWindow::Init()
|
|||||||
{
|
{
|
||||||
m_orientation = wxLAYOUT_HORIZONTAL;
|
m_orientation = wxLAYOUT_HORIZONTAL;
|
||||||
m_alignment = wxLAYOUT_TOP;
|
m_alignment = wxLAYOUT_TOP;
|
||||||
|
#ifdef __WXMAC__
|
||||||
|
MacSetClipChildren( true ) ;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is the function that wxLayoutAlgorithm calls to ascertain the window
|
// This is the function that wxLayoutAlgorithm calls to ascertain the window
|
||||||
|
@@ -424,6 +424,9 @@ void wxScrollHelper::SetWindow(wxWindow *win)
|
|||||||
void wxScrollHelper::DoSetTargetWindow(wxWindow *target)
|
void wxScrollHelper::DoSetTargetWindow(wxWindow *target)
|
||||||
{
|
{
|
||||||
m_targetWindow = target;
|
m_targetWindow = target;
|
||||||
|
#ifdef __WXMAC__
|
||||||
|
target->MacSetClipChildren( true ) ;
|
||||||
|
#endif
|
||||||
|
|
||||||
// install the event handler which will intercept the events we're
|
// install the event handler which will intercept the events we're
|
||||||
// interested in (but only do it for our real window, not the target window
|
// interested in (but only do it for our real window, not the target window
|
||||||
@@ -1250,6 +1253,9 @@ bool wxGenericScrolledWindow::Create(wxWindow *parent,
|
|||||||
const wxString& name)
|
const wxString& name)
|
||||||
{
|
{
|
||||||
m_targetWindow = this;
|
m_targetWindow = this;
|
||||||
|
#ifdef __WXMAC__
|
||||||
|
MacSetClipChildren( true ) ;
|
||||||
|
#endif
|
||||||
|
|
||||||
bool ok = wxPanel::Create(parent, id, pos, size, style|wxHSCROLL|wxVSCROLL, name);
|
bool ok = wxPanel::Create(parent, id, pos, size, style|wxHSCROLL|wxVSCROLL, name);
|
||||||
|
|
||||||
|
@@ -748,6 +748,7 @@ void wxWindowMac::Init()
|
|||||||
#if wxMAC_USE_CORE_GRAPHICS
|
#if wxMAC_USE_CORE_GRAPHICS
|
||||||
m_cgContextRef = NULL ;
|
m_cgContextRef = NULL ;
|
||||||
#endif
|
#endif
|
||||||
|
m_clipChildren = false ;
|
||||||
// we need a valid font for the encodings
|
// we need a valid font for the encodings
|
||||||
wxWindowBase::SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
|
wxWindowBase::SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user