2020-06-08 21:27:17 +02:00
|
|
|
//
|
|
|
|
// Created by versustune on 07.06.20.
|
|
|
|
//
|
|
|
|
|
|
|
|
#include "LabelComponent.h"
|
|
|
|
|
2020-06-13 16:52:16 +02:00
|
|
|
LabelComponent::LabelComponent (Component* parent, std::string name)
|
|
|
|
{
|
2020-06-08 21:27:17 +02:00
|
|
|
m_text = name;
|
|
|
|
m_parent = parent;
|
2020-06-13 16:52:16 +02:00
|
|
|
m_label = std::make_shared<Label> (m_parent->getName (), name);
|
2020-06-08 21:27:17 +02:00
|
|
|
}
|
|
|
|
|
2020-06-13 16:52:16 +02:00
|
|
|
LabelComponent::~LabelComponent ()
|
|
|
|
{
|
|
|
|
m_label.reset ();
|
2020-06-08 21:27:17 +02:00
|
|
|
}
|
|
|
|
|
2020-06-13 16:52:16 +02:00
|
|
|
void LabelComponent::resized ()
|
|
|
|
{
|
|
|
|
if (m_label != nullptr)
|
|
|
|
{
|
|
|
|
m_label->setBounds (0, 0, getWidth (), getHeight ());
|
2020-06-08 21:27:17 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-06-13 16:52:16 +02:00
|
|
|
void LabelComponent::paint (Graphics& g)
|
|
|
|
{
|
2020-06-08 21:27:17 +02:00
|
|
|
}
|
|
|
|
|
2020-06-13 16:52:16 +02:00
|
|
|
void LabelComponent::setPosition (LabelPosition position)
|
|
|
|
{
|
2020-06-08 21:27:17 +02:00
|
|
|
m_position = position;
|
|
|
|
}
|
|
|
|
|
2020-06-13 16:52:16 +02:00
|
|
|
LabelPosition LabelComponent::getLabelPosition ()
|
|
|
|
{
|
2020-06-08 21:27:17 +02:00
|
|
|
return m_position;
|
|
|
|
}
|