LMMS
Loading...
Searching...
No Matches
juce_GridItem.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
32
37
38GridItem::Property::Property (const char* lineNameToUse) noexcept : GridItem::Property (String (lineNameToUse))
39{
40}
41
42GridItem::Property::Property (const String& lineNameToUse) noexcept : name (lineNameToUse), number (1)
43{
44}
45
46GridItem::Property::Property (int numberToUse) noexcept : number (numberToUse)
47{
48}
49
50GridItem::Property::Property (int numberToUse, const String& lineNameToUse) noexcept
51 : name (lineNameToUse), number (numberToUse)
52{
53}
54
56 : name (spanToUse.name), number (spanToUse.number), isSpan (true)
57{
58}
59
60
61//==============================================================================
63
65
67
68GridItem::Margin::Margin (float t, float r, float b, float l) noexcept : left (l), right (r), top (t), bottom (b) {}
69
70//==============================================================================
72GridItem::GridItem (Component& componentToUse) noexcept : associatedComponent (&componentToUse) {}
73GridItem::GridItem (Component* componentToUse) noexcept : associatedComponent (componentToUse) {}
74
75void GridItem::setArea (Property rowStart, Property columnStart, Property rowEnd, Property columnEnd)
76{
77 column.start = columnStart;
78 column.end = columnEnd;
79 row.start = rowStart;
80 row.end = rowEnd;
81}
82
83void GridItem::setArea (Property rowStart, Property columnStart)
84{
85 column.start = columnStart;
86 row.start = rowStart;
87}
88
89void GridItem::setArea (const String& areaName)
90{
91 area = areaName;
92}
93
94GridItem GridItem::withArea (Property rowStart, Property columnStart, Property rowEnd, Property columnEnd) const noexcept
95{
96 auto gi = *this;
97 gi.setArea (rowStart, columnStart, rowEnd, columnEnd);
98 return gi;
99}
100
101GridItem GridItem::withArea (Property rowStart, Property columnStart) const noexcept
102{
103 auto gi = *this;
104 gi.setArea (rowStart, columnStart);
105 return gi;
106}
107
108GridItem GridItem::withArea (const String& areaName) const noexcept
109{
110 auto gi = *this;
111 gi.setArea (areaName);
112 return gi;
113}
114
116{
117 auto gi = *this;
118 gi.row = newRow;
119 return gi;
120}
121
123{
124 auto gi = *this;
125 gi.column = newColumn;
126 return gi;
127}
128
129GridItem GridItem::withAlignSelf (AlignSelf newAlignSelf) const noexcept
130{
131 auto gi = *this;
132 gi.alignSelf = newAlignSelf;
133 return gi;
134}
135
136GridItem GridItem::withJustifySelf (JustifySelf newJustifySelf) const noexcept
137{
138 auto gi = *this;
139 gi.justifySelf = newJustifySelf;
140 return gi;
141}
142
143GridItem GridItem::withWidth (float newWidth) const noexcept
144{
145 auto gi = *this;
146 gi.width = newWidth;
147 return gi;
148}
149
150GridItem GridItem::withHeight (float newHeight) const noexcept
151{
152 auto gi = *this;
153 gi.height = newHeight;
154 return gi;
155}
156
157GridItem GridItem::withSize (float newWidth, float newHeight) const noexcept
158{
159 auto gi = *this;
160 gi.width = newWidth;
161 gi.height = newHeight;
162 return gi;
163}
164
165GridItem GridItem::withMargin (Margin newHeight) const noexcept
166{
167 auto gi = *this;
168 gi.margin = newHeight;
169 return gi;
170}
171
172GridItem GridItem::withOrder (int newOrder) const noexcept
173{
174 auto gi = *this;
175 gi.order = newOrder;
176 return gi;
177}
178
179} // namespace juce
#define noexcept
Definition DistrhoDefines.h:72
Definition juce_Component.h:36
void setArea(Property rowStart, Property columnStart, Property rowEnd, Property columnEnd)
Definition juce_GridItem.cpp:75
GridItem withOrder(int newOrder) const noexcept
Definition juce_GridItem.cpp:172
String area
Definition juce_GridItem.h:156
GridItem withJustifySelf(JustifySelf newJustifySelf) const noexcept
Definition juce_GridItem.cpp:136
AlignSelf
Definition juce_GridItem.h:116
Component * associatedComponent
Definition juce_GridItem.h:133
GridItem withMargin(Margin newMargin) const noexcept
Definition juce_GridItem.cpp:165
Keyword
Definition juce_GridItem.h:38
@ autoValue
Definition juce_GridItem.h:38
GridItem withColumn(StartAndEndProperty column) const noexcept
Definition juce_GridItem.cpp:122
GridItem withHeight(float newHeight) const noexcept
Definition juce_GridItem.cpp:150
StartAndEndProperty row
Definition juce_GridItem.h:153
GridItem withAlignSelf(AlignSelf newAlignSelf) const noexcept
Definition juce_GridItem.cpp:129
GridItem withSize(float newWidth, float newHeight) const noexcept
Definition juce_GridItem.cpp:157
GridItem() noexcept
StartAndEndProperty column
Definition juce_GridItem.h:150
GridItem withRow(StartAndEndProperty row) const noexcept
Definition juce_GridItem.cpp:115
GridItem withArea(Property rowStart, Property columnStart, Property rowEnd, Property columnEnd) const noexcept
Definition juce_GridItem.cpp:94
GridItem withWidth(float newWidth) const noexcept
Definition juce_GridItem.cpp:143
JustifySelf
Definition juce_GridItem.h:106
Definition juce_String.h:53
int * l
Definition inflate.c:1579
struct huft * t
Definition inflate.c:943
unsigned v[N_MAX]
Definition inflate.c:1584
struct @113205115357366127300225113341150224053346037032::@137033172036070230260373056156374243321245367362 left
struct @113205115357366127300225113341150224053346037032::@137033172036070230260373056156374243321245367362 right
static const char * name
Definition pugl.h:1582
#define jassert(expression)
Definition carla_juce.cpp:31
#define true
Definition ordinals.h:82
Definition juce_GridItem.h:176
Margin() noexcept
Definition juce_GridItem.cpp:62
float right
Definition juce_GridItem.h:183
float top
Definition juce_GridItem.h:184
float left
Definition juce_GridItem.h:182
float bottom
Definition juce_GridItem.h:185
Definition juce_GridItem.h:70
bool isAuto
Definition juce_GridItem.h:96
Property() noexcept
Definition juce_GridItem.cpp:29
int number
Definition juce_GridItem.h:94
bool isSpan
Definition juce_GridItem.h:95
Definition juce_GridItem.h:43
Definition juce_GridItem.h:101
int r
Definition crypt.c:458
b
Definition crypt.c:628