OpendTect-6_4  6.4
mousecursor.h
Go to the documentation of this file.
1 #ifndef mousecursor_h
2 #define mousecursor_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: K. Tingdahl
9  Date: March 2008
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 -*/
14 
15 #include "generalmod.h"
16 #include "bufstring.h"
17 #include "ptrman.h"
18 
19 namespace OD { class RGBImage; }
20 
27 {
28 public:
29  virtual ~MouseCursor();
57  enum Shape { Arrow, UpArrow, Cross, Wait, Ibeam,
58  SizeVer, SizeHor, SizeBDiag, SizeFDiag, SizeAll,
59  Blank, SplitV, SplitH, PointingHand, Forbidden,
60  WhatsThis, Busy, OpenHand, ClosedHand,
61  Last = ClosedHand, Bitmap = 24, NotSet,
62  //Custom cursors
63  GreenArrow, Rotator, Pencil
64  };
65 
66  MouseCursor();
67  MouseCursor( Shape s );
68 
69  bool operator==(const MouseCursor&) const;
70  bool operator!=(const MouseCursor&) const;
71 
73 
78 
79  int hotx_;
80  int hoty_;
81 };
82 
83 
108 {
109 public:
110 
111  virtual ~MouseCursorManager() {}
112 
113  static void setOverride(MouseCursor::Shape,bool replace=false);
114  static void setOverride(const MouseCursor&,bool replace=false);
115  static void setOverride(const char* filenm,int hotx=-1, int hoty=-1,
116  bool replace=false);
117  static void restoreOverride();
118 
119 
120  static MouseCursorManager* mgr();
121  static void setMgr(MouseCursorManager*);
123 
124 protected:
125  virtual void setOverrideShape(MouseCursor::Shape,bool replace) = 0;
126  virtual void setOverrideCursor(const MouseCursor&,bool replace) = 0;
127  virtual void setOverrideFile(const char* filenm,
128  int hotx,int hoty, bool replace) = 0;
129  virtual void restoreInternal() = 0;
130 
131 
132  static MouseCursorManager* mgr_;
133 };
134 
135 
142 {
143 public:
144  MouseCursorChanger(const char* fnm, int hotx, int hoty);
145  MouseCursorChanger(MouseCursor::Shape cs);
146  ~MouseCursorChanger();
147 
148  void restore();
149 
150 protected:
151  bool active_;
152 };
153 
154 
155 #endif
#define mExpClass(module)
Definition: commondefs.h:160
OD::RGBImage * image_
Only used if shape_==Bitmap && filename_ is empty.
Definition: mousecursor.h:76
Definition of a mouse cursor, can be either a predefined shape (from the enum, or a file...
Definition: mousecursor.h:26
bool operator==(const ArrayNDInfo &a1, const ArrayNDInfo &a2)
Definition: arrayndinfo.h:53
Shape
Definition: mousecursor.h:57
bool active_
Definition: mousecursor.h:151
Definition: mousecursor.h:60
Definition: mousecursor.h:63
int hotx_
Definition: mousecursor.h:79
Definition: mousecursor.h:59
virtual ~MouseCursorManager()
Definition: mousecursor.h:111
Shape shape_
Definition: mousecursor.h:72
Definition: mousecursor.h:57
bool operator!=(const ArrayNDInfo &a1, const ArrayNDInfo &a2)
Definition: arrayndinfo.h:62
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:40
static MouseCursorManager * mgr_
Definition: mousecursor.h:132
Class to automatically change cursor, and change it back automatically when class is running out of s...
Definition: mousecursor.h:141
OpendTect.
Definition: commontypes.h:29
Class for Red, Green, Blue image.
Definition: odimage.h:28
Definition: mousecursor.h:58
Sets another cursor for current application.
Definition: mousecursor.h:107
int hoty_
Definition: mousecursor.h:80
Definition: mousecursor.h:61
BufferString filename_
Only used if shape_==Bitmap.
Definition: mousecursor.h:74

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2019