Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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 ClassDefOverride(TToggleGroup,0) // Group of contex-menu toggle objects
58};
59
60#endif
61
bool Bool_t
Definition RtypesCore.h:63
int Int_t
Definition RtypesCore.h:45
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
The TNamed class is the base class for all named ROOT classes.
Definition TNamed.h:29
Ordered collection.
TObject * First() const override
Return the first object in the collection.
Int_t IndexOf(const TObject *obj) const override
Return index of object in collection.
TObject * Last() const override
Return the last object in the collection.
TObject * Remove(TObject *obj) override
Remove object from collection.
TObject * RemoveAt(Int_t idx) override
Remove object at index idx.
TObject * At(Int_t idx) const override
Returns the object at position idx. Returns 0 if idx is out of range.
This class defines check-box facility for TToggle objects It is used in context menu "selectors" for ...
virtual void Remove(Int_t pos)
virtual Int_t GetTogglesCount()
TOrdCollection * fToggles
virtual Int_t InsertAt(TToggle *t, Int_t pos, Bool_t select=1)
Add a new toggle at a specific position.
virtual TToggle * Last()
virtual TToggle * At(Int_t idx)
virtual void Select(Int_t idx)
Select a toggle.
virtual void Remove(TToggle *t)
virtual Int_t Add(TToggle *t, Bool_t select=1)
Add a new toggle.
virtual Int_t IndexOf(TToggle *t)
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()
This class defines toggling facility for both - object's method or variables.
Definition TToggle.h:47