KolibriLib
Loading...
Searching...
No Matches
KolibriLib::UI::buttons Namespace Reference

Работа с кнопками More...

Classes

class  Button
 Класс для работы с кнопками More...
 
struct  ButtonsIdData
 Служебная структура, нигде не использется кроме ButtonsIdList. More...
 

Typedefs

typedef unsigned int ButtonID
 

Functions

unsigned GetFreeButtonId ()
 Получить свободный номер id кнопки из списка
 
void FreeButtonId (unsigned id)
 Освободить номер кнопки
 
ButtonID GetButtonId (unsigned id)
 Получить id кнопки
 
void CutList ()
 
unsigned autoDefineButton (const point< int > coords, const Size &size, ksys_color_t color=OS::sys_color_table.work_button)
 Создать кнопку, автоматически присвоить ей id.
 
void DefineButton (const point< int > &coord, const Size &size, const ButtonID &id, ksys_color_t color=OS::sys_color_table.work_button)
 Создать кнопку, вручную
 
void DeleteButton (unsigned id)
 Удалить кнопу
 
unsigned GetPressedButton ()
 проверить какая кнопка нажата
 

Variables

const ButtonID StartButtonId = 100
 
std::vector< ButtonsIdDataButtonsIdList
 Список idшников кнопок
 

Detailed Description

Работа с кнопками

Function Documentation

◆ autoDefineButton()

unsigned KolibriLib::UI::buttons::autoDefineButton ( const point< int > coords,
const Size & size,
ksys_color_t color = OS::sys_color_table.work_button )
inline

Создать кнопку, автоматически присвоить ей id.

Parameters
coordsкоординаты
sizeразмер
colorцвет
Returns
id созданной кнопки

◆ DefineButton()

void KolibriLib::UI::buttons::DefineButton ( const point< int > & coord,
const Size & size,
const ButtonID & id,
ksys_color_t color = OS::sys_color_table.work_button )
inline

Создать кнопку, вручную

Parameters
coordsкоординаты
sizeразмер
ididшник кнопки
colorцвет

◆ DeleteButton()

void KolibriLib::UI::buttons::DeleteButton ( unsigned id)
inline

Удалить кнопу

Parameters
idid удаляемой кнопки

◆ FreeButtonId()

void KolibriLib::UI::buttons::FreeButtonId ( unsigned id)
inline

Освободить номер кнопки

Parameters
idномер номер кнопки из списка ButtonsIdList

◆ GetButtonId()

ButtonID KolibriLib::UI::buttons::GetButtonId ( unsigned id)
inline

Получить id кнопки

Parameters
idномер кнопки

кнопки выдаваемый системой

Returns
ButtonsIdList[id].ID

◆ GetFreeButtonId()

unsigned KolibriLib::UI::buttons::GetFreeButtonId ( )

Получить свободный номер id кнопки из списка

функция может выполнятся очень долго, если вы уже создали довольно много кнопок. Это становится действительно важно когда у вас объявленно более 2000 кнопок

Returns
номер кнопки из списка ButtonsIdList

◆ GetPressedButton()

unsigned KolibriLib::UI::buttons::GetPressedButton ( )
inline

проверить какая кнопка нажата

Returns
id нажатой кнопки