// 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();
// (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()
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 ; }
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() ;
{
m_orientation = wxLAYOUT_HORIZONTAL;
m_alignment = wxLAYOUT_TOP;
+#ifdef __WXMAC__
+ MacSetClipChildren( true ) ;
+#endif
}
// This is the function that wxLayoutAlgorithm calls to ascertain the window
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
const wxString& name)
{
m_targetWindow = this;
+#ifdef __WXMAC__
+ MacSetClipChildren( true ) ;
+#endif
bool ok = wxPanel::Create(parent, id, pos, size, style|wxHSCROLL|wxVSCROLL, name);
#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));
}