Logo ROOT   6.16/01
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#include "TNamed.h"
26#include "TToggle.h"
27#include "TOrdCollection.h"
28
29
30class TToggleGroup : public TNamed {
31
32private:
33 TOrdCollection *fToggles; // list of TToggle objects
34
35public:
39 virtual ~TToggleGroup();
40 virtual Int_t GetTogglesCount() {return fToggles->GetSize();};
41 virtual TToggle *At(Int_t idx) {return (TToggle*)fToggles->At(idx);};
42
43 virtual void Remove(TToggle *t) {fToggles->Remove(t);};
44 virtual void Remove(Int_t pos) {fToggles->RemoveAt(pos);};
45
46 virtual void DeleteAll();
47 virtual TToggle *First() {return (TToggle*)fToggles->First();};
48 virtual TToggle *Last() {return (TToggle*)fToggles->Last();};
49
50 virtual Int_t IndexOf(TToggle *t) {return fToggles->IndexOf(t);};
51
52 virtual Int_t Add(TToggle *t, Bool_t select=1);
53 virtual Int_t InsertAt(TToggle *t, Int_t pos,Bool_t select=1);
54 virtual void Select(Int_t idx);
55 virtual void Select(TToggle *t);
56
57 ClassDef(TToggleGroup,0) // Group of contex-menu toggle objects
58};
59
60#endif
61
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
#define ClassDef(name, id)
Definition: Rtypes.h:324
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
Definition: TCollection.h:182
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
Ordered collection.
TObject * Remove(TObject *obj)
Remove object from collection.
Int_t IndexOf(const TObject *obj) const
Return index of object in collection.
TObject * At(Int_t idx) const
Returns the object at position idx. Returns 0 if idx is out of range.
TObject * RemoveAt(Int_t idx)
Remove object at index idx.
TObject * First() const
Return the first object in the collection.
TObject * Last() const
Return the last object in the collection.
This class defines check-box facility for TToggle objects It is used in context menu "selectors" for ...
Definition: TToggleGroup.h:30
virtual void Remove(Int_t pos)
Definition: TToggleGroup.h:44
virtual Int_t GetTogglesCount()
Definition: TToggleGroup.h:40
TOrdCollection * fToggles
Definition: TToggleGroup.h:33
virtual Int_t InsertAt(TToggle *t, Int_t pos, Bool_t select=1)
Add a new toggle at a specific position.
virtual TToggle * Last()
Definition: TToggleGroup.h:48
virtual TToggle * At(Int_t idx)
Definition: TToggleGroup.h:41
virtual void Select(Int_t idx)
Select a toggle.
virtual void Remove(TToggle *t)
Definition: TToggleGroup.h:43
virtual Int_t Add(TToggle *t, Bool_t select=1)
Add a new toggle.
virtual Int_t IndexOf(TToggle *t)
Definition: TToggleGroup.h:50
virtual void DeleteAll()
Disposes of all objects and clears array.
TToggleGroup()
Constructor.
virtual ~TToggleGroup()
Deletes togglegroup but does not disposes toggled objects!
TToggleGroup & operator=(const TToggleGroup &)
Assignment operator.
virtual TToggle * First()
Definition: TToggleGroup.h:47
This class defines toggling facility for both - object's method or variables.
Definition: TToggle.h:43