openshot-audio  0.1.6
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
Definition: juce_ToolbarButton.h:39
Definition: juce_String.h:43
#define JUCE_API
Definition: juce_StandardHeader.h:139
Definition: juce_Rectangle.h:36
virtual void paintButtonArea(Graphics &g, int width, int height, bool isMouseOver, bool isMouseDown)=0
Definition: juce_ToolbarItemComponent.h:47
png_const_structrp png_const_inforp int png_fixed_point * width
Definition: juce_PNGLoader.cpp:2339
virtual void buttonStateChanged()
Definition: juce_Button.cpp:311
Definition: juce_Drawable.h:35
#define JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(className)
Definition: juce_PlatformDefs.h:198
virtual void contentAreaChanged(const Rectangle< int > &newBounds)=0
Definition: juce_GraphicsContext.h:42
void enablementChanged() override
Definition: juce_Button.cpp:264
virtual bool getToolbarItemSizes(int toolbarThickness, bool isToolbarVertical, int &preferredSize, int &minSize, int &maxSize)=0
void resized() override
Definition: juce_ToolbarItemComponent.cpp:196