23 #ifndef BAGEL_BOFLIB_GUI_SCROLL_BAR_H 24 #define BAGEL_BOFLIB_GUI_SCROLL_BAR_H 26 #include "bagel/boflib/gui/window.h" 27 #include "bagel/boflib/gfx/sprite.h" 28 #include "bagel/boflib/gfx/text.h" 34 #define BSB_LINE_LEFT 802 35 #define BSB_LINE_RIGHT 803 36 #define BSB_PAGE_LEFT 804 37 #define BSB_PAGE_RIGHT 805 38 #define BSB_THUMB_POS 806 39 #define BSB_THUMB_TRACK 807 52 ErrorCode loadBitmaps(
const char *pszBack,
const char *pszThumb,
const char *pszLeftUp =
nullptr,
const char *pszRightUp =
nullptr,
const char *pszLeftDown =
nullptr,
const char *pszRightDown =
nullptr);
54 ErrorCode setPos(
int nPos,
bool bRepaint =
true,
bool isInitial =
false);
59 ErrorCode lineLeft() {
60 return setPos(_nPos - _nLineDelta);
62 ErrorCode lineRight() {
63 return setPos(_nPos + _nLineDelta);
65 ErrorCode pageLeft() {
66 return setPos(_nPos - _nPageDelta);
68 ErrorCode pageRight() {
69 return setPos(_nPos + _nPageDelta);
79 int getScrollMin()
const {
82 int getScrollMax()
const {
86 void setLineDelta(
const int nDelta) {
89 int getLineDelta()
const {
93 void setPageDelta(
const int nDelta) {
96 int getPageDelta()
const {
100 void getScrollRange(
int &nMin,
int &nMax);
101 void setScrollRange(
int nMin,
int nMax,
bool bRepaint =
true);
103 ErrorCode setText(
const char *pszText,
int nFlags = JUSTIFY_CENTER);
105 void setRepeatTimer(uint32 nMilliSeconds);
106 ErrorCode paint(
CBofRect *pRect =
nullptr);
111 void onPaint(
CBofRect *pDirtyRect)
override;
112 void onLButtonDown(uint32 nFlags,
CBofPoint *pPoint,
void * =
nullptr)
override;
113 void onLButtonUp(uint32 nFlags,
CBofPoint *pPoint,
void * =
nullptr)
override;
114 void onMouseMove(uint32 nFlags,
CBofPoint *pPoint,
void * =
nullptr)
override;
115 void onTimer(uint32)
override;
136 char _szScrollText[MAX_TEXT];
144 bool _bMouseCaptured;