Krotos Modules 3
Loading...
Searching...
No Matches
topBarComponent.h
Go to the documentation of this file.
1#pragma once
2namespace krotos
3{
4 //==============================================================================
13 class TopBarComponent : public Component
14 {
15 public:
16 TopBarComponent(bool isSelectable, const String& parentID);
17
19 void resized() override;
20
22 void paint(Graphics& g) override;
23
27 std::function<void(const String&)> onSelect;
28
32 std::function<void(const String&)> onDelete;
33
37 std::function<void(bool isMinimised)> onMinimise;
38
39 TextButton m_selectButton;
40 TextButton m_deleteButton;
41 TextButton m_minimiseButton;
42
43 private:
44 void mouseDown(const MouseEvent& event) override;
45 void mouseDrag(const MouseEvent& event) override;
46
47 Rectangle<int> m_currentBounds;
48 Colour m_borderColour{Colours::fuchsia};
49 Label m_label;
50
51 const int m_padding{5};
52 const float m_borderThickness{1.0f};
53 const int m_buttonSize{15};
54 const int m_minimumHeight{25};
55 const float m_topBarCornerSize{6.0f};
56
57 bool m_isSelectable{false};
58 // KwidgetGUI* m_gui{nullptr};
59 };
60} // namespace krotos
The TopBarComponent in each Kwidget containing the 3 Buttons and their functionality.
Definition topBarComponent.h:14
const int m_padding
Definition topBarComponent.h:51
TopBarComponent(bool isSelectable, const String &parentID)
Definition topBarComponent.cpp:3
Label m_label
Definition topBarComponent.h:49
const int m_buttonSize
Definition topBarComponent.h:53
std::function< void(const String &)> onDelete
Definition topBarComponent.h:32
std::function< void(bool isMinimised)> onMinimise
Definition topBarComponent.h:37
TextButton m_deleteButton
Definition topBarComponent.h:40
void resized() override
Definition topBarComponent.cpp:51
const float m_borderThickness
Definition topBarComponent.h:52
std::function< void(const String &)> onSelect
Definition topBarComponent.h:27
void paint(Graphics &g) override
Definition topBarComponent.cpp:80
const float m_topBarCornerSize
Definition topBarComponent.h:55
TextButton m_selectButton
Definition topBarComponent.h:39
bool m_isSelectable
Definition topBarComponent.h:57
Rectangle< int > m_currentBounds
Definition topBarComponent.h:47
const int m_minimumHeight
Definition topBarComponent.h:54
void mouseDrag(const MouseEvent &event) override
Definition topBarComponent.cpp:88
void mouseDown(const MouseEvent &event) override
Definition topBarComponent.cpp:86
TextButton m_minimiseButton
Definition topBarComponent.h:41
Colour m_borderColour
Definition topBarComponent.h:48
Definition AirAbsorptionFilter.cpp:2