OpendTect-6_4  6.4
uicolor.h
Go to the documentation of this file.
1 #ifndef uicolor_h
2 #define uicolor_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: A.H. Lammertink
9  Date: 22/05/2000
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 -*/
14 
15 #include "uibasemod.h"
16 #include "color.h"
17 #include "uigroup.h"
18 
19 class uiLabel;
20 class uiPushButton;
21 class uiCheckBox;
22 class uiComboBox;
23 class uiSpinBox;
24 
25 
29 mGlobal(uiBase) bool selectColor(Color&,uiParent* parnt=0,
30  uiString=uiString::emptyString(),
31  bool withtransp=false);
32 
33 // To be used by cmddriver to select a color while closing the QColorDialog
34 mGlobal(uiBase) void setExternalColor( const Color& );
35 
36 
44 mExpClass(uiBase) uiColorInput : public uiGroup
46 public:
47  mExpClass(uiBase) Setup
48  {
49  public:
50 
51  enum TranspHndlng { None, InSelector, Separate };
52 
53  Setup( const Color& col, TranspHndlng h=None )
54  : color_(col)
55  , withcheck_(false)
56  , dlgtitle_( uiColorInput::sSelColor() )
57  , transp_(h)
58  , withdesc_(h != Separate)
59  {}
60 
61  mDefSetupMemb(Color,color)
62  mDefSetupMemb(uiString,lbltxt)
63  mDefSetupMemb(bool,withcheck)
64  mDefSetupMemb(uiString,dlgtitle)
65  mDefSetupMemb(TranspHndlng,transp)
66  mDefSetupMemb(bool,withdesc)
67 
68  };
69 
70  uiColorInput(uiParent*,const Setup&,
71  const char* nm=0);
72 
73  const Color& color() const { return color_; }
74  void setColor(const Color&);
75  bool doDraw() const;
76  void setDoDraw(bool);
77  void setLblText(const uiString&);
78 
81 
82  uiPushButton* getButton() { return colbut_; }
83  uiComboBox* getDescCombo() { return descfld_; }
84 
85  static uiString sSelColor();
86  static bool selectColor(Color& col,uiParent*,
87  uiString,bool withtransp);
88 
89 private:
90 
96 
97  Color color_;
100 
101  void selCol(CallBacker*);
102  void dodrawSel(CallBacker*);
103  void descSel(CallBacker*);
104  void transpChg(CallBacker*);
105 };
106 
107 #endif
Definition: uigroup.h:54
const Color & color() const
Definition: uicolor.h:73
#define mExpClass(module)
Definition: commondefs.h:160
To be able to send and/or receive CallBacks, inherit from this class.
Definition: callback.h:272
FixedString Setup()
Definition: keystrs.h:116
void setExternalColor(const Color &)
is the base class for all buttons.
Definition: uibutton.h:83
#define mODTextTranslationClass(clss)
Definition: uistring.h:38
#define mGlobal(module)
Definition: commondefs.h:163
uiCheckBox * dodrawbox_
Definition: uicolor.h:92
uiLabel * lbl_
Definition: uicolor.h:95
Combo box.
Definition: uicombobox.h:32
Definition: uistring.h:89
Definition: uiparent.h:26
FixedString None()
Definition: keystrs.h:90
Notifier< uiColorInput > colorChanged
Definition: uicolor.h:79
Color color_
Definition: uicolor.h:97
bool selwithtransp_
Definition: uicolor.h:99
#define mDefSetupMemb(typ, memb)
Definition: commondefs.h:137
bool selectColor(Color &, uiParent *parnt=0, uiString=uiString::emptyString(), bool withtransp=false)
pops a selector box to select a new color
Definition: uispinbox.h:24
uiString dlgtxt_
Definition: uicolor.h:98
small element for color selection. Has no text label.
Definition: uicolor.h:44
Definition: uilabel.h:24
static uiString sSelColor()
Color is an RGB color object, with a transparancy. The storage is in a 4-byte integer, similar to Qt.
Definition: color.h:26
uiComboBox * getDescCombo()
Definition: uicolor.h:83
Definition: uibutton.h:134
uiPushButton * colbut_
Definition: uicolor.h:91
uiComboBox * descfld_
Definition: uicolor.h:94
Notifier< uiColorInput > doDrawChanged
Definition: uicolor.h:80
uiSpinBox * transpfld_
Definition: uicolor.h:93
uiPushButton * getButton()
Definition: uicolor.h:82

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