JG ROOT Tools libraries  version 5.0 - august 2014
RGLineAttrSelect.hh
Go to the documentation of this file.
1 //======================================================================
2 /*! \file RGLineAttrSelect.hh
3  *
4  * Include file for class RGLineAttrSelect
5  */
6 //======================================================================
7 
8 #ifndef RG_LINE_ATTR_SELECT_HH
9 #define RG_LINE_ATTR_SELECT_HH
10 
11 #include "RBaseFunctions.hh"
12 
13 // widgets include file
14 #include "RGColorNumberSelect.hh"
15 
16 // ROOT include files
17 #include <TAttLine.h>
18 #include <TGComboBox.h>
19 
20 ///! RGLineAttrSelect widget options
22 {
23  rgLASVerticalLayout = 0x00000000,
24  rgLASHorizontalLayout = 0x00000001,
25  rgLASExpandColorNumber = 0x00000100
26 };
27 
28 //======================================================================
29 /*! class RGLineAttrSelect
30  *
31  * Widget for line attributes selection: color, width and style.
32  *
33  * \image html RGLineAttrSelect_h.gif
34  * \image html RGLineAttrSelect_v.gif
35  *
36  * Options:
37  * - \b rgLASVerticalLayout: vertical layout
38  * - \b rgLASHorizontalLayout: horizontal layout
39  * - \b rgLASExpandColorNumber: for horizontal layout the color number expands
40  * (default is style)
41  */
42 class RGLineAttrSelect : public TGCompositeFrame
43 {
44  //------------------------------------------------------------
45  /*! \object_doc{RGLineAttrSelect} */
47  //------------------------------------------------------------
48 
49  protected:
50  Int_t min_width; ///< Minimum width
51 
52  RGColorNumberSelect *w_color; ///< Line color widget pointer
53  TGLineWidthComboBox *w_width; ///< Line width widget pointer
54  TGLineStyleComboBox *w_style; ///< Line style widget pointer
55 
56  //------------------------------------------------------------
57  // Constructors / affectation / destructor
58  public:
59  RGLineAttrSelect ( TGWindow *p,
60  TAttLine att = TAttLine(1,1,1),
61  UInt_t opt = rgLASVerticalLayout,
62  Int_t w = 3,
63  Int_t sep = 4 );
64 
65  private:
66  RGLineAttrSelect ( const RGLineAttrSelect &original );
67 
68  public:
69  virtual ~RGLineAttrSelect ( );
70 
71  //------------------------------------------------------------
72  virtual void MapSubwindows ( );
73  virtual void SetState ( const Bool_t b = kTRUE );
74 
75  // Functions
76  Color_t GetLineColor ( ) const; // inline
77  Pixel_t GetLineColorPixel ( ) const; // inline
78  Width_t GetLineWidth ( ) const; // inline
79  Style_t GetLineStyle ( ) const; // inline
80  TAttLine GetLineAttr ( ) const; // inline
81 
82  void SetLineColor ( const Color_t c, const Bool_t emit = kTRUE );
83  void SetLineColorPixel ( const Pixel_t c, const Bool_t emit = kTRUE );
84  void SetLineWidth ( const Width_t w, const Bool_t emit = kTRUE );
85  void SetLineStyle ( const Style_t s, const Bool_t emit = kTRUE );
86 
87  RGColorNumberSelect * GetColorWidget () const; // inline
88  TGLineWidthComboBox * GetWidthWidget () const; // inline
89  TGLineStyleComboBox * GetStyleWidget () const; // inline
90 
91  //------------------------------------------------------------
92  // Signals
93 
94  virtual void LineColorChanged ( Color_t c ); // *SIGNAL*
95  virtual void LineWidthChanged ( Width_t w ); // *SIGNAL*
96  virtual void LineStyleChanged ( Style_t s ); // *SIGNAL*
97 
98  //------------------------------------------------------------
99  // Slots
100 
101 
102  //------------------------------------------------------------
103  /*! For ROOT dictionary.*/
105 };
106 
107 //----------------------------------------------------------------------
108 // Inline functions
109 #include "icc/RGLineAttrSelect.icc"
110 
111 //======================================================================
112 #endif
113 
Style_t GetLineStyle() const
Definition: RGLineAttrSelect.icc:37
RGColorNumberSelect * GetColorWidget() const
Definition: RGLineAttrSelect.icc:11
virtual ~RGLineAttrSelect()
Definition: RGLineAttrSelect.cpp:106
Definition: RGColorNumberSelect.hh:27
ClassDef(RGLineAttrSelect, 0)
void SetLineColorPixel(const Pixel_t c, const Bool_t emit=kTRUE)
Definition: RGLineAttrSelect.cpp:154
TGLineWidthComboBox * w_width
Line width widget pointer.
Definition: RGLineAttrSelect.hh:53
TGLineStyleComboBox * w_style
Line style widget pointer.
Definition: RGLineAttrSelect.hh:54
RGLineAttrSelect(TGWindow *p, TAttLine att=TAttLine(1, 1, 1), UInt_t opt=rgLASVerticalLayout, Int_t w=3, Int_t sep=4)
Definition: RGLineAttrSelect.cpp:22
Width_t GetLineWidth() const
Definition: RGLineAttrSelect.icc:33
virtual void LineWidthChanged(Width_t w)
Definition: RGLineAttrSelect.icc:56
TGLineWidthComboBox * GetWidthWidget() const
Definition: RGLineAttrSelect.icc:15
Color_t GetLineColor() const
Definition: RGLineAttrSelect.icc:25
GObject(RGLineAttrSelect)
virtual void MapSubwindows()
Definition: RGLineAttrSelect.cpp:112
void SetLineColor(const Color_t c, const Bool_t emit=kTRUE)
Definition: RGLineAttrSelect.cpp:144
TAttLine GetLineAttr() const
Definition: RGLineAttrSelect.icc:41
Int_t min_width
Minimum width.
Definition: RGLineAttrSelect.hh:50
void SetLineWidth(const Width_t w, const Bool_t emit=kTRUE)
Definition: RGLineAttrSelect.cpp:164
virtual void LineStyleChanged(Style_t s)
Definition: RGLineAttrSelect.icc:62
virtual void SetState(const Bool_t b=kTRUE)
Definition: RGLineAttrSelect.cpp:129
Definition: RGLineAttrSelect.hh:42
RGColorNumberSelect * w_color
Line color widget pointer.
Definition: RGLineAttrSelect.hh:52
RGLineAttrSelectOptions
! RGLineAttrSelect widget options
Definition: RGLineAttrSelect.hh:21
Pixel_t GetLineColorPixel() const
Definition: RGLineAttrSelect.icc:29
TGLineStyleComboBox * GetStyleWidget() const
Definition: RGLineAttrSelect.icc:19
void SetLineStyle(const Style_t s, const Bool_t emit=kTRUE)
Definition: RGLineAttrSelect.cpp:174
virtual void LineColorChanged(Color_t c)
Definition: RGLineAttrSelect.icc:50