Logo ROOT   6.08/07
Reference Guide
TToggleGroup.h
Go to the documentation of this file.
1 // @(#)root/meta:$Id$
2 // Author: Piotr Golonka 31/07/97
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TToggleGroup
13 #define ROOT_TToggleGroup
14 
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TToggleGroup //
19 // //
20 // This class defines check-box facility for TToggle objects //
21 // It is used in context menu "selectors" for picking up a value. //
22 // //
23 //////////////////////////////////////////////////////////////////////////
24 
25 #ifndef ROOT_TNamed
26 #include "TNamed.h"
27 #endif
28 #ifndef ROOT_TToggle
29 #include "TToggle.h"
30 #endif
31 #ifndef ROOT_TOrdCollection
32 #include "TOrdCollection.h"
33 #endif
34 
35 
36 class TToggleGroup : public TNamed {
37 
38 private:
39  TOrdCollection *fToggles; // list of TToggle objects
40 
41 public:
42  TToggleGroup();
43  TToggleGroup(const TToggleGroup&);
45  virtual ~TToggleGroup();
46  virtual Int_t GetTogglesCount() {return fToggles->GetSize();};
47  virtual TToggle *At(Int_t idx) {return (TToggle*)fToggles->At(idx);};
48 
49  virtual void Remove(TToggle *t) {fToggles->Remove(t);};
50  virtual void Remove(Int_t pos) {fToggles->RemoveAt(pos);};
51 
52  virtual void DeleteAll();
53  virtual TToggle *First() {return (TToggle*)fToggles->First();};
54  virtual TToggle *Last() {return (TToggle*)fToggles->Last();};
55 
56  virtual Int_t IndexOf(TToggle *t) {return fToggles->IndexOf(t);};
57 
58  virtual Int_t Add(TToggle *t, Bool_t select=1);
59  virtual Int_t InsertAt(TToggle *t, Int_t pos,Bool_t select=1);
60  virtual void Select(Int_t idx);
61  virtual void Select(TToggle *t);
62 
63  ClassDef(TToggleGroup,0) // Group of contex-menu toggle objects
64 };
65 
66 #endif
67 
This class defines toggling facility for both - object's method or variables.
Definition: TToggle.h:51
virtual TToggle * Last()
Definition: TToggleGroup.h:54
TOrdCollection * fToggles
Definition: TToggleGroup.h:39
virtual void Select(Int_t idx)
Select a toggle.
TObject * First() const
Return the first object in the collection.
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
This class defines check-box facility for TToggle objects It is used in context menu "selectors" for ...
Definition: TToggleGroup.h:36
TToggleGroup()
Constructor.
#define ClassDef(name, id)
Definition: Rtypes.h:254
TToggleGroup & operator=(const TToggleGroup &)
Assignment operator.
virtual TToggle * At(Int_t idx)
Definition: TToggleGroup.h:47
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:33
virtual Int_t Add(TToggle *t, Bool_t select=1)
Add a new toggle.
TObject * Last() const
Return the last object in the collection.
virtual void Remove(TToggle *t)
Definition: TToggleGroup.h:49
Int_t IndexOf(const TObject *obj) const
Return index of object in collection.
TObject * RemoveAt(Int_t idx)
Remove object at index idx.
virtual void Remove(Int_t pos)
Definition: TToggleGroup.h:50
TObject * Remove(TObject *obj)
Remove object from collection.
virtual TToggle * First()
Definition: TToggleGroup.h:53
virtual Int_t InsertAt(TToggle *t, Int_t pos, Bool_t select=1)
Add a new toggle at a specific position.
virtual ~TToggleGroup()
Deletes togglegroup but does not disposes toggled objects!
virtual void DeleteAll()
Disposes of all objects and clears array.
virtual Int_t GetTogglesCount()
Definition: TToggleGroup.h:46
virtual Int_t IndexOf(TToggle *t)
Definition: TToggleGroup.h:56
virtual Int_t GetSize() const
Definition: TCollection.h:95
Ordered collection.
TObject * At(Int_t idx) const
Returns the object at position idx. Returns 0 if idx is out of range.