VAPoR  3.0.0
tabmanager.h
Go to the documentation of this file.
1 //************************************************************************
2 // *
3 // Copyright (C) 2004 *
4 // University Corporation for Atmospheric Research *
5 // All Rights Reserved *
6 // *
7 //************************************************************************/
8 //
9 // File: tabmanager.h
10 //
11 // Author: Alan Norton
12 // National Center for Atmospheric Research
13 // PO 3000, Boulder, Colorado
14 //
15 // Date: May 2015
16 //
17 // Description: Defines the TabManager class. This is the QTabWidget
18 // that contains a tab for each of the Params classes
19 //
20 #ifndef TABMANAGER_H
21 #define TABMANAGER_H
22 #include <qtabwidget.h>
23 #include <qwidget.h>
24 #include "params.h"
25 #include "eventrouter.h"
26 
27 namespace VAPoR {
28 
29 class MainForm;
30 class ControlExec;
31 class RenderHolder;
32 
55 
60 class TabManager : public QTabWidget{
61 
62  Q_OBJECT
63 
64  public:
66  TabManager(QWidget* parent, const char* name);
67 
72  void addWidget(QWidget* evWid, string Tag);
73 
78  QWidget* getSubTabWidget(int widType){
79  return _topWidgets[widType];
80  }
81 
84  static TabManager* getInstance() { return _tabManager;}
85 
88  void installWidgets();
89 
93  void showRenderWidget(string tag);
94 
96  void hideRenderWidgets();
97 
102  return VizWinMgr::getInstance()->getEventRouter(_widgetTags[_currentTopTab][_currentFrontPage[_currentTopTab]]);
103  }
104 
106  void refresh();
107 
111  int moveToFront(string widgetTag);
112 
116  bool isFrontTab(QWidget* wid);
117 
118  protected slots:
121  void newTopTab(int tabnum);
125  void newSubTab(int tabid);
126 
127 
129 
130 #ifndef DOXYGEN_SKIP_THIS
131  private:
132 
133  //Find the position of the specified widget in subTab, or -1 if it isn't there.
134  //
135  int findWidget(string widgetTag);
136 
137  virtual QSize sizeHint() const { return QSize(460, 800);}
138 
139  // This prevents a "beep" from occuring when you press enter on the Mac.
140  virtual void keyPressEvent(QKeyEvent* e){
141  e->accept();
142  }
143 
144  int getTabType(string tag);
145  void newFrontTab(int topType, int subPosn);
146 
147 
148  private:
149  //Data structures to store widget info
150  vector<QWidget*> _widgets[3];
151 
152  vector<string> _widgetTags[3];
153  QWidget* _topWidgets[3];
154  QString _topName[3];
155  int _currentFrontPage[3];
156  int _currentTopTab;
157  QWidget* _parent;
158  RenderHolder* _renderHolder;
159  static TabManager* _tabManager;
160 #endif //DOXYGEN_SKIP_THIS
161 
162 };
163 };
164 
165 
166 
167 #endif //TABMANAGER_H
168 
int moveToFront(string widgetTag)
bool isFrontTab(QWidget *wid)
void refresh()
Force a re-display of the current front tab.
A pure virtual class specifying the common properties of all the parameter tabs in the VAPOR GUI...
Definition: eventrouter.h:101
void newSubTab(int tabid)
void hideRenderWidgets()
All the render EventRouter widgets are hidden until one is selected, using this method.
EventRouter * getFrontEventRouter()
Definition: tabmanager.h:101
TabManager(QWidget *parent, const char *name)
Constructor: Invoked by the MainForm during the set up of the main window.
void addWidget(QWidget *evWid, string Tag)
static EventRouter * getEventRouter(const std::string &tag)
static VizWinMgr * getInstance()
Definition: vizwinmgr.h:159
void newTopTab(int tabnum)
QWidget * getSubTabWidget(int widType)
Definition: tabmanager.h:78
static TabManager * getInstance()
Definition: tabmanager.h:84
Definition: DC.h:10
A class that manages the contents of the parameter tabs in VAPOR GUI.
Definition: tabmanager.h:60
void showRenderWidget(string tag)