FDOSTUI
FreeDOS Text User Interface
scrllbar.hpp
Go to the documentation of this file.
1 /*
2  SCRLLBAR.HPP
3 
4  License CC0 PUBLIC DOMAIN
5 
6  To the extent possible under law, Mark J. Olesen has waived all copyright
7  and related or neighboring rights to FDOSTUI Library. This work is published
8  from: United States.
9 */
10 #ifndef __scrollbar_hpp__
11 
12 #include "slider.hpp"
13 
14 class scrollbar : public slider
15 {
16 
17 public:
18 
19  scrollbar(
20  int const i_pos_x,
21  int const i_pos_y,
22  unsigned int const i_len_x,
23  unsigned int const i_len_y);
24 
25  virtual
26  ~scrollbar();
27 
28  virtual void
29  draw() const;
30 
31  virtual enum event_response
32  event_key(
33  struct event_key const& i_event);
34 
35  virtual enum event_response
37  struct event_mouse const& i_event);
38 
39  int
40  get_pagesize() const;
41 
42  void
44  int const i_pagesize);
45 
46 protected:
47 
49  bool m_dragging;
50 
51 private:
52 
53  scrollbar();
54 
55  scrollbar(
56  const scrollbar&);
57 
58  scrollbar&
59  operator=(scrollbar const&);
60 
61  enum where
62  {
69  };
70 
71  enum where
73  struct event_mouse const& i_event) const;
74 
75  enum where
77  struct event_mouse const& i_event) const;
78 
79  enum where
81  struct event_mouse const& i_event) const;
82 
83 };
84 
85 inline int
87 {
88  return m_pagesize;
89 }
90 
91 inline void
93  int const i_pagesize)
94 {
95  m_pagesize= i_pagesize;
96  return;
97 }
98 
99 #define __scrollbar_hpp__
100 #endif
void set_pagesize(int const i_pagesize)
sets the page size. This is the number of display lines.
Definition: scrllbar.hpp:92
where
indicator of where the user clicked
Definition: scrllbar.hpp:61
enum where event_where_vertical(struct event_mouse const &i_event) const
determine event type for vertical scrollbar
Definition: scrllbar.cpp:155
Definition: scrllbar.hpp:67
A slider widget with navigational arrow buttons at each end.
Definition: scrllbar.hpp:14
contains slider class
Allows user to select a value by moving a thumb within a defined range of the slider.
Definition: slider.hpp:28
bool m_dragging
Definition: scrllbar.hpp:49
Definition: scrllbar.hpp:63
enum where event_where_horizontal(struct event_mouse const &i_event) const
determine event type for horizontal scrollbar
Definition: scrllbar.cpp:101
Definition: scrllbar.hpp:66
Definition: scrllbar.hpp:64
virtual enum event_response event_mouse(struct event_mouse const &i_event)
handle mouse event
Definition: scrllbar.cpp:227
virtual enum event_response event_key(struct event_key const &i_event)
handle key event
Definition: scrllbar.cpp:320
virtual void draw() const
draws the widget
Definition: scrllbar.cpp:33
int get_pagesize() const
gets the page size
Definition: scrllbar.hpp:86
Definition: scrllbar.hpp:68
event_response
response
Definition: event.h:14
int m_pagesize
Definition: scrllbar.hpp:48
Definition: scrllbar.hpp:65
virtual ~scrollbar()
destructor
Definition: scrllbar.cpp:27
enum where event_where(struct event_mouse const &i_event) const
determine event type param[in] i_event event to test
Definition: scrllbar.cpp:209
container for a mouse event
Definition: event.h:37
container for a keyboard event
Definition: event.h:23