Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
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 
30 class TToggleGroup : public TNamed {
31 
32 private:
33  TOrdCollection *fToggles; // list of TToggle objects
34 
35 public:
36  TToggleGroup();
37  TToggleGroup(const TToggleGroup&);
38  TToggleGroup &operator=(const TToggleGroup&);
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