Open Ephys GUI
 All Classes Functions Variables Pages
DataViewport.h
1 /*
2  ------------------------------------------------------------------
3 
4  This file is part of the Open Ephys GUI
5  Copyright (C) 2012 Open Ephys
6 
7  ------------------------------------------------------------------
8 
9  This program is free software: you can redistribute it and/or modify
10  it under the terms of the GNU General Public License as published by
11  the Free Software Foundation, either version 3 of the License, or
12  (at your option) any later version.
13 
14  This program is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with this program. If not, see <http://www.gnu.org/licenses/>.
21 
22 */
23 
24 #ifndef __DATAVIEWPORT_H_B38FE628__
25 #define __DATAVIEWPORT_H_B38FE628__
26 
27 #include "../../JuceLibraryCode/JuceHeader.h"
28 #include "../AccessClass.h"
29 
30 /**
31 
32  Holds tabs for visualizers.
33 
34  Editors that create OpenGL visualizers can either place them
35  in the DataViewport, for easy access on small monitors, or in
36  a separate window, for maximum flexibility.
37 
38  @see GenericEditor, InfoLabel, LfpDisplayCanvas
39 
40 */
41 
42 class GenericEditor;
43 
44 class DataViewport : public TabbedComponent,
45  public AccessClass
46 
47 {
48 public:
49  DataViewport();
50  ~DataViewport();
51 
52  /** Adds a new tab and returns the tab index.*/
53  int addTabToDataViewport(String tabName, Component* componentToAdd, GenericEditor* editor);
54 
55  /** Removes a tab with a specified index.*/
56  void destroyTab(int);
57 
58  /** Select a tab with a specified index.*/
59  void selectTab(int);
60 
61  /** Informs the component of the current tab that it's now active.*/
62  void currentTabChanged(int newIndex, const String& newTabName);
63 
64  /** Prevent DataViewport from signaling EditorViewport when changing tabs.*/
66 
67 private:
68 
69  Array<int> tabArray;
70  Array<GenericEditor*> editorArray;
71  void paint(Graphics& g);
72  int tabDepth;
73 
74  bool shutdown;
75 
76  JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (DataViewport);
77 
78 };
79 
80 
81 
82 #endif // __DATAVIEWPORT_H_B38FE628__