Jamba C++ API 7.5.0
Loading...
Searching...
No Matches
LookAndFeel.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2018 pongasoft
3 *
4 * Licensed under the Apache License, Version 2.0 or the MIT license,
5 * at your option. You may not use this file except in compliance with
6 * one of these licenses. You may obtain copies of the licenses at:
7 *
8 * https://www.apache.org/licenses/LICENSE-2.0
9 * https://opensource.org/licenses/MIT
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 * License for the specific language governing permissions and limitations under
15 * the License.
16 *
17 * @author Yan Pujante
18 */
19#pragma once
20
21#include <vstgui4/vstgui/lib/vstguibase.h>
22#include <vstgui4/vstgui/lib/crect.h>
23
24namespace pongasoft {
25namespace VST {
26namespace GUI {
27
28using namespace VSTGUI;
29
33struct Margin
34{
35 // Empty constructor (no margin)
36 Margin() = default;
37
38 // Constructor. Assign same value to all components
39 explicit Margin(CCoord iValue) noexcept :
40 fTop{iValue}, fRight{iValue}, fBottom{iValue}, fLeft{iValue} {}
41
42 // Constructor
43 Margin(CCoord iTop, CCoord iRight, CCoord iBottom, CCoord iLeft) noexcept :
44 fTop{iTop}, fRight{iRight}, fBottom{iBottom}, fLeft{iLeft} {}
45
49 CRect apply(CRect const &iRect) const {
50 CRect res(iRect);
51 res.top += fTop;
52 res.left += fLeft;
53 res.right -= fRight;
54 res.bottom -= fBottom;
55 return res;
56 }
57
58public:
59 CCoord fTop{};
60 CCoord fRight{};
61 CCoord fBottom{};
62 CCoord fLeft{};
63};
64
65}
66}
67}
Definition DrawContext.cpp:25
Definition Clock.h:24
Definition Clock.h:23
CRect apply(CRect const &iRect) const
Apply this margin to the provided rect.
Definition LookAndFeel.h:49
Margin(CCoord iTop, CCoord iRight, CCoord iBottom, CCoord iLeft) noexcept
Definition LookAndFeel.h:43
Margin(CCoord iValue) noexcept
Definition LookAndFeel.h:39
CCoord fLeft
Definition LookAndFeel.h:62
CCoord fTop
Definition LookAndFeel.h:59
CCoord fRight
Definition LookAndFeel.h:60
CCoord fBottom
Definition LookAndFeel.h:61