00001
00002
00003
00004 #ifndef FROOT_TFndBaseMonGUI
00005 #define FROOT_TFndBaseMonGUI
00006
00007
00008 #ifndef ROOT_TGNumberEntry
00009 #include "TGNumberEntry.h"
00010 #endif
00011 #ifndef ROOT_TGComboBox
00012 #include "TGComboBox.h"
00013 #endif
00014 #ifndef ROOT_TGFrame
00015 #include "TGFrame.h"
00016 #endif
00017 #ifndef ROOT_TGCanvas
00018 #include "TGCanvas.h"
00019 #endif
00020 #ifndef ROOT_TGButton
00021 #include "TGButton.h"
00022 #endif
00023 #ifndef ROOT_TGTextEdit
00024 #include "TGTextEdit.h"
00025 #endif
00026 #ifndef ROOT_TGLabel
00027 #include "TGLabel.h"
00028 #endif
00029 #ifndef ROOT_TRootCanvas
00030 #include "TRootCanvas.h"
00031 #endif
00032 #ifndef ROOT_TGStatusBar
00033 #include "TGStatusBar.h"
00034 #endif
00035 #ifndef ROOT_TRootEmbeddedCanvas
00036 #include "TRootEmbeddedCanvas.h"
00037 #endif
00038 #ifndef ROOT_TCanvas
00039 #include "TCanvas.h"
00040 #endif
00041
00042
00043 #include "TFrame.h"
00044
00045 #include "Riostream.h"
00046
00047
00048 #include "FROOT.h"
00049 #include "Gui.h"
00050
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00073
00074 using namespace FROOT;
00075
00076 class TFndBaseMonGUI: public TObject{
00077
00078 protected:
00079
00080 Int_t fDebugLev;
00081
00082
00083 TString fFontType;
00084 UInt_t fFontSize;
00085 TString fFontISO;
00086 TString fFontString;
00087
00088 TGFont *fFont_Title;
00089 TGGC *fFontGC_Title;
00090
00091 TGFont *fFont_GrpTitle;
00092 TGGC *fFontGC_GrpTitle;
00093
00094 TGFont *fFont_LabNorm;
00095 TGGC *fFontGC_LabNorm;
00096 TGFont *fFont_LabEnl;
00097 TGGC *fFontGC_LabEnl;
00098
00099 TGFont *fFont_But;
00100 TGGC *fFontGC_But;
00101
00102
00103
00104 TGMainFrame *fMainFrame;
00105
00106
00107 TGVerticalFrame *fVertFrm_CL1;
00108 TGHorizontalFrame *fHorFrm_CL2;
00109
00110 TRootEmbeddedCanvas *fShowEmbeddedCanvas;
00111
00112
00113 TCanvas *fShowCanvas;
00114
00115
00116 TGGroupFrame *fGrpFrm_SteerCmd;
00117
00118 TGLabel *fSteer_Combo_Lbl;
00119 TGComboBox *fSteer_Combo;
00120
00121 TGLabel *fSteer_Num1_Lbl;
00122 TGNumberEntry *fSteer_Num1;
00123
00124 TGLabel *fSteer_Num2_Lbl;
00125 TGNumberEntry *fSteer_Num2;
00126
00127 TGTextButton *fSteer_But1;
00128 TGTextButton *fSteer_But2;
00129
00130
00131 TGGroupFrame *fGrpFrm_SelectCmd;
00132
00133 TGLabel *fSel_Combo1_Lbl;
00134 TGComboBox *fSel_Combo1;
00135
00136 TGLabel *fSel_Combo2_Lbl;
00137 TGComboBox *fSel_Combo2;
00138
00139
00140 TGGroupFrame *fGrpFrm_Msg;
00141 TGTextEdit *fMsg_TxtEdit;
00142
00143 TGStatusBar *fStatBar1;
00144
00145 ofstream *fCurLogFile;
00146 ofstream *fCurTmpFile;
00147 TString fCurTmpFileName;
00148
00149 private:
00150 virtual void LoadFonts();
00151
00152 public:
00153 TFndBaseMonGUI();
00154 ~TFndBaseMonGUI();
00155 void SetDebugLevel(Int_t deb_lev) { fDebugLev = deb_lev; }
00156
00157 void BuildBaseGUI();
00158
00159 virtual void BuildGUI()
00160 {
00161 BuildBaseGUI();
00162 }
00163
00164 virtual void CustomizeGUI();
00165
00166 virtual void MapGUI();
00167 virtual void CloseGUI();
00168
00169 virtual Bool_t MakeConnections(Bool_t Connect = kTRUE);
00170
00171 void SetFontType(TString ftype);
00172 void SetFontSize(Float_t fsize);
00173
00174 virtual void UpdateDisplayPad();
00175 virtual void ResetDisplayPad(Int_t ncols=0,Int_t nraws=0);
00176
00177 virtual void FillCombo_Steer();
00178 virtual void FillCombo_Sel1();
00179 virtual void FillCombo_Sel2();
00180
00181 virtual void Exe_SteerCombo(Int_t id);
00182 virtual void Exe_SelCombo1(Int_t id);
00183 virtual void Exe_SelCombo2(Int_t id);
00184
00185 virtual void WriteStatusMessage(const TString &msg,Int_t partidx=0);
00186
00187
00188 virtual void SetBackgroundColor(const Int_t &col);
00189
00190
00191 virtual void OpenLogFile(const TString &fdir, const TString &fnam,const Bool_t &is_temp,const Bool_t &reset_old);
00192 virtual void CloseLogFile(const Bool_t &is_temp);
00193 virtual void WriteLogFile(const TString &line,const Bool_t &is_temp);
00194
00195 virtual void SetTmpFilename(const TString &nam) { fCurTmpFileName = nam; };
00196
00197 virtual void ResetTextMessage()
00198 {
00199 AddTextMessage("",kTRUE);
00200 }
00201 virtual void AddTextMessage(const TString &msg,Bool_t reset=kFALSE,Bool_t refresh=kTRUE);
00202 virtual Int_t WriteTextEdit(const TString &txt_filename);
00203
00204 virtual void HandleMouseActions(Int_t event, Int_t x, Int_t y, TObject *selected);
00205
00206 virtual void HandleMouseActionsDaughter(Int_t event, Int_t x, Int_t y, TObject *selected) = 0;
00207 virtual void ResetDaughter() = 0;
00208
00209 ClassDef(TFndBaseMonGUI,0)
00210 };
00211
00212
00216
00217
00218
00222 #include "TGProgressBar.h"
00223
00224 using namespace Gui;
00225 class TFndGTransientProgress : public TGMainFrame{
00226
00227 protected:
00228 TGVerticalFrame *fFrmVert;
00229 TGStatusBar *fStatBar;
00230 TGHProgressBar *fPrgBar;
00231 TGLabel *fLblTitle;
00232 TGTextButton *fTxtButCancel;
00233
00234 Bool_t fIsCancelled;
00235 void BuildGUI();
00236 void MakeConnections();
00237 void DisplayGUI();
00238
00239 public:
00240 TFndGTransientProgress();
00241 ~TFndGTransientProgress();
00242
00243 void UpdateGUI();
00244
00245 void DoCancel();
00246
00247 void SetTitle(const TString &tit);
00248 void ReSetStatusMessage(TString msg="");
00249 void SetProgressBar(const Float_t &pos_perc);
00250 void SetProgressBar(const Float_t ¤t,const Float_t &total);
00251
00252 Bool_t IsCancelled() { return fIsCancelled; }
00253
00254
00255
00256 ClassDef(TFndGTransientProgress,1)
00257 };
00258
00259 #endif //FROOT_TFndBaseMonGUI
00260