Add remaining files
[juce-lv2.git] / juce / source / src / gui / components / layout / juce_GroupComponent.cpp
blob7ba9765935546cb30c303493591db26f1357fd15
1 /*
2 ==============================================================================
4 This file is part of the JUCE library - "Jules' Utility Class Extensions"
5 Copyright 2004-11 by Raw Material Software Ltd.
7 ------------------------------------------------------------------------------
9 JUCE can be redistributed and/or modified under the terms of the GNU General
10 Public License (Version 2), as published by the Free Software Foundation.
11 A copy of the license is included in the JUCE distribution, or can be found
12 online at www.gnu.org/licenses.
14 JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
15 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
16 A PARTICULAR PURPOSE. See the GNU General Public License for more details.
18 ------------------------------------------------------------------------------
20 To release a closed-source product which uses JUCE, commercial licenses are
21 available: visit www.rawmaterialsoftware.com/juce for more information.
23 ==============================================================================
26 #include "../../../core/juce_StandardHeader.h"
28 BEGIN_JUCE_NAMESPACE
30 #include "juce_GroupComponent.h"
31 #include "../lookandfeel/juce_LookAndFeel.h"
34 //==============================================================================
35 GroupComponent::GroupComponent (const String& name,
36 const String& labelText)
37 : Component (name),
38 text (labelText),
39 justification (Justification::left)
41 setInterceptsMouseClicks (false, true);
44 GroupComponent::~GroupComponent()
48 //==============================================================================
49 void GroupComponent::setText (const String& newText)
51 if (text != newText)
53 text = newText;
54 repaint();
58 String GroupComponent::getText() const
60 return text;
63 //==============================================================================
64 void GroupComponent::setTextLabelPosition (const Justification& newJustification)
66 if (justification != newJustification)
68 justification = newJustification;
69 repaint();
73 void GroupComponent::paint (Graphics& g)
75 getLookAndFeel()
76 .drawGroupComponentOutline (g, getWidth(), getHeight(),
77 text, justification,
78 *this);
81 void GroupComponent::enablementChanged()
83 repaint();
86 void GroupComponent::colourChanged()
88 repaint();
92 END_JUCE_NAMESPACE