JG ROOT Tools libraries  version 5.0 - august 2014
RGColorNumberSelect.hh
Go to the documentation of this file.
1 //======================================================================
2 /*! \file RGColorNumberSelect.hh
3  *
4  * Include file for class RGColorNumberSelect
5  */
6 //======================================================================
7 
8 #ifndef RG_COLOR_NUMBER_SELECT_HH
9 #define RG_COLOR_NUMBER_SELECT_HH
10 
11 #include "RBaseFunctions.hh"
12 
13 // ROOT include files
14 #include <TGFrame.h>
15 #include <TGColorSelect.h>
16 #include <TGNumberEntry.h>
17 #include <TColor.h>
18 
19 //======================================================================
20 /*! \class RGColorNumberSelect
21  *
22  * Widget for color selection, from color number or from a selection
23  * widget (TGColorSelect).
24  *
25  * \image html RGColorNumberSelect.gif
26  */
27 class RGColorNumberSelect : public TGHorizontalFrame
28 {
29  //------------------------------------------------------------
30  /*! \object_doc{RGColorNumberSelect} */
32  //------------------------------------------------------------
33 
34  protected:
35  Color_t color; ///< Color number
36 
37  TGNumberEntry * w_number_entry; ///< Pointer to color number entry field
38  TGColorSelect * w_color_select; ///< Pointer to color selection widget
39 
40  //------------------------------------------------------------
41  // Constructors / affectation / destructor
42  public:
43  RGColorNumberSelect ( TGWindow *p, Color_t c = 1, Int_t w = 3, Int_t sep = 4 );
44 
45  private:
46  RGColorNumberSelect ( const RGColorNumberSelect &original );
47 
48  public:
49  virtual ~RGColorNumberSelect ( );
50 
51  //------------------------------------------------------------
52  virtual void SetState ( const Bool_t b = kTRUE );
53 
54  // Functions
55  Color_t GetColorNumber ( ) const; // inline
56  Pixel_t GetColorPixel ( ) const; // inline
57 
58  void SetColorNumber ( const Color_t c, const Bool_t emit = kTRUE );
59  void SetColorPixel ( const Pixel_t c, const Bool_t emit = kTRUE );
60 
61  TGNumberEntry * GetColorNumberWidget ( ) const; // inline
62  TGColorSelect * GetColorSelectWidget ( ) const; // inline
63 
64  // Signals
65  virtual void ColorChanged ( Color_t c ); // *SIGNAL*
66 
67  // Slots
68  void ColorNumberEntryChanged ( const char * str );
69  void ColorPixelSelected ( ULong_t pixel );
70 
71  //------------------------------------------------------------
72  /*! For ROOT dictionary.*/
74 };
75 
76 //----------------------------------------------------------------------
77 // Inline functions
79 
80 
81 //======================================================================
82 #endif
83 
Pixel_t GetColorPixel() const
Definition: RGColorNumberSelect.icc:23
void ColorNumberEntryChanged(const char *str)
Definition: RGColorNumberSelect.cpp:134
ClassDef(RGColorNumberSelect, 0)
RGColorNumberSelect(TGWindow *p, Color_t c=1, Int_t w=3, Int_t sep=4)
Definition: RGColorNumberSelect.cpp:21
TGColorSelect * GetColorSelectWidget() const
Definition: RGColorNumberSelect.icc:15
void SetColorNumber(const Color_t c, const Bool_t emit=kTRUE)
Definition: RGColorNumberSelect.cpp:114
Definition: RGColorNumberSelect.hh:27
virtual void ColorChanged(Color_t c)
Definition: RGColorNumberSelect.icc:32
TGColorSelect * w_color_select
Pointer to color selection widget.
Definition: RGColorNumberSelect.hh:38
GObject(RGColorNumberSelect)
Color_t color
Color number.
Definition: RGColorNumberSelect.hh:35
void ColorPixelSelected(ULong_t pixel)
Definition: RGColorNumberSelect.cpp:152
TGNumberEntry * w_number_entry
Pointer to color number entry field.
Definition: RGColorNumberSelect.hh:37
virtual void SetState(const Bool_t b=kTRUE)
Definition: RGColorNumberSelect.cpp:78
void SetColorPixel(const Pixel_t c, const Bool_t emit=kTRUE)
Definition: RGColorNumberSelect.cpp:94
Color_t GetColorNumber() const
Definition: RGColorNumberSelect.icc:19
TGNumberEntry * GetColorNumberWidget() const
Definition: RGColorNumberSelect.icc:11
virtual ~RGColorNumberSelect()
Definition: RGColorNumberSelect.cpp:70