LMMS
Loading...
Searching...
No Matches
juce_GroupComponent.cpp
Go to the documentation of this file.
1/*
2 ==============================================================================
3
4 This file is part of the JUCE library.
5 Copyright (c) 2022 - Raw Material Software Limited
6
7 JUCE is an open source library subject to commercial or open-source
8 licensing.
9
10 By using JUCE, you agree to the terms of both the JUCE 7 End-User License
11 Agreement and JUCE Privacy Policy.
12
13 End User License Agreement: www.juce.com/juce-7-licence
14 Privacy Policy: www.juce.com/juce-privacy-policy
15
16 Or: You may also use this code under the terms of the GPL v3 (see
17 www.gnu.org/licenses).
18
19 JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
20 EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
21 DISCLAIMED.
22
23 ==============================================================================
24*/
25
26namespace juce
27{
28
30 const String& labelText)
31 : Component (name),
32 text (labelText),
34{
35 setInterceptsMouseClicks (false, true);
36}
37
39
40void GroupComponent::setText (const String& newText)
41{
42 if (text != newText)
43 {
44 text = newText;
45 repaint();
46 }
47}
48
50{
51 return text;
52}
53
55{
56 if (justification != newJustification)
57 {
58 justification = newJustification;
59 repaint();
60 }
61}
62
64{
65 getLookAndFeel().drawGroupComponentOutline (g, getWidth(), getHeight(),
66 text, justification, *this);
67}
68
71
72//==============================================================================
73std::unique_ptr<AccessibilityHandler> GroupComponent::createAccessibilityHandler()
74{
75 return std::make_unique<AccessibilityHandler> (*this, AccessibilityRole::group);
76}
77
78} // namespace juce
void setInterceptsMouseClicks(bool allowClicksOnThisComponent, bool allowClicksOnChildComponents) noexcept
Definition juce_Component.cpp:1420
int getHeight() const noexcept
Definition juce_Component.h:274
void repaint()
Definition juce_Component.cpp:1917
Component() noexcept
Definition juce_Component.cpp:517
int getWidth() const noexcept
Definition juce_Component.h:271
LookAndFeel & getLookAndFeel() const noexcept
Definition juce_Component.cpp:2173
Definition juce_GraphicsContext.h:45
void setTextLabelPosition(Justification justification)
Definition juce_GroupComponent.cpp:54
String getText() const
Definition juce_GroupComponent.cpp:49
~GroupComponent() override
Definition juce_GroupComponent.cpp:38
std::unique_ptr< AccessibilityHandler > createAccessibilityHandler() override
Definition juce_GroupComponent.cpp:73
void setText(const String &newText)
Definition juce_GroupComponent.cpp:40
String text
Definition juce_GroupComponent.h:105
Justification justification
Definition juce_GroupComponent.h:106
void paint(Graphics &) override
Definition juce_GroupComponent.cpp:63
void enablementChanged() override
Definition juce_GroupComponent.cpp:69
void colourChanged() override
Definition juce_GroupComponent.cpp:70
GroupComponent(const String &componentName={}, const String &labelText={})
Definition juce_GroupComponent.cpp:29
Definition juce_Justification.h:41
Definition juce_String.h:53
int g
Definition inflate.c:1573
struct @113205115357366127300225113341150224053346037032::@137033172036070230260373056156374243321245367362 left
static const char * name
Definition pugl.h:1582
Definition carla_juce.cpp:31
@ group
Definition juce_AccessibilityRole.h:61