mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-29 06:12:18 -06:00
36 lines
674 B
C++
36 lines
674 B
C++
#ifndef _AutoScroller_AutoScroller_h_
|
|
#define _AutoScroller_AutoScroller_h_
|
|
|
|
#include <CtrlLib/CtrlLib.h>
|
|
|
|
using namespace Upp;
|
|
|
|
template<class C = ParentCtrl>
|
|
class AutoScroller
|
|
: public ParentCtrl
|
|
{
|
|
public:
|
|
typedef AutoScroller CLASSNAME;
|
|
AutoScroller();
|
|
|
|
public:
|
|
virtual void Layout();
|
|
|
|
void SetPaneSize(const Size & sz);
|
|
Size GetPaneSize() const { return pane.GetSize(); }
|
|
|
|
void EnableScroll(bool b = true);
|
|
void DisableScroll() { EnableScroll(false); }
|
|
bool IsEnabledScroll() const { return scroll.x.IsEnabled() || scroll.y.IsEnabled(); }
|
|
|
|
C pane;
|
|
|
|
protected:
|
|
void OnScroll();
|
|
|
|
private:
|
|
ScrollBars scroll;
|
|
};
|
|
|
|
|
|
#endif
|