GUI/Gui.h

00001 // @(#)fROOT/GUI:$Name:  $:$Id: Gui.h,v 1.20 2007/09/05 09:54:56 Diego_Faso Exp $
00002 // Author: Diego Faso <mailto:faso@to.infn.it>, 2006/05/26
00003 
00004 #ifndef FROOT_Gui
00005 #define FROOT_Gui
00006 #include <Riostream.h>
00007 #include "FROOT.h"
00008 #ifndef ROOT_TGMenu
00009 #include "TGMenu.h"
00010 #endif
00011 #ifndef ROOT_TGFSComboBox
00012 #include "TGFSComboBox.h"
00013 #endif
00014 
00015 #include "TCanvas.h"
00016 #include "TLatex.h"
00017 
00018 #include "TColor.h"
00019 
00020 //namespace FROOT{
00021 namespace Gui{
00022 
00023   Float_t GetTGadj(Int_t whichone);
00024 
00025   // Definition of all used colors (RGB-like)    
00026   inline ULong_t MainFgCol() { return TColor::RGB2Pixel(255, 51, 51); }
00027   inline ULong_t MainBgCol() {
00028     //      return TColor::RGB2Pixel(204,255,255); 
00029     //      return TColor::RGB2Pixel(  0, 71,255);
00030     return TColor::RGB2Pixel(  0, 10,130);
00031   }
00032 
00033   inline ULong_t MenuContFgCol() { return TColor::RGB2Pixel(255, 51, 51); }
00034   inline ULong_t MenuContBgCol() { return TColor::RGB2Pixel(204,204,255); }
00035 
00036   inline ULong_t MenuBarFgCol() { return TColor::RGB2Pixel( 76, 25,  0); }
00037   inline ULong_t MenuBarBgCol() { return TColor::RGB2Pixel(220,220,255); } // pop-up border
00038 
00039   inline ULong_t ProdFgCol() { return TColor::RGB2Pixel(255, 50, 50); }
00040   inline ULong_t ProdBgCol() { return TColor::RGB2Pixel(255, 50, 50); } // pop-up border
00041 
00042   inline ULong_t ConsFgCol() { return TColor::RGB2Pixel( 35,255, 35); }
00043   inline ULong_t ConsBgCol() { return TColor::RGB2Pixel( 35,  0,220); } // pop-up border
00044 
00045   inline ULong_t EvdFgCol() { return TColor::RGB2Pixel(255,255,  0); }
00046   inline ULong_t EvdBgCol() { return TColor::RGB2Pixel(255,255,  0); }  // pop-up border
00047   //
00048   inline ULong_t MenuContConsFgCol() { return TColor::RGB2Pixel(255, 51, 51); } // Container for consumer selection
00049   inline ULong_t MenuContConsBgCol() { return TColor::RGB2Pixel(150,150,255); }
00050   // ---
00051 
00052   enum EFndGUIFrames { FRM_MAIN = 0, FRM_PROD, FRM_CONS, FRM_EVD }; 
00053 
00054   // --- Information IDs used by the geb2hdt GUI
00055   //     (signals emitted by the geb2hdt manager: class "TFndGeb2hdtMan") 
00056   enum EFndGeb2hdt_GuiInfo {
00057     G2H_INFO_NO_ANSWER = 0,        // no answer from DAQ
00058     G2H_INFO_SEND_REQ_TO_DAQ,      // sending a new request for events to DAQ
00059     G2H_INFO_CONNECTING_DB,        // connecting to the required DB host
00060     G2H_INFO_DB_CONN_CLOSED,       // connection to database completed
00061     G2H_INFO_CAN_START_CONS,       // any consumer can start
00062     G2H_INFO_EV_LOOP_START,        // event-loop just started
00063     G2H_INFO_SEND_FIRST_REQ,       // sending request for the first event
00064     G2H_INFO_STARTING_MONITORS,    // starting producer monitors
00065     G2H_INFO_FILLING_MONITORS,     // filling producer monitors
00066     G2H_INFO_UPDATING_PROD_SHR,    // updating producer shared memories
00067     G2H_INFO_PAUSED,               // producer event-loop paused
00068     G2H_INFO_RESTARTED,            // producer event-loop restarted
00069     G2H_INFO_TIMED_OUT,            // producer process has timed-out: exiting
00070     G2H_INFO_FINISH_RUN,           // run completed (performing end-of-run operations)
00071     G2H_INFO_STOPPING,             // stopping current producer (normally due to a button action)
00072     G2H_INFO_EXITING,              // all producer processes completed: exiting froot
00073     G2H_INFO_PRINT,                // printing information about the running producer
00074     G2H_INFO_RESET_GTS,            // reset GTS producer histograms
00075     G2H_INFO_RESET_TOF,            // reset TOF producer histograms
00076     G2H_INFO_RESET_SIL,            // reset SIL producer histograms
00077     G2H_INFO_RESET_LMD,            // reset LMD producer histograms
00078     G2H_INFO_RESET_STB            // reset STB producer histograms
00079   };
00080 
00081   // --- Button actions assignment
00082   enum EFndCommandIdentifiers {
00083     M_PRODUCER_SETUP_ONLM = 0,
00084     M_PRODUCER_SETUP_FILE,
00085     M_PRODUCER_CLEAN,
00086     M_KILL_EXIT,
00087     M_FROOT_QUIT,
00088       
00089     M_OPENONLM_GTS,
00090     M_OPENFILE_GTS,
00091     //  M_DIALOG_GTS,
00092     M_CLOSE_GTS,
00093       
00094     M_OPENONLM_TOF,
00095     M_OPENFILE_TOF,
00096     //  M_DIALOG_TOF,
00097     M_CLOSE_TOF,
00098       
00099     M_OPENONLM_SIL,
00100     M_OPENFILE_SIL,
00101     //  M_DIALOG_SIL,
00102     M_CLOSE_SIL,
00103       
00104     M_OPENONLM_LMD,
00105     M_OPENFILE_LMD,
00106     //  M_DIALOG_LMD,
00107     M_CLOSE_LMD,
00108       
00109     M_OPENONLM_STB,
00110     M_OPENFILE_STB,
00111     //  M_DIALOG_STB,
00112     M_CLOSE_STB,
00113       
00114     M_OPENONLM_ALL,
00115     M_OPENFILE_ALL,
00116     //  M_DIALOG_ALL,
00117     M_CLOSE_ALL,
00118       
00119     M_OPEN_EVD,
00120     M_CLOSE_EVD      
00121   };
00122     
00123   // GUI resizing (TG-classes) screen-resolution safe
00124   void MoveSafe(Double_t x, Double_t y,TGFrame *f,Bool_t redraw = kTRUE);
00125   void ResizeSafe(Double_t w, Double_t h,TGFrame *f,Bool_t redraw = kTRUE);
00126   void MoveResizeSafe(Double_t x, Double_t y, Double_t w, Double_t h, TGFrame *f,Bool_t redraw = kTRUE);
00127   void SelectComboEntry(TGComboBox *combo,Int_t entry_id);
00128 
00129   void SaveCanvasWithTitle(TCanvas *canv,const TString &title,const TString &filename,TString draw_1D_opt="",TString draw_2D_opt="",Int_t TitColor = -1, Double_t pad_tit_h = .1, Double_t TitSize = 0.5);
00130 
00131   //  }
00132 }
00133 #endif // FROOT_Gui
00134 

Generated on Tue Oct 16 15:40:46 2007 by  doxygen 1.5.2