forked from boardhead/aged
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PScrollBar.h
48 lines (37 loc) · 1.37 KB
/
PScrollBar.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//==============================================================================
// File: PScrollBar.h
//
// Copyright (c) 2017, Phil Harvey, Queen's University
//==============================================================================
#ifndef __PScrollBar_h__
#define __PScrollBar_h__
#include <Xm/Xm.h>
const int kScrollMax = 10000; // maximum value for all scrollbars
const int kSliderSize = 1000; // size of slider
enum EScrollBar {
kScrollLeft,
kScrollRight,
kScrollBottom,
kNumScrollBars
};
class PScrollingWindow;
class PScrollHandler {
public:
PScrollHandler() { }
virtual ~PScrollHandler() { }
virtual void ScrollValueChanged(EScrollBar bar, int value) { }
};
class PScrollBar {
public:
PScrollBar(Widget container, EScrollBar bar, char *name, Arg *wargs, int n, PScrollHandler *handler=NULL);
virtual ~PScrollBar();
Widget GetWidget() { return mScrollWidget; }
EScrollBar GetType() { return mType; }
PScrollHandler * GetHandler() { return mHandler; }
void SetHandler(PScrollHandler *hand) { mHandler = hand; }
private:
Widget mScrollWidget;
EScrollBar mType;
PScrollHandler * mHandler;
};
#endif // __PScrollBar_h__