From 37e364b2c6cc7487a1c888d256a73e5337bb7189 Mon Sep 17 00:00:00 2001 From: Ash Wolf Date: Wed, 14 Jun 2023 00:50:34 +0100 Subject: initial commit --- src/T2DLL/T2DlgItemScr.h | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 src/T2DLL/T2DlgItemScr.h (limited to 'src/T2DLL/T2DlgItemScr.h') diff --git a/src/T2DLL/T2DlgItemScr.h b/src/T2DLL/T2DlgItemScr.h new file mode 100644 index 0000000..55698bb --- /dev/null +++ b/src/T2DLL/T2DlgItemScr.h @@ -0,0 +1,45 @@ +#pragma once +#include "common.h" +#include "T2DlgItem.h" + +class DLL_EXPORT T2DlgItemScr : public T2DlgItem { +public: + T2DlgItemScr(T2TowerDoc* towerDoc, T2ImageObj* imageObj, CPalette* palette); + virtual void SetValue(int); + + virtual void SetPage(int); + virtual void SetRange(int); + + enum { + Area_Up = 1, + Area_PageUp = 2, + Area_SetAbsolute = 3, + Area_PageDown = 4, + Area_Down = 5 + }; + +protected: + virtual void OnT2DlgItemLButtonDown(UINT nFlags, CPoint pt); + virtual void OnT2DlgItemLButtonUp(UINT nFlags, CPoint pt); + virtual void OnT2DlgItemMouseMove(UINT nFlags, CPoint pt); + virtual void OnT2Timer(UINT id); + + virtual int ScrollBarHittest(CPoint) const = 0; + virtual void GetUpButtonRect(const CRect&, CRect&) const = 0; + virtual void GetDnButtonRect(const CRect&, CRect&) const = 0; + virtual int PositionToValue(const CPoint&) const = 0; + virtual int PositionToValue(const CRect&) const = 0; + + void CalcScrollBarThumb(int*, int*) const; + void ScrollBarAction(int, int); + BOOL IsScrollable() const; + + int mUpImage; + int mDownImage; + int mRange; + int mPage; + CPoint mMouseDownPoint; + int mMouseDownValue; + int mClickedArea; + UINT mTimerID; +}; -- cgit v1.2.3