StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
TColumnView.cxx
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
20 
21 ClassImp(TColumnView);
22 
25 
26 TColumnView::TColumnView(const char *colName,TTable *table):TChair(table)
27 {
28  SetName(colName);
29 }
32 
34 {
35 }
38 
39 void TColumnView::Browse(TBrowser *)
40 {
41  if (!IsFolder())
42  {
43  Draw(GetName(),"");
44  if (gPad) {
45  gPad->Modified();
46  gPad->Update();
47  }
48  }
49 }
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 
65 
66 Bool_t TColumnView::IsFolder() const
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 ~TColumnView()
destructor
Definition: TColumnView.cxx:33
virtual Bool_t IsFolder() const
Treat the column with the pointer to the "Ptr" as a "folder".
Definition: TColumnView.cxx:66
virtual void Browse(TBrowser *b)
Create a column histogram for the simple column.
Definition: TColumnView.cxx:39
Definition: TChair.h:27
Definition: TTable.h:48
TH1 * Histogram(const char *selection="")
Create a histogram from the context menu.
Definition: TColumnView.cxx:53
TColumnView(const char *colName="", TTable *table=0)
constructor
Definition: TColumnView.cxx:26