Logo ROOT   6.10/09
Reference Guide
TColumnView.cxx
Go to the documentation of this file.
1 // @(#)root/table:$Id$
2 // Author: Valery Fine(fine@bnl.gov) 13/03/2000
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 #include "TColumnView.h"
13 #include "TVirtualPad.h"
14 //______________________________________________________________________________
15 //
16 // TColumnView
17 //
18 // It is a helper class to present TTable object view TBrowser
19 ////////////////////////////////////////////////////////////////////////////////
20 
22 
23 ////////////////////////////////////////////////////////////////////////////////
24 ///constructor
25 
26 TColumnView::TColumnView(const char *colName,TTable *table):TChair(table)
27 {
28  SetName(colName);
29 }
30 ////////////////////////////////////////////////////////////////////////////////
31 ///destructor
32 
34 {
35 }
36 ////////////////////////////////////////////////////////////////////////////////
37 /// Create a column histogram for the simple column
38 
40 {
41  if (!IsFolder())
42  {
43  Draw(GetName(),"");
44  if (gPad) {
45  gPad->Modified();
46  gPad->Update();
47  }
48  }
49 }
50 ////////////////////////////////////////////////////////////////////////////////
51 /// Create a histogram from the context menu
52 
53 TH1 *TColumnView::Histogram(const char *selection)
54 {
55  TH1 *h = Draw(GetName(),selection);
56  if (gPad) {
57  gPad->Modified();
58  gPad->Update();
59  }
60  return h;
61 }
62 
63 ////////////////////////////////////////////////////////////////////////////////
64 /// Treat the column with the pointer to the "Ptr" as a "folder"
65 
67 {
68  Bool_t isFolder = kFALSE;
69  const TTable *thisTable = Table();
70  if (thisTable) {
71  Int_t cIndx = thisTable->GetColumnIndex(GetName());
72  if ((thisTable->GetColumnType(cIndx)) == TTable::kPtr ) isFolder = kTRUE;
73  }
74  return isFolder;
75 }
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:47
virtual ~TColumnView()
destructor
Definition: TColumnView.cxx:33
TH1 * h
Definition: legend2.C:5
virtual void Browse(TBrowser *b)
Create a column histogram for the simple column.
Definition: TColumnView.cxx:39
Definition: TChair.h:27
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
const TTable * Table() const
Definition: TChair.h:67
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:37
const Bool_t kFALSE
Definition: RtypesCore.h:92
#define ClassImp(name)
Definition: Rtypes.h:336
The TH1 histogram class.
Definition: TH1.h:56
virtual Int_t GetColumnIndex(const Char_t *columnName) const
Definition: TTable.cxx:2429
virtual Bool_t IsFolder() const
Treat the column with the pointer to the "Ptr" as a "folder".
Definition: TColumnView.cxx:66
Definition: TTable.h:48
virtual void Draw(Option_t *opt)
Default Draw method for all objects.
Definition: TChair.h:55
#define gPad
Definition: TVirtualPad.h:284
TH1 * Histogram(const char *selection="")
Create a histogram from the context menu.
Definition: TColumnView.cxx:53
virtual EColumnType GetColumnType(Int_t columnIndex) const
Definition: TTable.cxx:2446
const Bool_t kTRUE
Definition: RtypesCore.h:91
gr SetName("gr")