You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
70 lines
2.5 KiB
70 lines
2.5 KiB
#ifndef USSPINBOX_H
|
|
#define USSPINBOX_H
|
|
|
|
#include "AutoProperty.h"
|
|
|
|
#define US_SPIN_BOX_SHELL(NAME, \
|
|
TITLE, \
|
|
VALUES, \
|
|
PREFIX, \
|
|
SUFFIX, \
|
|
ENABLE, \
|
|
VISIBLE, \
|
|
DEFAULT_VALUE) \
|
|
US_PROPERTY_VIEW_ONLY(QString, NAME ## Title, TITLE) \
|
|
US_PROPERTY_VIEW_ONLY(QStringList, NAME ## Values, VALUES) \
|
|
US_PROPERTY_VIEW_ONLY(QString, NAME ## Prefix, PREFIX) \
|
|
US_PROPERTY_VIEW_ONLY(QString, NAME ## Suffix, SUFFIX) \
|
|
US_PROPERTY_VIEW_ONLY(bool, NAME ## Enable, ENABLE) \
|
|
US_PROPERTY_VIEW_ONLY(bool, NAME ## Visible, VISIBLE)
|
|
|
|
#define US_SPIN_BOX(NAME, \
|
|
TITLE, \
|
|
VALUES, \
|
|
PREFIX, \
|
|
SUFFIX, \
|
|
ENABLE, \
|
|
VISIBLE, \
|
|
DEFAULT_VALUE) \
|
|
US_SPIN_BOX_SHELL(NAME, TITLE, VALUES, PREFIX, SUFFIX, ENABLE, VISIBLE, DEFAULT_VALUE) \
|
|
US_PROPERTY(int, NAME, DEFAULT_VALUE)
|
|
|
|
#define US_SPIN_BOX_CUSTOM_SETTER(NAME, \
|
|
TITLE, \
|
|
VALUES, \
|
|
PREFIX, \
|
|
SUFFIX, \
|
|
ENABLE, \
|
|
VISIBLE, \
|
|
DEFAULT_VALUE) \
|
|
US_SPIN_BOX_SHELL(NAME, TITLE, VALUES, PREFIX, SUFFIX, ENABLE, VISIBLE, DEFAULT_VALUE) \
|
|
US_PROPERTY_CUSTOM_SETTER(int, NAME, DEFAULT_VALUE)
|
|
|
|
#define US_POPUP_BUTTON(NAME, TITLE, VALUES, PREFIX, SUFFIX, ENABLE, VISIBLE, DEFAULT_VALUE, \
|
|
SHOW_ACTIVE_BUTTON, RESET) \
|
|
US_SPIN_BOX(NAME, TITLE, VALUES, PREFIX, SUFFIX, ENABLE, VISIBLE, DEFAULT_VALUE) \
|
|
US_PROPERTY_INTERNAL(bool, NAME ## ShowActiveButton, SHOW_ACTIVE_BUTTON) \
|
|
US_PROPERTY_INTERNAL(bool, NAME ## Reset, RESET) \
|
|
|
|
#define US_POPUP_BUTTON_CUSTOM_SETTER(NAME, TITLE, VALUES, PREFIX, SUFFIX, ENABLE, VISIBLE, \
|
|
DEFAULT_VALUE, SHOW_ACTIVE_BUTTON, RESET) \
|
|
US_SPIN_BOX_CUSTOM_SETTER(NAME, TITLE, VALUES, PREFIX, SUFFIX, ENABLE, VISIBLE, DEFAULT_VALUE) \
|
|
US_PROPERTY_INTERNAL(bool, NAME ## ShowActiveButton, SHOW_ACTIVE_BUTTON) \
|
|
US_PROPERTY_CUSTOM_SETTER_INTERNAL(bool, NAME ## Reset, RESET) \
|
|
|
|
#define US_POPUP_BUTTON_CUSTOM_SETTER_CUSTOM_SHOW(NAME, \
|
|
TITLE, \
|
|
VALUES, \
|
|
PREFIX, \
|
|
SUFFIX, \
|
|
ENABLE, \
|
|
VISIBLE, \
|
|
DEFAULT_VALUE, \
|
|
SHOW_ACTIVE_BUTTON, \
|
|
RESET) \
|
|
US_SPIN_BOX_CUSTOM_SETTER(NAME, TITLE, VALUES, PREFIX, SUFFIX, ENABLE, VISIBLE, DEFAULT_VALUE) \
|
|
US_PROPERTY_CUSTOM_SETTER_INTERNAL(bool, NAME ## ShowActiveButton, SHOW_ACTIVE_BUTTON) \
|
|
US_PROPERTY_CUSTOM_SETTER_INTERNAL(bool, NAME ## Reset, RESET) \
|
|
|
|
|
|
#endif //USSPINBOX_H
|
|
|