1#ifndef LIBS_GUI_CLABEL_HPP_
2#define LIBS_GUI_CLABEL_HPP_
6#include "third_party/magic_enum/magic_enum.hpp"
21 static CLabel *
createLabel(std::string_view nameResource,
const uint64_t &width,
const uint64_t &height);
23 static CLabel *
createLabel(std::string_view text, std::string_view nameResource,
const uint64_t &width,
24 const uint64_t &height,
double spacing = 5,
27 template<iv::concepts::EnumType T>
30 return createLabel(magic_enum::enum_name(enumValue));
33 template<iv::concepts::IntegerType T>
41 void setText(std::string_view text);
44 void setResource(std::string_view nameResource,
const uint64_t &width,
const uint64_t &height);
55 CLabel(std::string_view text,
const std::optional<iv::ui::resources::ImageResource> &resourceOpt,
Definition AbstractComponentGUI.hpp:30
Definition CDialog.hpp:21
eType
Definition CEnumCommon.hpp:27
IWidget * createWidget(CDialog *dialogFatherRef) override
Definition CLabel.cpp:137
void setText(std::string_view text)
Definition CLabel.cpp:59
void setSpacing(double spacing)
Setea el espaciado entre la imagen y el texto.
Definition CLabel.cpp:95
std::optional< iv::ui::resources::ImageResource > m_imageResourceOpt
Definition CLabel.hpp:69
uint32_t m_colorText
Definition CLabel.hpp:65
static CLabel * createLabelEnum(T enumValue)
Definition CLabel.hpp:28
void setColor(iv::types::color color)
Definition CLabel.cpp:69
iv::gui::eLabelStyle m_labelStyle
Definition CLabel.hpp:70
CLabel(std::string_view text, const std::optional< iv::ui::resources::ImageResource > &resourceOpt, CEnumCommon::eType type, double spacing=5)
Definition CLabel.cpp:8
static CLabel * createLabel(std::string_view text, CEnumCommon::eType type=CEnumCommon::eType::Value, iv::gui::eLabelStyle labelStyle=iv::gui::eLabelStyle::Normal)
Definition CLabel.cpp:26
void setLabelStyle(iv::gui::eLabelStyle labelStyle)
Definition CLabel.cpp:105
double m_spacing
Definition CLabel.hpp:62
IWidget * m_labelRef
Definition CLabel.hpp:72
CEnumCommon::eType m_type
Definition CLabel.hpp:63
void setHeight(double fontHeight)
Definition CLabel.cpp:80
bool m_isFontHeightDefined
Definition CLabel.hpp:66
double m_fontHeight
Definition CLabel.hpp:67
static CLabel * createLabelValue(const T value)
Definition CLabel.hpp:34
bool m_isColorDefined
Definition CLabel.hpp:64
std::string m_text
Definition CLabel.hpp:60
static CLabel * createLabelBool(const bool &isOk)
Definition CLabel.cpp:41
std::string getText()
Definition CLabel.cpp:115
void setResource(std::string_view nameResource, const uint64_t &width, const uint64_t &height)
Definition CLabel.cpp:120
Definition CResourceImage.hpp:9
eLabelStyle
Definition enums.hpp:14
uint32_t color
Definition types.hpp:12
std::string formatNumber(T number, std::optional< uint8_t > precision=std::nullopt)
Check if a string is a number, only applies precision to floating point numbers.
Definition stringUtils.hpp:343