OpendTect  6.3
uicolor.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: A.H. Lammertink
8  Date: 22/05/2000
9 ________________________________________________________________________
10 
11 -*/
12 
13 #include "uibasemod.h"
14 #include "color.h"
15 #include "uigroup.h"
16 
17 class uiLabel;
18 class uiPushButton;
19 class uiCheckBox;
20 class uiComboBox;
21 class uiSpinBox;
22 
23 
27 mGlobal(uiBase) bool selectColor(Color&,uiParent* parnt=0,
28  uiString=uiString::emptyString(),
29  bool withtransp=false);
30 
31 // To be used by cmddriver to select a color while closing the QColorDialog
32 mGlobal(uiBase) void setExternalColor( const Color& );
33 
34 
42 mExpClass(uiBase) uiColorInput : public uiGroup
44 public:
45  mExpClass(uiBase) Setup
46  {
47  public:
48 
49  enum TranspHndlng { None, InSelector, Separate };
50 
51  Setup( const Color& col, TranspHndlng h=None )
52  : color_(col)
53  , withcheck_(false)
54  , dlgtitle_( uiColorInput::sSelColor() )
55  , transp_(h)
56  , withdesc_(h != Separate)
57  {}
58 
59  mDefSetupMemb(Color,color)
60  mDefSetupMemb(uiString,lbltxt)
61  mDefSetupMemb(bool,withcheck)
62  mDefSetupMemb(uiString,dlgtitle)
63  mDefSetupMemb(TranspHndlng,transp)
64  mDefSetupMemb(bool,withdesc)
65 
66  };
67 
68  uiColorInput(uiParent*,const Setup&,
69  const char* nm=0);
70 
71  const Color& color() const { return color_; }
72  void setColor(const Color&);
73  bool doDraw() const;
74  void setDoDraw(bool);
75  void setLblText(const uiString&);
76 
79 
80  uiPushButton* getButton() { return colbut_; }
81  uiComboBox* getDescCombo() { return descfld_; }
82 
83  static uiString sSelColor();
84  static bool selectColor(Color& col,uiParent*,
85  uiString,bool withtransp);
86 
87 private:
88 
94 
95  Color color_;
99 
100  void selCol(CallBacker*);
101  void dodrawSel(CallBacker*);
102  void descSel(CallBacker*);
103  void transpChg(CallBacker*);
104 };
Definition: uigroup.h:53
const Color & color() const
Definition: uicolor.h:71
#define mExpClass(module)
Definition: commondefs.h:157
Inherit from this class to be able to send and/or receive CallBacks.
Definition: callback.h:182
TypeSet< Color > desccolors_
Definition: uicolor.h:98
FixedString Setup()
Definition: keystrs.h:113
void setExternalColor(const Color &)
is the base class for all buttons.
Definition: uibutton.h:80
#define mODTextTranslationClass(clss)
Definition: uistring.h:37
#define mGlobal(module)
Definition: commondefs.h:160
uiCheckBox * dodrawbox_
Definition: uicolor.h:90
uiLabel * lbl_
Definition: uicolor.h:93
Combo box.
Definition: uicombobox.h:30
Definition: uistring.h:88
Definition: uiparent.h:24
FixedString None()
Definition: keystrs.h:90
Notifier< uiColorInput > colorChanged
Definition: uicolor.h:77
Color color_
Definition: uicolor.h:95
bool selwithtransp_
Definition: uicolor.h:97
#define mDefSetupMemb(typ, memb)
Definition: commondefs.h:129
bool selectColor(Color &, uiParent *parnt=0, uiString=uiString::emptyString(), bool withtransp=false)
pops a selector box to select a new color
Definition: uispinbox.h:22
uiString dlgtxt_
Definition: uicolor.h:96
small element for color selection. Has no text label.
Definition: uicolor.h:42
Definition: uilabel.h:22
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:24
uiComboBox * getDescCombo()
Definition: uicolor.h:81
Definition: uibutton.h:130
uiPushButton * colbut_
Definition: uicolor.h:89
uiComboBox * descfld_
Definition: uicolor.h:92
Notifier< uiColorInput > doDrawChanged
Definition: uicolor.h:78
uiSpinBox * transpfld_
Definition: uicolor.h:91
uiPushButton * getButton()
Definition: uicolor.h:80

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