KolibriLib
|
Класс для работы с кнопками More...
#include <button.hpp>
Public Types | |
enum | Type { Image = 0 , Text } |
Public Member Functions | |
Button (const Coord &coord={0, 0}, const Size &size={20, 20}, unsigned Margin=UI::DefaultMargin, Color::Color ButtonColor=OS::sys_color_table.work_button) | |
Это конструктор | |
void | init (const Coord &coord={0, 0}, const Size &size={0, 0}, const std::string &text="button", const unsigned &Margin=UI::DefaultMargin, const Color::Color &ButtonColor=OS::sys_color_table.work_button) |
инициализировать параметры | |
void | init (const Coord &coord={0, 0}, const Size &size={0, 0}, const Images::image &image=Images::image(), const unsigned &Margin=DefaultMargin, const Color::Color &ButtonColor=OS::sys_color_table.work_button) |
инициализировать параметры | |
void | init (const Coord &coord={0, 0}, const Size &size={0, 0}, std::string Path=DefaultImage) |
инициализировать параметры | |
void | Render () |
Отрисовать кнопку | |
bool | Handler () |
Обработчик кнопки | |
bool | GetStatus () |
Получить сосояние кнопки на момент последней обработки | |
ButtonID | GetId () |
Получить номер кнопки | |
void | Deactivate () |
Деактивировать кнопку | |
void | Activate () |
Активировать кнопку | |
unsigned | GetType () |
Возвращает тип данных используемых в кнопке _type. | |
std::string | GetTextLabel () |
Возвращает текст кнопки | |
Images::image | GetImage () |
Получить изображение кнопки | |
void | SetText (std::string NewText) |
Изменить текст кнопки | |
~Button () | |
Декструктор | |
Button & | operator= (const Button &butt) |
![]() | |
UIElement (const Coord &coord={0, 0}, const Size &size={16, 16}, const Color::Color &MainColor=0, const unsigned &Margin=DefaultMargin) | |
Size | GetSize () |
void | SetSize (Size NewSize) |
unsigned | GetMargin () |
Color::Color | GetColor () |
Получить осносной цвет элемента | |
void | SetColor (Color::Color NewColor) |
void | SetCoord (Coord NewCoord) |
Coord | GetCoord () |
UIElement & | operator= (const UIElement &Element) |
Additional Inherited Members | |
![]() | |
Coord | _coord |
Координаты | |
Size | _size |
Размер | |
Color::Color | _MainColor |
unsigned | _Margin |
Отступы | |
Класс для работы с кнопками
KolibriLib::UI::buttons::Button::Button | ( | const Coord & | coord = {0, 0}, |
const Size & | size = {20, 20}, | ||
unsigned | Margin = UI::DefaultMargin, | ||
Color::Color | ButtonColor = OS::sys_color_table.work_button ) |
Это конструктор
coord | координата |
size | размер |
text | текст |
Margin | отступы текста от границ |
ButtonColor | цвет кнопки |
TextColor | цвет текста |
void KolibriLib::UI::buttons::Button::Activate | ( | ) |
Активировать кнопку
void KolibriLib::UI::buttons::Button::Deactivate | ( | ) |
Деактивировать кнопку
ButtonID KolibriLib::UI::buttons::Button::GetId | ( | ) |
Получить номер кнопки
Images::image KolibriLib::UI::buttons::Button::GetImage | ( | ) |
Получить изображение кнопки
bool KolibriLib::UI::buttons::Button::GetStatus | ( | ) |
Получить сосояние кнопки на момент последней обработки
std::string KolibriLib::UI::buttons::Button::GetTextLabel | ( | ) |
Возвращает текст кнопки
unsigned KolibriLib::UI::buttons::Button::GetType | ( | ) |
bool KolibriLib::UI::buttons::Button::Handler | ( | ) |
Обработчик кнопки
void KolibriLib::UI::buttons::Button::init | ( | const Coord & | coord = {0, 0}, |
const Size & | size = {0, 0}, | ||
const Images::image & | image = Images::image(), | ||
const unsigned & | Margin = DefaultMargin, | ||
const Color::Color & | ButtonColor = OS::sys_color_table.work_button ) |
инициализировать параметры
coord | координата |
size | размер |
image | Изображение |
Margin | отступы текста от границ |
BackgroundColor | цвет кнопки |
TextColor | цвет текста |
void KolibriLib::UI::buttons::Button::init | ( | const Coord & | coord = {0, 0}, |
const Size & | size = {0, 0}, | ||
const std::string & | text = "button", | ||
const unsigned & | Margin = UI::DefaultMargin, | ||
const Color::Color & | ButtonColor = OS::sys_color_table.work_button ) |
инициализировать параметры
coord | координата |
size | размер |
text | текст |
Margin | отступы текста от границ |
BackgroundColor | цвет кнопки |
TextColor | цвет текста |
void KolibriLib::UI::buttons::Button::init | ( | const Coord & | coord = {0, 0}, |
const Size & | size = {0, 0}, | ||
std::string | Path = DefaultImage ) |
инициализировать параметры
coord | координата |
size | размер |
Path | Путь до изображения |
Margin | отступы текста от границ |
BackgroundColor | цвет кнопки |
TextColor | цвет текста |
void KolibriLib::UI::buttons::Button::SetText | ( | std::string | NewText | ) |
Изменить текст кнопки
Новый | текст кнопки |