SCV  4.2.1
Simple Components for Visual
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ScrollComponent.h
Go to the documentation of this file.
1 
7 #ifndef __SCV_SCROLL_COMPONENT_H__
8 #define __SCV_SCROLL_COMPONENT_H__
9 
10 #include "Panel.h"
11 #include "Component.h"
12 #include "ComponentTexture.h"
13 
14 namespace scv {
15 
16 class ScrollComponent : public Component {
17 public:
18  ScrollComponent(const scv::Point &p1, const scv::Point &p2, scv::Component *object = NULL);
19 
20  virtual void setComponent(scv::Component *object);
21  inline scv::Component *getComponent(void) const;
22 
23  void processMouse(const scv::MouseEvent &evt);
24  void processKey(const scv::KeyEvent &evt);
25 
26  void setHeight(int height);
27  void setWidth(int width);
28 
29  void display(void);
30 
31 protected:
32  virtual void refreshSCrollPaneSize(void);
33  virtual void refreshContainerPosition(void);
34 
35 protected:
36  enum Button {
42  };
43 
44  bool isOnLeftButton(Point p);
45  bool isOnRightButton(Point p);
46  bool isOnUpButton(Point p);
47  bool isOnBottomButton(Point p);
48 
49  bool isOnVertButton(Point p);
50  bool isOnHorzButton(Point p);
51  bool isOnVertBar(Point p);
52  bool isOnHorzBar(Point p);
53 
54  float pixelToFloat(int pix, bool horz);
55  float barPixelToFloat(int pix, bool horz);
56 
57  void createTexture(void);
59 
60  static const int s_initDesloc = 16;
61  static const int s_border = 15;
62  static const int s_unnecessaryBorder = (3 * s_initDesloc + 1);
63 
65 
71 
73 
76 };
77 
80  return _registeredComponent;
81 }
82 
83 } // namespace scv
84 
85 #endif // __SCV_SCROLL_COMPONENT_H__