Krotos Modules 3
Loading...
Searching...
No Matches
krotos::TopBarComponent Class Reference

The TopBarComponent in each Kwidget containing the 3 Buttons and their functionality. More...

#include <topBarComponent.h>

Inheritance diagram for krotos::TopBarComponent:

Public Member Functions

 TopBarComponent (bool isSelectable, const String &parentID)
 
void resized () override
 
void paint (Graphics &g) override
 

Public Attributes

std::function< void(const String &)> onSelect
 
std::function< void(const String &)> onDelete
 
std::function< void(bool isMinimised)> onMinimise
 
TextButton m_selectButton
 
TextButton m_deleteButton
 
TextButton m_minimiseButton
 

Private Member Functions

void mouseDown (const MouseEvent &event) override
 
void mouseDrag (const MouseEvent &event) override
 

Private Attributes

Rectangle< int > m_currentBounds
 
Colour m_borderColour {Colours::fuchsia}
 
Label m_label
 
const int m_padding {5}
 
const float m_borderThickness {1.0f}
 
const int m_buttonSize {15}
 
const int m_minimumHeight {25}
 
const float m_topBarCornerSize {6.0f}
 
bool m_isSelectable {false}
 

Detailed Description

The TopBarComponent in each Kwidget containing the 3 Buttons and their functionality.

Minimising a KwidgetGUI only retains this Component, and dragging happens only if mouseClicks are called from within this.

Constructor & Destructor Documentation

◆ TopBarComponent()

krotos::TopBarComponent::TopBarComponent ( bool isSelectable,
const String & parentID )

Member Function Documentation

◆ mouseDown()

void krotos::TopBarComponent::mouseDown ( const MouseEvent & event)
overrideprivate

◆ mouseDrag()

void krotos::TopBarComponent::mouseDrag ( const MouseEvent & event)
overrideprivate

◆ paint()

void krotos::TopBarComponent::paint ( Graphics & g)
override

Perform any paint functions common to all Kwidgets here.

◆ resized()

void krotos::TopBarComponent::resized ( )
override

Resize the elements of this class using this function.

Member Data Documentation

◆ m_borderColour

Colour krotos::TopBarComponent::m_borderColour {Colours::fuchsia}
private

◆ m_borderThickness

const float krotos::TopBarComponent::m_borderThickness {1.0f}
private

◆ m_buttonSize

const int krotos::TopBarComponent::m_buttonSize {15}
private

◆ m_currentBounds

Rectangle<int> krotos::TopBarComponent::m_currentBounds
private

◆ m_deleteButton

TextButton krotos::TopBarComponent::m_deleteButton

◆ m_isSelectable

bool krotos::TopBarComponent::m_isSelectable {false}
private

◆ m_label

Label krotos::TopBarComponent::m_label
private

◆ m_minimiseButton

TextButton krotos::TopBarComponent::m_minimiseButton

◆ m_minimumHeight

const int krotos::TopBarComponent::m_minimumHeight {25}
private

◆ m_padding

const int krotos::TopBarComponent::m_padding {5}
private

◆ m_selectButton

TextButton krotos::TopBarComponent::m_selectButton

◆ m_topBarCornerSize

const float krotos::TopBarComponent::m_topBarCornerSize {6.0f}
private

◆ onDelete

std::function<void(const String&)> krotos::TopBarComponent::onDelete

Same as onSelect, called with the kwidgetID as a parameter, but used for deleting the kwidget

◆ onMinimise

std::function<void(bool isMinimised)> krotos::TopBarComponent::onMinimise

Same as onSelect, called with the kwidgetID as a parameter, but used for minimising the kwidgetGUI

◆ onSelect

std::function<void(const String&)> krotos::TopBarComponent::onSelect

Temporary solution for connecting Kwidgets. This function is called with the kwidgetID as a parameter whenever the Kwidget is selected for a connection.


The documentation for this class was generated from the following files: