00001 #ifndef HISTACTION_H
00002 #define HISTACTION_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #include <TObjArray.h>
00014 #include <TGFrame.h>
00015 #include <TGButton.h>
00016 #include <TGListBox.h>
00017 #include <TGTextEntry.h>
00018 #include <TGTextBuffer.h>
00019 #include <TGLabel.h>
00020 #include <TRootEmbeddedCanvas.h>
00021 #include <TGTab.h>
00022 #include <TGFSContainer.h>
00023 #include <TGComboBox.h>
00024
00025 enum CommandsId {
00026
00027 M_CLOSE = 100,
00028
00029 M_DRAW,
00030 M_SELECT,
00031 M_CLEAR_A,
00032 M_SAVE,
00033 M_EDIT,
00034 M_NEXT_A,
00035 M_PREV_A,
00036
00037 M_IMPORT,
00038 M_CLEAR_B,
00039 M_NEXT_B,
00040 M_PREV_B,
00041
00042 M_MULTI,
00043
00044 M_LIST_A,
00045 M_LIST_B,
00046
00047 M_CDUP,
00048 M_LIST_MODE,
00049 M_DETAIL_MODE,
00050
00051 M_FILTER
00052 };
00053
00054
00055 class TPad;
00056
00057 class HistAction : public TGMainFrame {
00058
00059 private:
00060 enum { kMaxHist = 1000 };
00061 TGCompositeFrame *fF0, *fFA, *fFB;
00062 TRootEmbeddedCanvas *fCanvasA, *fCanvasB;
00063 TGListBox *fListBoxA, *fListBoxB;
00064 TGCompositeFrame *fA1, *fA2, *fA3, *fA4, *fA5;
00065 TGCompositeFrame *fB1, *fB2, *fB3, *fB4, *fB5;
00066 TGButton *fCloseButton;
00067 TGButton *fSaveButton, *fEditButton;
00068 TGButton *fDrawButton, *fSelectButton, *fClearButtonA;
00069 TGButton *fPrevButtonA, *fNextButtonA;
00070 TGButton *fGetButton,*fClearButtonB,*fPrevButtonB,*fNextButtonB;
00071 TGButton *fLayoutButton[16];
00072 TGCheckButton *fMultiButton;
00073 TGTextEntry *fName, *fTitle, *fChan, *fRange, *fEntries;
00074 TGTextBuffer *fNameBuf, *fTitleBuf,*fChanBuf,*fRangeBuf,*fEntriesBuf;
00075 TGTextEntry *fBinCont, *fBinRange;
00076 TGTextBuffer *fBinContBuf, *fBinRangeBuf;
00077 TGTab *fTab;
00078 TGCompositeFrame *fC1, *fC2;
00079 const TGPicture *fPcdup;
00080 const TGPicture *fPlist;
00081 const TGPicture *fPdetail;
00082 TGPictureButton *fCdup, *fListMode, *fDetailMode;
00083 TGListBox *fDir;
00084 TGListView *fFileView;
00085 TGFileContainer *fFileCont;
00086 TGComboBox *fFilterBox;
00087
00088 TObjArray *fHisto;
00089 Int_t position;
00090 Bool_t flags[kMaxHist];
00091 TPad *pads[16];
00092
00093 Int_t histInd[16];
00094 Int_t horLay[4];
00095 Int_t verLay[4];
00096 Int_t cursorIter;
00097 Int_t xDiv, yDiv;
00098
00099
00100 Bool_t toGreen(Window_t id);
00101 Bool_t toDefault(Window_t id);
00102 Bool_t isOverlap();
00103 Bool_t isLayout();
00104
00105 void toScan();
00106
00107 public:
00108 HistAction(const TGWindow *p, UInt_t w, UInt_t h);
00109 virtual ~HistAction();
00110 virtual void CloseWindow();
00111 virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
00112 Int_t getNextTrueIndex();
00113 void resetIter() {cursorIter = -1;}
00114 void resetFlags() { for (int i = 0; i < kMaxHist; i++) flags[i] = kFALSE; }
00115 void setCanvasDivision(Int_t number);
00116 void drawHist();
00117 void processBoxB(Int_t par);
00118 void doubleclickedBoxA(const char *text);
00119 Bool_t importHist(const char *name);
00120 Bool_t importFromFile(const char *filename);
00121 void clearScan();
00122 void paintHist();
00123
00124 ClassDef(HistAction,0)
00125 };
00126
00127 #endif