openshot-audio  0.1.2
juce_BooleanPropertyComponent.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_BOOLEANPROPERTYCOMPONENT_H_INCLUDED
26 #define JUCE_BOOLEANPROPERTYCOMPONENT_H_INCLUDED
27 
28 
29 //==============================================================================
39  private ButtonListener // (can't use Button::Listener due to idiotic VC2005 bug)
40 {
41 protected:
42  //==============================================================================
52  BooleanPropertyComponent (const String& propertyName,
53  const String& buttonTextWhenTrue,
54  const String& buttonTextWhenFalse);
55 
56 public:
67  BooleanPropertyComponent (const Value& valueToControl,
68  const String& propertyName,
69  const String& buttonText);
70 
73 
74  //==============================================================================
76  virtual void setState (bool newState);
77 
79  virtual bool getState() const;
80 
81  //==============================================================================
89  enum ColourIds
90  {
91  backgroundColourId = 0x100e801,
92  outlineColourId = 0x100e803,
93  };
94 
95  //==============================================================================
97  void paint (Graphics&) override;
99  void refresh() override;
101  void buttonClicked (Button*) override;
102 
103 private:
104  ToggleButton button;
105  String onText, offText;
106 
108 };
109 
110 
111 #endif // JUCE_BOOLEANPROPERTYCOMPONENT_H_INCLUDED
ButtonState getState() const noexcept
Definition: juce_Button.h:347
Definition: juce_PropertyComponent.h:45
virtual void buttonClicked(Button *)=0
Definition: juce_Button.h:39
Definition: juce_String.h:43
#define JUCE_API
Definition: juce_StandardHeader.h:139
void setState(ButtonState newState)
Definition: juce_Button.cpp:291
Definition: juce_Button.h:162
void paint(Graphics &) override
Definition: juce_Button.cpp:424
Definition: juce_Value.h:44
#define JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(className)
Definition: juce_PlatformDefs.h:198
Definition: juce_GraphicsContext.h:42
ColourIds
Definition: juce_BooleanPropertyComponent.h:89
virtual void refresh()=0
Definition: juce_ToggleButton.h:38
Definition: juce_BooleanPropertyComponent.h:38