00001 // @(#)root/table:$Id: TColumnView.cxx 21414 2007-12-17 14:15:59Z brun $ 00002 // Author: Valery Fine(fine@bnl.gov) 13/03/2000 00003 00004 /************************************************************************* 00005 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * 00006 * All rights reserved. * 00007 * * 00008 * For the licensing terms see $ROOTSYS/LICENSE. * 00009 * For the list of contributors see $ROOTSYS/README/CREDITS. * 00010 *************************************************************************/ 00011 00012 #include "TColumnView.h" 00013 #include "TVirtualPad.h" 00014 //______________________________________________________________________________ 00015 // 00016 // TColumnView 00017 // 00018 // It is a helper class to present TTable object view TBrowser 00019 //______________________________________________________________________________ 00020 ClassImp(TColumnView) 00021 00022 //______________________________________________________________________________ 00023 TColumnView::TColumnView(const char *colName,TTable *table):TChair(table) 00024 { 00025 //constructor 00026 SetName(colName); 00027 } 00028 //______________________________________________________________________________ 00029 TColumnView::~TColumnView() 00030 { 00031 //destructor 00032 } 00033 //______________________________________________________________________________ 00034 void TColumnView::Browse(TBrowser *) 00035 { 00036 // Create a column histogram for the simple column 00037 if (!IsFolder()) 00038 { 00039 Draw(GetName(),""); 00040 if (gPad) { 00041 gPad->Modified(); 00042 gPad->Update(); 00043 } 00044 } 00045 } 00046 //______________________________________________________________________________ 00047 TH1 *TColumnView::Histogram(const char *selection) 00048 { 00049 // Create a histogram from the context menu 00050 TH1 *h = Draw(GetName(),selection); 00051 if (gPad) { 00052 gPad->Modified(); 00053 gPad->Update(); 00054 } 00055 return h; 00056 } 00057 00058 //______________________________________________________________________________ 00059 Bool_t TColumnView::IsFolder() const 00060 { 00061 // Treat the column with the pointer to the "Ptr" as a "folder" 00062 Bool_t isFolder = kFALSE; 00063 const TTable *thisTable = Table(); 00064 if (thisTable) { 00065 Int_t cIndx = thisTable->GetColumnIndex(GetName()); 00066 if ((thisTable->GetColumnType(cIndx)) == TTable::kPtr ) isFolder = kTRUE; 00067 } 00068 return isFolder; 00069 }