HGCal Test Beam  03a93d6239a951948e06fb3ef8dae4cbdebfad30
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Dialog.h
Go to the documentation of this file.
1 #ifndef FILEDIALOG_H
2 #define FILEDIALOG_H
3 //-----------------------------------------------------------------------------
4 // Original Author: Harrison B. Prosper
5 //-----------------------------------------------------------------------------
6 #include <iostream>
7 #include <vector>
8 #include <string>
9 //-----------------------------------------------------------------------------
10 #include "TGWindow.h"
11 #include "TGFileDialog.h"
12 //-----------------------------------------------------------------------------
13 
14 /// Simple wrapper around some TG dialogs
15 class Dialog
16 {
17 public:
18 
19  Dialog(const TGWindow* window, const TGWindow* main);
20 
21 
22  ~Dialog();
23 
24  ///
25  std::string SelectFile(EFileDialogMode dlg_type=kFDOpen,
26  std::string inidir=".",
27  std::string inifilename="");
28 
29  ///
30 
31  void SetText(std::string title,
32  std::string text,
33  UInt_t w=600,
34  UInt_t h=300);
35 
36  ///
37  std::string IniDir();
38 
39  ///
40  std::string GetInput(std::string prompt, std::string defstr="");
41 
42 private:
43  const TGWindow* window_;
44  const TGWindow* main_;
45  std::string _filename;
46  std::string _inidir;
47 };
48 
49 
50 
51 /// Simple wrapper around TGFileDialog.
53 {
54 public:
55 
56  FileDialog();
57 
58  ///
59  FileDialog(const TGWindow* window,
60  const TGWindow* main,
61  EFileDialogMode dlg_type=kFDOpen,
62  std::string inidir=".",
63  std::string inifilename="");
64 
65  ///
66  ~FileDialog();
67 
68  ///
69  std::string Filename();
70 
71  ///
72  std::string IniDir();
73 
74  private:
75  std::string _filename;
76  std::string _inidir;
77 };
78 
79 
80 /// Simple wrapper around TRootHelpDialog.
82 {
83 public:
84  HelpDialog();
85 
86  ///
87  HelpDialog(const TGWindow* main,
88  std::string title,
89  std::string text,
90  UInt_t w=600,
91  UInt_t h=300);
92 
93  ///
94  ~HelpDialog();
95 };
96 #endif
Simple wrapper around some TG dialogs.
Definition: Dialog.h:15
std::string GetInput(std::string prompt, std::string defstr="")
Definition: Dialog.cc:90
~Dialog()
Definition: Dialog.cc:71
FileDialog()
Definition: Dialog.cc:98
HelpDialog()
Definition: Dialog.cc:155
Simple wrapper around TRootHelpDialog.
Definition: Dialog.h:81
Simple wrapper around TGFileDialog.
Definition: Dialog.h:52
~FileDialog()
Definition: Dialog.cc:147
~HelpDialog()
Definition: Dialog.cc:170
std::string IniDir()
Definition: Dialog.cc:74
std::string SelectFile(EFileDialogMode dlg_type=kFDOpen, std::string inidir=".", std::string inifilename="")
Definition: Dialog.cc:25
Dialog(const TGWindow *window, const TGWindow *main)
Definition: Dialog.cc:18
std::string Filename()
Definition: Dialog.cc:150
int main(int argc, char *argv[])
std::string IniDir()
Definition: Dialog.cc:153
void SetText(std::string title, std::string text, UInt_t w=600, UInt_t h=300)
Definition: Dialog.cc:77