OpendTect  6.6
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  RCS: $Id$
10 ________________________________________________________________________
11 
12 -*/
13 
14 #include "generalmod.h"
15 #include "bufstring.h"
16 #include "ptrman.h"
17 
18 namespace OD { class RGBImage; }
19 
26 {
27 public:
28  virtual ~MouseCursor();
56  enum Shape { Arrow, UpArrow, Cross, Wait, Ibeam,
57  SizeVer, SizeHor, SizeBDiag, SizeFDiag, SizeAll,
58  Blank, SplitV, SplitH, PointingHand, Forbidden,
59  WhatsThis, Busy, OpenHand, ClosedHand,
60  Last = ClosedHand, Bitmap = 24, NotSet,
61  //Custom cursors
62  GreenArrow, Rotator, Pencil
63  };
64 
67  MouseCursor(const char* fnm);
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 
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 
133 };
134 
135 
142 {
143 public:
144  MouseCursorChanger(const char* fnm, int hotx, int hoty);
147 
148  void restore();
149 
150 protected:
151  bool active_;
152 };
153 
154 
MouseCursorManager
Sets another cursor for current application.
Definition: mousecursor.h:108
MouseCursorChanger::restore
void restore()
MouseCursorChanger::MouseCursorChanger
MouseCursorChanger(MouseCursor::Shape cs)
MouseCursorChanger::~MouseCursorChanger
~MouseCursorChanger()
MouseCursor::filename_
BufferString filename_
Only used if shape_==Bitmap.
Definition: mousecursor.h:74
MouseCursorManager::setOverride
static void setOverride(const char *filenm, int hotx=-1, int hoty=-1, bool replace=false)
MouseCursor::SizeVer
@ SizeVer
Definition: mousecursor.h:57
MouseCursor::Rotator
@ Rotator
Definition: mousecursor.h:62
MouseCursor::hoty_
int hoty_
Definition: mousecursor.h:80
OD
OpendTect.
Definition: commontypes.h:28
mExpClass
#define mExpClass(module)
Definition: commondefs.h:177
MouseCursor::NotSet
@ NotSet
Definition: mousecursor.h:60
MouseCursor::shape_
Shape shape_
Definition: mousecursor.h:72
MouseCursor::~MouseCursor
virtual ~MouseCursor()
MouseCursorManager::mgr_
static MouseCursorManager * mgr_
Definition: mousecursor.h:132
MouseCursorManager::setMgr
static void setMgr(MouseCursorManager *)
MouseCursorManager::setOverrideShape
virtual void setOverrideShape(MouseCursor::Shape, bool replace)=0
bufstring.h
MouseCursorManager::~MouseCursorManager
virtual ~MouseCursorManager()
Definition: mousecursor.h:111
OD::RGBImage
Class for Red, Green, Blue image.
Definition: odimage.h:28
MouseCursor::operator!=
bool operator!=(const MouseCursor &) const
MouseCursorManager::restoreOverride
static void restoreOverride()
ptrman.h
MouseCursorChanger::MouseCursorChanger
MouseCursorChanger(const char *fnm, int hotx, int hoty)
MouseCursor::hotx_
int hotx_
Definition: mousecursor.h:79
MouseCursorManager::setOverride
static void setOverride(MouseCursor::Shape, bool replace=false)
MouseCursorManager::setOverrideCursor
virtual void setOverrideCursor(const MouseCursor &, bool replace)=0
MouseCursor::SplitV
@ SplitV
Definition: mousecursor.h:58
MouseCursorChanger
Class to automatically change cursor, and change it back automatically when class is running out of s...
Definition: mousecursor.h:142
MouseCursorChanger::active_
bool active_
Definition: mousecursor.h:151
BufferString
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size.
Definition: bufstring.h:40
MouseCursor::image_
OD::RGBImage * image_
Only used if shape_==Bitmap && filename_ is empty.
Definition: mousecursor.h:76
MouseCursor
Definition of a mouse cursor, can be either a predefined shape (from the enum, or a file....
Definition: mousecursor.h:26
MouseCursor::MouseCursor
MouseCursor()
ODGMT::Cross
@ Cross
Definition: gmtdef.h:20
MouseCursor::operator==
bool operator==(const MouseCursor &) const
MouseCursor::MouseCursor
MouseCursor(const char *fnm)
MouseCursorManager::restoreInternal
virtual void restoreInternal()=0
MouseCursorManager::mgr
static MouseCursorManager * mgr()
MouseCursorManager::setOverrideFile
virtual void setOverrideFile(const char *filenm, int hotx, int hoty, bool replace)=0
MouseCursor::WhatsThis
@ WhatsThis
Definition: mousecursor.h:59
MouseCursor::MouseCursor
MouseCursor(Shape s)
MouseCursor::Wait
@ Wait
Definition: mousecursor.h:56
MouseCursorManager::setOverride
static void setOverride(const MouseCursor &, bool replace=false)
MouseCursor::Shape
Shape
Definition: mousecursor.h:56

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