Open Ephys GUI
 All Classes Functions Variables Pages
CustomLookAndFeel.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 __CUSTOMLOOKANDFEEL_H_6B021009__
25 #define __CUSTOMLOOKANDFEEL_H_6B021009__
26 
27 #include "../../JuceLibraryCode/JuceHeader.h"
28 
29 /**
30 
31  Used to modify the appearance of the application.
32 
33  Currently contains methods for drawing custom tabs, custom
34  scroll bars, and custom sliders.
35 
36  @see MainWindow
37 
38 */
39 
40 class CustomLookAndFeel : public LookAndFeel
41 
42 {
43 public:
46 
47  // ======== custom fonts ================
48  Typeface::Ptr Miso;
49 
50  // ======== custom tab methods: =============================
51 
52  void drawTabButton (Graphics & g,
53  int w, int h,
54  const Colour& preferredColour,
55  int tabIndex, const String& text,
56  Button& button,
57  TabbedButtonBar::Orientation,
58  bool isMouseOver,
59  bool isMouseDown,
60  bool isFrontTab);
61 
62  void drawTabButtonText (Graphics& g,
63  int x, int y, int w, int h,
64  const Colour& preferredBackgroundColour,
65  int tabIndex,
66  const String& text,
67  Button& button,
68  TabbedButtonBar::Orientation o,
69  bool isMouseOver,
70  bool isMouseDown,
71  bool isFrontTab);
72 
73  int getTabButtonBestWidth (int tabIndex,
74  const String& text,
75  int tabDepth,
76  Button& button);
77 
78  int getTabButtonSpaceAroundImage ();
79 
80  void drawTabAreaBehindFrontButton (Graphics& g,
81  int w, int h,
82  TabbedButtonBar& tabBar,
83  TabbedButtonBar::Orientation o);
84 
85  int getTabButtonOverlap (int tabDepth);
86 
87  // ======== custom scroll bar methods: =============================
88 
89  void drawScrollbarButton (Graphics& g,
90  ScrollBar& scrollbar,
91  int width, int height,
92  int buttonDirection,
93  bool isScrollBarVertical,
94  bool isMouseOverButton,
95  bool isButtonDown);
96 
97  void drawScrollbar (Graphics& g,
98  ScrollBar& scrollbar,
99  int x, int y,
100  int width, int height,
101  bool isScrollbarVertical,
102  int thumbStartPosition,
103  int thumbSize,
104  bool isMouseOver,
105  bool isMouseDown);
106 
107 
108  // ======== custom slider methods: =============================
109 
110  void drawLinearSliderThumb (Graphics& g,
111  int x, int y,
112  int width, int height,
113  float sliderPos,
114  float minSliderPos,
115  float maxSliderPos,
116  const Slider::SliderStyle style,
117  Slider& slider);
118 
119  void drawLinearSliderBackground (Graphics& g,
120  int x, int y,
121  int width, int height,
122  float /*sliderPos*/,
123  float /*minSliderPos*/,
124  float /*maxSliderPos*/,
125  const Slider::SliderStyle /*style*/,
126  Slider& slider);
127 
128 
129  int getSliderThumbRadius (Slider& slider);
130 
131  void drawSliderKnob (Graphics& g,
132  const float x, const float y,
133  const float diameter,
134  const Colour& colour,
135  const float outlineThickness) throw();
136 
137  void drawGlassPointer (Graphics& g,
138  const float x, const float y,
139  const float diameter,
140  const Colour& colour, const float outlineThickness,
141  const int direction) throw();
142 
143  // const Typeface::Ptr getTypefaceForFont (const Font& font);
144 
145  // ======== custom combo box methods: =============================
146 
147  void drawComboBox (Graphics& g, int width, int height,
148  const bool isButtonDown,
149  int buttonX, int buttonY,
150  int buttonW, int buttonH,
151  ComboBox& box);
152 
153 private:
154 
155 
156 };
157 
158 
159 #endif // __CUSTOMLOOKANDFEEL_H_6B021009__