UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
zq_rubberbox.hpp
1 /* zq_rubberbox.hpp */
2 /* $Id: zq_rubberbox.hpp 20080 2009-12-15 15:57:52Z vlad $ */
3 #ifndef __zq_rubberbox_hpp
4 #define __zq_rubberbox_hpp
5 
6 #include <qrubberband.h>
7 
8 #include "zq_object.hpp"
9 
10 
16 class ZqRubberBox : public ZqObject
17 {
18 public:
19 
21  enum RangeMode {
22  Vertical = 0x01,
23  Horizontal = 0x02,
24  Rectangle = 0x03
27  };
28 
29 
31  ZqRubberBox (const char* szName = NULL);
32 
34  ZqRubberBox (ZqbPlaceholder* pPh, const char* szName = NULL);
35 
37  virtual ~ZqRubberBox ();
38 
39 
42  virtual bool attachToPlace (ZqbPlaceholder* pPh);
43 
46  virtual bool detachFromPlace ();
47 
48 
49  /*
50  * Properties
51  */
52 
54  virtual void setThickness (int iThickness);
55 
57  virtual int getThickness () const;
58 
62  virtual void setRangeMode (int mMode);
63 
66  virtual int getRangeMode () const;
67 
69  virtual void setSensExtWidth (int iWidth);
70 
72  virtual int getSensExtWidth () const;
73 
74 
75  /*
76  * Polymorphic methods
77  */
78 
81  virtual ZqbEventHint input (QEvent& event);
82 
85  virtual void setInputable (bool bFlag);
86 
89  virtual void box (QRect r);
90 
94  virtual void click (QRect r);
95 
96 
97 protected:
98 
102  void drawRubberRect (const QRect& r);
103 
104  void updateRubberRect(const QRect& r);
105 
107  void hideRubberRect ();
108 
111  bool m_bDrawn;
112 
114  QRect m_qRect;
115  QPoint m_qCurrent, m_qStart;
116 
118  int m_iThickness;
119 
122  int m_mMode;
123 
126  int m_iExtWidth;
127 
129  QRubberBand *m_qRB;
130 
131 private:
132 
134  static int s_iNameCounter;
135 
136 };
137 
138 
139 #include "zq_rubberbox_inline.hpp"
140 
141 
142 #endif /* zq_rubberbox.hpp */
int m_iExtWidth
Definition: zq_rubberbox.hpp:107
Definition: zq_rubberbox.hpp:14
virtual int getRangeMode() const
Definition: zq_rubberbox_inline.hpp:59
ZqRubberBox(const char *szName=NULL)
virtual void setThickness(int iThickness)
Definition: zq_rubberbox_inline.hpp:23
virtual void setSensExtWidth(int iWidth)
Definition: zq_rubberbox_inline.hpp:70
Definition: zqb_placeholder.hpp:25
QRect m_qRect
Definition: zq_rubberbox.hpp:95
Definition: zq_rubberbox.hpp:22
virtual void setRangeMode(int mMode)
Definition: zq_rubberbox_inline.hpp:47
virtual bool detachFromPlace()
bool m_bDrawn
Definition: zq_rubberbox.hpp:92
int m_mMode
Definition: zq_rubberbox.hpp:103
RangeMode
Definition: zq_rubberbox.hpp:19
void drawRubberRect(const QRect &r)
void hideRubberRect()
virtual void click(QRect r)
QRubberBand * m_qRB
Definition: zq_rubberbox.hpp:129
virtual bool attachToPlace(ZqbPlaceholder *pPh)
int m_iThickness
Definition: zq_rubberbox.hpp:99
virtual int getSensExtWidth() const
Definition: zq_rubberbox_inline.hpp:82
virtual void setInputable(bool bFlag)
Definition: zq_object.hpp:36
virtual void box(QRect r)
Definition: zq_rubberbox.hpp:20
virtual ZqbEventHint input(QEvent &event)
Definition: zq_rubberbox.hpp:21
virtual ~ZqRubberBox()
virtual int getThickness() const
Definition: zq_rubberbox_inline.hpp:34