JG ROOT Tools libraries  version 5.0 - august 2014
RGItem.hh
Go to the documentation of this file.
1 //======================================================================
2 /*! \file RGItem.hh
3  *
4  * Include file defining type names related to GItem and RGItem.
5  */
6 //======================================================================
7 
8 #ifndef RG_ITEM_HH
9 #define RG_ITEM_HH
10 
11 #include "GItem.hh"
12 #include "GItemList.hh"
13 
14 #include <TGPicture.h>
15 
16 //======================================================================
17 /*! \class RGItem
18  *
19  * This class is derived from GItem, for items that require addidional
20  * display information (icon,...)
21  *
22  * An additional information pointer is provided, for exemple to store
23  * the pointer to ROOT GUI objects referring to this item
24  * (this is the case in RGItemTreeList widget).
25  */
26 class RGItem : public GItem
27 {
28  //------------------------------------------------------------
29  /*! \object_doc{RGItem} */
30  GObject(RGItem);
31  //------------------------------------------------------------
32 
33  protected:
34  const TGPicture * icon_ptr; ///< Pointer to the ROOT icon picture
35 
36  void * info_ptr; ///< Pointer for additional information
37 
38  //------------------------------------------------------------
39  /** @name Constructors, affectation, destructor */
40  //@{
41  public:
42 
43  RGItem ( const string &s, void *ptr = NULL, const int n = 0, const TGPicture * pict = NULL );
44  RGItem ( const GItem & item );
45  RGItem ( const RGItem & original );
46  RGItem ( GItem *p, const bool udat = true );
47 
48  virtual ~RGItem ( );
49 
50  RGItem & operator = ( const RGItem &original );
51  //@}
52 
53  //------------------------------------------------------------
54  /** @name Specific functions */
55  //@{
56  void SetIcon ( const TGPicture * icon ); // inline
57  void SetIcon ( const string & icon_name ); // inline
58  const TGPicture * GetIcon ( ) const; // inline
59 
60  void SetInfoPtr ( void * ptr ); // inline
61  void * GetInfoPtr ( ) const; // inline
62  //@}
63 
64  //------------------------------------------------------------
65  /** @name Overloaded functions */
66  //@{
67  // Comparison operators
68  bool operator == ( const RGItem &item );
69 
70  //@}
71 
72 };
73 
74 //----------------------------------------------------------------------
75 // Inline functions
76 #include "icc/RGItem.icc"
77 
78 //======================================================================
79 #endif
Definition: RGItem.hh:26
void * GetInfoPtr() const
Definition: RGItem.icc:90
RGItem(const string &s, void *ptr=NULL, const int n=0, const TGPicture *pict=NULL)
Definition: RGItem.icc:18
void * info_ptr
Pointer for additional information.
Definition: RGItem.hh:36
void SetIcon(const TGPicture *icon)
Definition: RGItem.icc:70
GObject(RGItem)
virtual ~RGItem()
Definition: RGItem.icc:54
bool operator==(const RGItem &item)
Definition: RGItem.icc:62
const TGPicture * GetIcon() const
Definition: RGItem.icc:80
void SetInfoPtr(void *ptr)
Definition: RGItem.icc:86
const TGPicture * icon_ptr
Pointer to the ROOT icon picture.
Definition: RGItem.hh:34
RGItem & operator=(const RGItem &original)
Definition: RGItem.cpp:18