Vital
Loading...
Searching...
No Matches
border_bounds_constrainer.h
Go to the documentation of this file.
1#pragma once
2
3#include "JuceHeader.h"
4
5class FullInterface;
6
15class BorderBoundsConstrainer : public ComponentBoundsConstrainer {
16public:
21 BorderBoundsConstrainer() : ComponentBoundsConstrainer(), gui_(nullptr) { }
22
40 virtual void checkBounds(Rectangle<int>& bounds, const Rectangle<int>& previous,
41 const Rectangle<int>& limits,
42 bool stretching_top, bool stretching_left,
43 bool stretching_bottom, bool stretching_right) override;
44
51 virtual void resizeStart() override;
52
59 virtual void resizeEnd() override;
60
66 void setBorder(const BorderSize<int>& border) { border_ = border; }
67
73 void setGui(FullInterface* gui) { gui_ = gui; }
74
75protected:
80
84 BorderSize<int> border_;
85
86 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(BorderBoundsConstrainer)
87};
A specialized ComponentBoundsConstrainer that applies border constraints and maintains aspect ratios ...
Definition border_bounds_constrainer.h:15
virtual void resizeEnd() override
Called after a resize operation finishes.
Definition border_bounds_constrainer.cpp:53
void setBorder(const BorderSize< int > &border)
Sets the border size that should be enforced during resizing.
Definition border_bounds_constrainer.h:66
FullInterface * gui_
A pointer to the associated GUI interface, which may be nullptr if none is set.
Definition border_bounds_constrainer.h:79
virtual void resizeStart() override
Called before a resize operation begins.
Definition border_bounds_constrainer.cpp:47
virtual void checkBounds(Rectangle< int > &bounds, const Rectangle< int > &previous, const Rectangle< int > &limits, bool stretching_top, bool stretching_left, bool stretching_bottom, bool stretching_right) override
Adjusts the given bounds to enforce border constraints, maintain aspect ratio, and limit the window s...
Definition border_bounds_constrainer.cpp:6
void setGui(FullInterface *gui)
Associates a FullInterface instance with this constrainer.
Definition border_bounds_constrainer.h:73
BorderSize< int > border_
The border to be applied to the component bounds.
Definition border_bounds_constrainer.h:84
BorderBoundsConstrainer()
Constructs a new BorderBoundsConstrainer with no associated GUI and default border settings.
Definition border_bounds_constrainer.h:21
The main GUI container for the entire synthesizer interface.
Definition full_interface.h:61