Logo ROOT   6.16/01
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
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
53TH1 *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}
#define h(i)
Definition: RSha256.hxx:106
int Int_t
Definition: RtypesCore.h:41
const Bool_t kFALSE
Definition: RtypesCore.h:88
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kTRUE
Definition: RtypesCore.h:87
#define ClassImp(name)
Definition: Rtypes.h:363
#define gPad
Definition: TVirtualPad.h:286
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:37
Definition: TChair.h:27
const TTable * Table() const
Definition: TChair.h:67
virtual void Draw(Option_t *opt)
Default Draw method for all objects.
Definition: TChair.h:55
virtual ~TColumnView()
destructor
Definition: TColumnView.cxx:33
TColumnView(const char *colName="", TTable *table=0)
constructor
Definition: TColumnView.cxx:26
TH1 * Histogram(const char *selection="")
Create a histogram from the context menu.
Definition: TColumnView.cxx:53
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
The TH1 histogram class.
Definition: TH1.h:56
virtual void SetName(const char *name)
Set the name of the TNamed.
Definition: TNamed.cxx:140
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:47
Definition: TTable.h:48
@ kPtr
Definition: TTable.h:83
virtual EColumnType GetColumnType(Int_t columnIndex) const
Definition: TTable.cxx:2436
virtual Int_t GetColumnIndex(const Char_t *columnName) const
Definition: TTable.cxx:2419
void table()
Definition: table.C:85