00001 // @(#)root/memstat:$Name$:$Id: TMemStatViewerGUI.h 30815 2009-10-20 13:49:22Z rdm $ 00002 // Author: M.Ivanov -- Anar Manafov (A.Manafov@gsi.de) 28/04/2008 00003 00004 /************************************************************************* 00005 * Copyright (C) 1995-2008, 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 /////////////////////////////////////////////////////////////////////////////// 00013 // // 00014 // GUI for the AliTPCCalibViewer // 00015 // used for the calibration monitor // 00016 // // 00017 /////////////////////////////////////////////////////////////////////////////// 00018 00019 #ifndef ROOT_TMemStatViewerGUI 00020 #define ROOT_TMemStatViewerGUI 00021 00022 // STD 00023 #include <string> 00024 #include <memory> 00025 // ROOT 00026 #ifndef ROOT_TGFrame 00027 #include "TGFrame.h" 00028 #endif 00029 00030 class TMemStat; 00031 class TGTextView; 00032 class TGNumberEntry; 00033 class TGComboBox; 00034 00035 class TMemStatViewerGUI : public TGCompositeFrame 00036 { 00037 protected: 00038 TMemStat *fViewer; // CalibViewer object used for drawing 00039 TGTextView *fText; // text widget 00040 TGNumberEntry *fNmbStackDeep; // number entry box for specifying the stack deepness 00041 TGNumberEntry *fNmbSortDeep; // number entry box for specifying the number of stamps 00042 std::string fCurLib; 00043 std::string fCurFunc; 00044 00045 protected: 00046 void MakeContSortStat(TGCompositeFrame *frame); 00047 void MakeContSortStamp(TGCompositeFrame *frame); 00048 void MakeContDeep(TGCompositeFrame *frame); 00049 void MakeStampList(TGCompositeFrame *frame); 00050 void MakeSelection(TGCompositeFrame *frame); 00051 00052 void Initialize(Option_t* option); // initializes the GUI with default settings and opens tree for drawing 00053 void MakePrint(); // get print 00054 00055 template< class T > 00056 void HandleRButtons(Int_t id, Int_t FirstBtnId, T *ViewerSortType); 00057 00058 public: 00059 TMemStatViewerGUI() {;} 00060 TMemStatViewerGUI(const TGWindow *p, UInt_t w, UInt_t h, Option_t* option = "read"); 00061 virtual ~TMemStatViewerGUI(); 00062 00063 static void ShowGUI(); // initialize and show GUI for presentation 00064 00065 void HandleButtonsSortStat(Int_t id = -1); // handles mutual radio button for sort stat 00066 void HandleButtonsSortStamp(Int_t id = -1); // handles mutual radio button for sort stamp 00067 void HandleDeep(Long_t id); // handles stack deep and nrows 00068 void HandleStampSelect(const char*); 00069 void HandleFuncSelect(const char*); 00070 void HandleLibSelect(const char*); 00071 00072 ClassDef(TMemStatViewerGUI, 0) // a GUI class of memstat 00073 }; 00074 00075 //______________________________________________________________________________ 00076 template< class T > 00077 void TMemStatViewerGUI::HandleRButtons(Int_t id, Int_t FirstBtnId, T *ViewerSortType) 00078 { 00079 // handles mutual radio button exclusions 00080 *ViewerSortType = static_cast<T>(id - FirstBtnId); 00081 } 00082 00083 00084 #endif