ScanWindow.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 ///
3 /// \file ScanWindow.h
4 /// \brief A window containing dialog boxes for handscans
5 /// \author brebel@fnal.gov
6 /// \version $Id: ScanWindow.h,v 1.6 2012-08-10 17:01:17 messier Exp $
7 ///
8 ////////////////////////////////////////////////////////////////////////
9 
10 #ifndef EVDB_SCANWINDOW_H
11 #define EVDB_SCANWINDOW_H
12 
13 #include "nutools/EventDisplayBase/Canvas.h"
14 #include "RQ_OBJECT.h"
15 #include "TGCanvas.h"
16 #include "TGFrame.h"
17 #include <vector>
18 #include <iostream>
19 #include <fstream>
20 
21 
22 // Forward declarations
23 class TGNumberEntry;
24 class TGTextEntry;
25 class TGCheckButton;
26 class TGRadioButton;
27 class TGCanvas;
28 class TGMainFrame;
29 class TGCompositeFrame;
30 class TGGroupFrame;
31 class TGMatrixLayout;
32 class TGLayoutHints;
33 class TGLabel;
34 class TGTextButton;
35 class TGTextEntry;
36 class TGVScrollBar;
37 
38 namespace evdb{
39 
40  /// Helper class to setup scroll bars in evdb::ScanWindow
41  class ScanFrame {
42  RQ_OBJECT("evdb::ScanFrame")
43 
44  public:
45  ScanFrame(TGCompositeFrame* f);
46  virtual ~ScanFrame();
47 
48  TGGroupFrame *GetFrame() const { return fFrame; }
49 
50  void SetCanvas(TGCanvas *canvas) { fCanvas = canvas; }
51  void HandleMouseWheel(Event_t *event);
52  void RadioButton();
53  void ClearFields();
54  void Record(std::string outfilename,
55  const char* comments);
56 
57  int GetHeight() const;
58  int GetWidth() const;
59 
60  private:
61  TGGroupFrame* fFrame;
62  TGCanvas* fCanvas;
63  TGLayoutHints* fFrameHints;
64  TGLayoutHints* fFieldFrameHints;
65  TGLayoutHints* fCatFrameLH;
66 
67  std::vector<TGGroupFrame*> fCatFrames; ///< Mother for a category
68  std::vector<TGHorizontalFrame*> fFieldFrames; ///< Mother for each field
69  std::vector<TGTextEntry*> fTextBoxes; ///< Text box fields
70  std::vector<TGLabel*> fNumberLabels; ///< Label for number fields
71  std::vector<TGNumberEntry*> fNumberBoxes; ///< Number box fields
72  std::vector<TGRadioButton*> fRadioButtons; ///< Radio button fields
73  std::vector<TGCheckButton*> fCheckButtons; ///< Check button fields
74  std::vector<int> fRadioButtonIds; ///< Ids for the radio buttons
75 
76  };
77 }
78 
79 //......................................................................
80 
81 namespace evdb {
82 
83  class ScanWindow : public TGTransientFrame {
84 
85  public:
86 
87  RQ_OBJECT("evdb::ScanWindow")
88 
89  public:
90  ScanWindow();
91  ~ScanWindow();
92 
93  void CloseWindow();
94  void Rec();
95  void Prev();
96  void Next();
97 
98  void BuildButtonBar(TGHorizontalFrame* f);
99  void BuildUserFields(TGCompositeFrame* f);
100  void OpenOutputFile();
101 
102  private:
103  /// Scrollable frame for all user defined fields
104  TGCanvas* fUserFieldsCanvas;
105  TGCompositeFrame* fUserFieldsFrame;
106  TGLayoutHints* fUserFieldsHints;
107 
108  /// Frame to hold the buttons at the bottom of the window
109  TGHorizontalFrame* fButtonBar;
110  TGLayoutHints* fButtonBarHints;
111  TGLabel* fCommentLabel;
112  TGTextEntry* fCommentEntry;
113  TGTextButton* fPrevButton;
114  TGTextButton* fNextButton;
115  TGTextButton* fRcrdButton;
116  TGLayoutHints* fButtonBarHintsL;
117  TGLayoutHints* fButtonBarHintsC;
118  TGLayoutHints* fButtonBarHintsR;
119 
120  /// The frame containing the scanner check boxes etc.
122  std::string fOutFileName; ///< Output file name for scan results
123 
124  ClassDef(ScanWindow, 0)
125  };
126 
127 }// namespace
128 
129 #endif //EVD_SCANVIEW_H
TGTextButton * fNextButton
Definition: ScanWindow.h:114
int GetHeight() const
Definition: ScanWindow.cxx:175
TGGroupFrame * fFrame
Definition: ScanWindow.h:61
std::string string
Definition: nybbler.cc:12
TGLayoutHints * fFieldFrameHints
Definition: ScanWindow.h:64
Helper class to setup scroll bars in evdb::ScanWindow.
Definition: ScanWindow.h:41
void Record(std::string outfilename, const char *comments)
Definition: ScanWindow.cxx:261
TGLayoutHints * fCatFrameLH
Definition: ScanWindow.h:65
std::vector< TGTextEntry * > fTextBoxes
Text box fields.
Definition: ScanWindow.h:69
std::vector< TGCheckButton * > fCheckButtons
Check button fields.
Definition: ScanWindow.h:73
std::string fOutFileName
Output file name for scan results.
Definition: ScanWindow.h:122
Manage all things related to colors for the event display.
TGTextEntry * fCommentEntry
Definition: ScanWindow.h:112
std::vector< int > fRadioButtonIds
Ids for the radio buttons.
Definition: ScanWindow.h:74
TGLayoutHints * fFrameHints
Definition: ScanWindow.h:63
int GetWidth() const
Definition: ScanWindow.cxx:182
TGLayoutHints * fButtonBarHints
Definition: ScanWindow.h:110
std::vector< TGNumberEntry * > fNumberBoxes
Number box fields.
Definition: ScanWindow.h:71
TGLayoutHints * fUserFieldsHints
Definition: ScanWindow.h:106
void HandleMouseWheel(Event_t *event)
Definition: ScanWindow.cxx:190
TGLayoutHints * fButtonBarHintsL
Definition: ScanWindow.h:116
TGCanvas * fUserFieldsCanvas
Scrollable frame for all user defined fields.
Definition: ScanWindow.h:104
virtual ~ScanFrame()
Definition: ScanWindow.cxx:143
void SetCanvas(TGCanvas *canvas)
Definition: ScanWindow.h:50
TGHorizontalFrame * fButtonBar
Frame to hold the buttons at the bottom of the window.
Definition: ScanWindow.h:109
TGLabel * fCommentLabel
Definition: ScanWindow.h:111
ScanFrame * fScanFrame
The frame containing the scanner check boxes etc.
Definition: ScanWindow.h:121
TGTextButton * fPrevButton
Definition: ScanWindow.h:113
TGGroupFrame * GetFrame() const
Definition: ScanWindow.h:48
std::vector< TGGroupFrame * > fCatFrames
Mother for a category.
Definition: ScanWindow.h:67
TGTextButton * fRcrdButton
Definition: ScanWindow.h:115
TGCanvas * fCanvas
Definition: ScanWindow.h:62
std::vector< TGLabel * > fNumberLabels
Label for number fields.
Definition: ScanWindow.h:70
TGCompositeFrame * fUserFieldsFrame
Definition: ScanWindow.h:105
vector< string > comments
TGLayoutHints * fButtonBarHintsR
Definition: ScanWindow.h:118
std::vector< TGRadioButton * > fRadioButtons
Radio button fields.
Definition: ScanWindow.h:72
Event finding and building.
ScanFrame(TGCompositeFrame *f)
Definition: ScanWindow.cxx:37
std::vector< TGHorizontalFrame * > fFieldFrames
Mother for each field.
Definition: ScanWindow.h:68
TGLayoutHints * fButtonBarHintsC
Definition: ScanWindow.h:117