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:
Stefan Csomor
2005-03-31 05:12:46 +00:00
parent 4002a6cc0e
commit 8adc196b0e
6 changed files with 16 additions and 8 deletions

View File

@@ -184,10 +184,6 @@ public:
// Called by layout algorithm to retrieve information about the window.
void OnQueryLayoutInfo(wxQueryLayoutInfoEvent& event);
#ifdef __WXMAC__
virtual bool MacClipChildren() const { return true ; }
#endif
private:
void Init();

View File

@@ -79,9 +79,6 @@ public:
// (this isn't a virtual size, this is a sensible size for the window)
virtual wxSize DoGetBestSize() const;
#ifdef __WXMAC__
virtual bool MacClipChildren() const { return true ; }
#endif
protected:
// this is needed for wxEVT_PAINT processing hack described in
// wxScrollHelperEvtHandler::ProcessEvent()

View File

@@ -209,7 +209,8 @@ public:
wxRegion MacGetVisibleRegion( bool includeOuterStructures = false ) ;
// 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
// splitter window)
virtual bool MacClipGrandChildren() const { return false ; }
@@ -274,6 +275,10 @@ protected:
wxScrollBar* m_hScrollBar ;
wxScrollBar* m_vScrollBar ;
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 MacRepositionScrollBars() ;

View File

@@ -54,6 +54,9 @@ void wxSashLayoutWindow::Init()
{
m_orientation = wxLAYOUT_HORIZONTAL;
m_alignment = wxLAYOUT_TOP;
#ifdef __WXMAC__
MacSetClipChildren( true ) ;
#endif
}
// This is the function that wxLayoutAlgorithm calls to ascertain the window

View File

@@ -424,6 +424,9 @@ void wxScrollHelper::SetWindow(wxWindow *win)
void wxScrollHelper::DoSetTargetWindow(wxWindow *target)
{
m_targetWindow = target;
#ifdef __WXMAC__
target->MacSetClipChildren( true ) ;
#endif
// 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
@@ -1250,6 +1253,9 @@ bool wxGenericScrolledWindow::Create(wxWindow *parent,
const wxString& name)
{
m_targetWindow = this;
#ifdef __WXMAC__
MacSetClipChildren( true ) ;
#endif
bool ok = wxPanel::Create(parent, id, pos, size, style|wxHSCROLL|wxVSCROLL, name);

View File

@@ -748,6 +748,7 @@ void wxWindowMac::Init()
#if wxMAC_USE_CORE_GRAPHICS
m_cgContextRef = NULL ;
#endif
m_clipChildren = false ;
// we need a valid font for the encodings
wxWindowBase::SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
}