UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
ZtTablet.H
1 /* ZtTablet.H */
2 /* $Id: ZtTablet.H,v 1.7 2006/11/23 10:42:13 vlad Exp $ */
3 #ifndef __ZtTablet_H
4 #define __ZtTablet_H
5 
6 #include <zm/ZtObject.H>
7 
8 
9 /*************************************************************
10  * Object for selecting points in the rectangular area.
11  * Useful for selection point, marking ends of line, etc.
12  * Don't forget to set_foreground("somecolor")! Otherwise
13  * cross will be invisible.
14  *************************************************************/
15 class ZtTablet : public ZtObject
16 {
17 private:
18 
19  ZPoint prev; /* coords of previously drawn point */
20 
21  void construct (); /* Common parts of constructors */
22 
23 protected:
24 
25  int button_id; /* what button was pressed? */
26 
27  Logic drawn; /* TRUE if rubber cross is visible */
28 
29  Logic track_motion; /* TRUE if need call motion() */
30 
31  /* Draw cross of one or two lines to provide more visibility. */
32  void draw_rubber_cross (ZPoint p);
33 
34 public:
35 
36  /* Both dimentional tablet: rubber cross pointer */
37  ZtTablet (ZtMain* pManager,
38  ZGroupId pxid, ZGroupId pyid,
39  ZGroupId nxid, ZGroupId nyid);
40 
41  /* One dimentional tablet: rubber line pointer */
42  ZtTablet (ZtMain* pManager,
43  ZGroupId pxid, ZGroupId pyid,
44  ZDimension dim, ZGroupId nid);
45 
46  /* Setup motion tracking (turn on/off) */
47  void set_motion_tracking (Logic turn);
48 
49  /* Get motion tracking) */
50  Logic get_motion_tracking () const;
51 
52 
53  /* Callback for end of selection */
54  virtual void point (float nx, float ny);
55 
56  /* Callback for motion tracking */
57  virtual void motion (float nx, float ny);
58 
59 
60  /* Event processing status:
61  ziProcessed - if event processing has been finished (ungrab input);
62  ziGrabInput - if event processing must be continued (grab input);
63  ziSkipped - if this event is not processed. */
64  virtual ZInputStatus input (const XEvent* xev);
65 
66  /* Direct draw procedure: if size, place or parameters are changed */
67  virtual void redraw ();
68 
69  /* Check for end of selection. Button1 release by default.
70  Return point of event if success. */
71  virtual Logic check_point (const XEvent* xev, ZPoint& p);
72 
74  virtual const char* class_id () const;
75 
76 };
77 
78 
79 #endif /* ZtTablet.H */
Definition: ZtTablet.H:15
Definition: ZtMain.H:32
virtual void redraw()
ZNCoordSlave & nx() const
Definition: geometry.H:16
Definition: ZBase.H:30
Definition: ZtObject.H:57
virtual ZInputStatus input(const XEvent *xev)
virtual const char * class_id() const