openshot-audio  0.1.7
juce_ToolbarButton.h
Go to the documentation of this file.
1 /*
2  ==============================================================================
3 
4  This file is part of the JUCE library.
5  Copyright (c) 2015 - ROLI Ltd.
6 
7  Permission is granted to use this software under the terms of either:
8  a) the GPL v2 (or any later version)
9  b) the Affero GPL v3
10 
11  Details of these licenses can be found at: www.gnu.org/licenses
12 
13  JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
14  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
15  A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16 
17  ------------------------------------------------------------------------------
18 
19  To release a closed-source product which uses JUCE, commercial licenses are
20  available: visit www.juce.com for more information.
21 
22  ==============================================================================
23 */
24 
25 #ifndef JUCE_TOOLBARBUTTON_H_INCLUDED
26 #define JUCE_TOOLBARBUTTON_H_INCLUDED
27 
28 
29 //==============================================================================
40 {
41 public:
42  //==============================================================================
60  ToolbarButton (int itemId,
61  const String& labelText,
62  Drawable* normalImage,
63  Drawable* toggledOnImage);
64 
66  ~ToolbarButton();
67 
68 
69  //==============================================================================
71  bool getToolbarItemSizes (int toolbarDepth, bool isToolbarVertical, int& preferredSize,
72  int& minSize, int& maxSize) override;
74  void paintButtonArea (Graphics&, int width, int height, bool isMouseOver, bool isMouseDown) override;
76  void contentAreaChanged (const Rectangle<int>&) override;
78  void buttonStateChanged() override;
80  void resized() override;
82  void enablementChanged() override;
83 
84 private:
85  //==============================================================================
86  ScopedPointer<Drawable> normalImage, toggledOnImage;
87  Drawable* currentImage;
88 
89  void updateDrawable();
90  Drawable* getImageToUse() const;
91  void setCurrentImage (Drawable*);
92 
94 };
95 
96 
97 #endif // JUCE_TOOLBARBUTTON_H_INCLUDED
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR
#define JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(className)
Definition: juce_PlatformDefs.h:198
ToolbarItemComponent::contentAreaChanged
virtual void contentAreaChanged(const Rectangle< int > &newBounds)=0
ToolbarItemComponent::paintButtonArea
virtual void paintButtonArea(Graphics &g, int width, int height, bool isMouseOver, bool isMouseDown)=0
String
Definition: juce_String.h:43
ToolbarButton
Definition: juce_ToolbarButton.h:39
JUCE_API
#define JUCE_API
Definition: juce_StandardHeader.h:139
Rectangle< int >
Drawable
Definition: juce_Drawable.h:35
ScopedPointer< Drawable >
Button::enablementChanged
void enablementChanged() override
Definition: juce_Button.cpp:264
Graphics
Definition: juce_GraphicsContext.h:42
Button::buttonStateChanged
virtual void buttonStateChanged()
Definition: juce_Button.cpp:311
ToolbarItemComponent::getToolbarItemSizes
virtual bool getToolbarItemSizes(int toolbarThickness, bool isToolbarVertical, int &preferredSize, int &minSize, int &maxSize)=0
ToolbarItemComponent::resized
void resized() override
Definition: juce_ToolbarItemComponent.cpp:196
ToolbarItemComponent
Definition: juce_ToolbarItemComponent.h:47