Diana Software
QGCutsFrame.hh
Go to the documentation of this file.
1 #ifndef _QG_CUTS_FRAME_
2 #define _QG_CUTS_FRAME_
3 
11 #include <map>
12 #include <string>
13 #include <vector>
14 #include "TGFrame.h"
15 
16 class QGDropDownBox;
17 class TGLabel;
18 class TGListBox;
19 class TGPictureButton;
20 
21 class QGCutsFrame : public TGCompositeFrame {
22 public:
24  QGCutsFrame(TGWindow *p = 0, UInt_t w = 100, UInt_t h = 100);
25 
27  virtual ~QGCutsFrame();
28 
30  void AddCut(const std::string& cut);
31 
33  static void ClearCopiedCuts();
34 
36  static void CopyCut(const std::string& cut);
37 
39  static const std::vector<std::string>& GetCopiedCuts() {return fCopiedCuts;}
40 
42  std::vector<std::string> GetCuts();
43 
45  TGListBox *GetCutsListBox() {return fCutsListBox;}
46 
49 
51  std::vector<Int_t> GetSelectedEntries();
52 
54  void HandleCopyButton();
55 
57  void HandleDropDownBox();
58 
60  void HandleEditButton();
61 
63  void HandlePasteButton();
64 
66  void HandleRemoveButton();
67 
69  void SetCuts(const std::vector<std::string>& cuts);
70 
72  void SetLabel(const std::string& label);
73 
74 private:
76  TGPictureButton *fAddButton;
77 
79  TGHorizontalFrame *fAddEditFrame;
80 
82  TGHorizontalFrame *fButtonsFrame;
83 
85  static std::vector<std::string> fCopiedCuts;
86 
88  TGPictureButton *fCopyButton;
89 
91  std::map<Int_t, std::string> fCuts;
92 
94  TGListBox *fCutsListBox;
95 
98 
100  TGPictureButton *fEditButton;
101 
103  Int_t fEditId;
104 
106  Int_t fId;
107 
109  TGLabel *fLabel;
110 
112  TGPictureButton *fPasteButton;
113 
115  TGPictureButton *fRemoveButton;
116 
117  ClassDef(QGCutsFrame, 0)
118 };
119 
120 #endif
Frame to handle editing of cuts.
Definition: QGCutsFrame.hh:21
std::vector< Int_t > GetSelectedEntries()
Get id numbers of selected entries in list box.
Definition: QGCutsFrame.cc:182
TGPictureButton * fAddButton
Add button.
Definition: QGCutsFrame.hh:76
static std::vector< std::string > fCopiedCuts
Cuts copied to the clipboard.
Definition: QGCutsFrame.hh:85
void AddCut(const std::string &cut)
Add cut.
Definition: QGCutsFrame.cc:83
TGListBox * GetCutsListBox()
Get pointer to cuts list box.
Definition: QGCutsFrame.hh:45
TGPictureButton * fRemoveButton
Remove button.
Definition: QGCutsFrame.hh:115
TGPictureButton * fCopyButton
Copy button.
Definition: QGCutsFrame.hh:88
static void ClearCopiedCuts()
Clear copied cuts.
Definition: QGCutsFrame.cc:91
void HandleDropDownBox()
Handle drop down box.
Definition: QGCutsFrame.cc:130
Int_t fEditId
Id of cut being edited.
Definition: QGCutsFrame.hh:103
TGPictureButton * fPasteButton
Paste button.
Definition: QGCutsFrame.hh:112
virtual ~QGCutsFrame()
Destructor.
Definition: QGCutsFrame.cc:78
static void CopyCut(const std::string &cut)
Copy cut.
Definition: QGCutsFrame.cc:96
TGPictureButton * fEditButton
Edit button.
Definition: QGCutsFrame.hh:100
TGHorizontalFrame * fButtonsFrame
Cuts buttons frame.
Definition: QGCutsFrame.hh:82
void HandleCopyButton()
Handle copy button.
Definition: QGCutsFrame.cc:111
void HandleEditButton()
Handle edit button.
Definition: QGCutsFrame.cc:150
QGDropDownBox * GetDropDownBox()
Get drop down box.
Definition: QGCutsFrame.hh:48
std::vector< std::string > GetCuts()
Get cuts.
Definition: QGCutsFrame.cc:101
QGCutsFrame(TGWindow *p=0, UInt_t w=100, UInt_t h=100)
Constructor.
Definition: QGCutsFrame.cc:25
static const std::vector< std::string > & GetCopiedCuts()
Get copied cuts.
Definition: QGCutsFrame.hh:39
QGDropDownBox * fDropDownBox
Drop down box.
Definition: QGCutsFrame.hh:97
TGHorizontalFrame * fAddEditFrame
Frame for drop down box and Add/Edit buttons.
Definition: QGCutsFrame.hh:79
void HandlePasteButton()
Handle paste button.
Definition: QGCutsFrame.cc:163
Int_t fId
Cut id.
Definition: QGCutsFrame.hh:106
TGLabel * fLabel
Label.
Definition: QGCutsFrame.hh:109
TGListBox * fCutsListBox
Cuts list box.
Definition: QGCutsFrame.hh:94
void HandleRemoveButton()
Handle remove button.
Definition: QGCutsFrame.cc:171
void SetCuts(const std::vector< std::string > &cuts)
Set cuts.
Definition: QGCutsFrame.cc:192
void SetLabel(const std::string &label)
Set label.
Definition: QGCutsFrame.cc:203
std::map< Int_t, std::string > fCuts
Cuts.
Definition: QGCutsFrame.hh:91
Drop down box with tab-complete.