]> git.saurik.com Git - wxWidgets.git/commitdiff
content clipping becomes a runtime attribute
authorStefan Csomor <csomor@advancedconcepts.ch>
Thu, 31 Mar 2005 05:12:46 +0000 (05:12 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Thu, 31 Mar 2005 05:12:46 +0000 (05:12 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33210 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/generic/laywin.h
include/wx/generic/scrolwin.h
include/wx/mac/carbon/window.h
src/generic/laywin.cpp
src/generic/scrlwing.cpp
src/mac/carbon/window.cpp

index ef1c162d9fec39ea471c9d30edc89e5687d58a7a..0f8ede2e8d9885448780bd54bdb89c7b88165e37 100644 (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();
 
index 91c76bbbf3a407b01167b2a0f737ade4e709f966..c7ecc79bf1ba4085a6cc60c7fac61c6de149045c 100644 (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()
index 97d3c3cfd789ffc3dff2cafedee401931385e233..3d5fa0d1529cad7ff08c2a7518c1b808d1f8edf6 100644 (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() ;
index 3a9b07640395528fbddc026010f696b7d5f8515a..aa608278d132f3223a204a7b979842acc0bfb865 100644 (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
index 7add087eda7d460a22bb9d4d2f4e39e12f81d13c..94a3d59f5f4d29dc5de63f66c0883742f3ec0e43 100644 (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);
 
index bf7ec22feba537a7545cf036546786328eedb624..9800febda5bb4ef5452191f8c034dfb8b714c22b 100644 (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));
 }