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

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