1 #pragma once
2 
3 #ifndef PEGCENTERCONTROL_INCLUDED
4 #define PEGCENTERCONTROL_INCLUDED
5 
6 #include "tw/tw.h"
7 
8 #undef DVAPI
9 #undef DVVAR
10 #ifdef TWIN_EXPORTS
11 #define DVAPI DV_EXPORT_API
12 #define DVVAR DV_EXPORT_VAR
13 #else
14 #define DVAPI DV_IMPORT_API
15 #define DVVAR DV_IMPORT_VAR
16 #endif
17 
18 class DVAPI TPegCenterControl : public TWidget {
19   TUINT32 m_status, m_oldStatus;
20   int m_clickPos;
21   bool m_dragging;
22 
23 protected:
24 public:
25   TPegCenterControl(TWidget *parent, string name = "canvas");
26   ~TPegCenterControl();
27 
28   virtual void draw();
29 
30   void leftButtonDown(const TMouseEvent &e);
31   void leftButtonDrag(const TMouseEvent &e);
32   void leftButtonUp(const TMouseEvent &e);
33 
34   void configureNotify(const TDimension &d);
35 
36   void setStatus(TUINT32 status);
37   TUINT32 getStatus() const;
38 };
39 
40 #endif
41