Evita  0.16
evGUIFileInput.h
Go to the documentation of this file.
1 /*
2  *
3  * EVITA: Efficient Visualization of Terascale Datasets
4  * Copyright (C) 2000-2016 Team Evita
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public
17  * License along with this library; if not, write to the
18  * Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
19  * MA 02139, USA.
20  *
21  */
22 
23 
24 #ifndef __evGUIFileInput_h
25 #define __evGUIFileInput_h
26 
27 
28 #include <FL/Fl_Input.H>
29 #include <FL/Fl_Button.H>
30 #include <FL/Fl_File_Chooser.H>
31 
32 #include "evGUIObject.h"
33 
34 
35 #define EVGUIFILEINPUT_BUTTON_WIDTH 70
36 
37 
38 class evGUIFileInput : public evGUIObject, public Fl_Group
39 {
40 public:
41  evGUIFileInput(const int x, const int y,
42  const int width, const int height,
43  const int label_width,
44  const char *extension,
45  const char *label);
46  virtual ~evGUIFileInput(void);
47 
48  virtual const evString GetClassName(void) const
49  {
50  return(evString("evGUIFileInput"));
51  }
52 
53  const char *GetFilename(void) const;
54  void SetFilename(const char *filename);
55 
56  void SetCallback(Fl_Callback *callback, void *data);
57 
58 protected:
59 
60 private:
61  Fl_Input *FileInput;
63 
64  static void BrowseCallback(Fl_Widget *widget, void *data);
65 };
66 
67 
68 inline const char *evGUIFileInput::GetFilename(void) const
69 {
70  return(this->FileInput->value());
71 }
72 
73 
74 inline void evGUIFileInput::SetFilename(const char *filename)
75 {
76  this->FileInput->value(filename);
77 }
78 
79 
80 inline void evGUIFileInput::SetCallback(Fl_Callback *callback, void *data)
81 {
82  this->FileInput->callback(callback, data);
83 }
84 
85 
86 #endif
void SetFilename(const char *filename)
Definition: evGUIFileInput.h:74
virtual const evString GetClassName(void) const
Definition: evGUIFileInput.h:48
Definition: evGUIFileInput.h:38
evString Pattern
Definition: evGUIFileInput.h:62
evGUIFileInput(const int x, const int y, const int width, const int height, const int label_width, const char *extension, const char *label)
const char * GetFilename(void) const
Definition: evGUIFileInput.h:68
Fl_Input * FileInput
Definition: evGUIFileInput.h:61
void SetCallback(Fl_Callback *callback, void *data)
Definition: evGUIFileInput.h:80
virtual ~evGUIFileInput(void)
Definition: evGUIObject.h:33
static void BrowseCallback(Fl_Widget *widget, void *data)
Definition: evString.h:30