Add wxScrollWindow::ShouldScrollToChildOnFocus() virtual hook
This method can be overridden to indicate that the scrolled window doesn't want its children to be scrolled into view when they're focused, which is the default behaviour. Also reuse this method for Mac-specific scrollbar workaround.
This commit is contained in:
@@ -14,6 +14,10 @@
|
||||
#include "wx/control.h"
|
||||
#include "wx/panel.h"
|
||||
|
||||
#ifdef __WXOSX__
|
||||
#include "wx/scrolbar.h"
|
||||
#endif
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxScrollHelperEvtHandler;
|
||||
class WXDLLIMPEXP_FWD_BASE wxTimer;
|
||||
|
||||
@@ -305,6 +309,21 @@ protected:
|
||||
return size;
|
||||
}
|
||||
|
||||
// Can be overridden to return false if the child window shouldn't be
|
||||
// scrolled into view automatically when it gets focus, which is the
|
||||
// default behaviour.
|
||||
virtual bool ShouldScrollToChildOnFocus(wxWindow* child)
|
||||
{
|
||||
#if defined(__WXOSX__) && wxUSE_SCROLLBAR
|
||||
if ( wxDynamicCast(child, wxScrollBar) )
|
||||
return false;
|
||||
#else
|
||||
wxUnusedVar(child);
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
double m_scaleX;
|
||||
double m_scaleY;
|
||||
|
Reference in New Issue
Block a user