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.

38 lines
1.3 KiB

#ifndef USSIMPLEBUTTON_H
#define USSIMPLEBUTTON_H
#include "AutoProperty.h"
#define US_SIMPLE_BUTTON_PROPERTY_1(NAME) US_SIMPLE_BUTTON_BASE(NAME, "fake title", "", true, true)
#define US_SIMPLE_BUTTON_PROPERTY_2(NAME, TITLE) US_SIMPLE_BUTTON_BASE(NAME, TITLE, "", true, true)
#define US_SIMPLE_BUTTON_PROPERTY_3(NAME, TITLE, IMAGE) \
US_SIMPLE_BUTTON_BASE(NAME, TITLE, IMAGE, true, true)
#define US_SIMPLE_BUTTON_PROPERTY_4(NAME, TITLE, IMAGE, ENABLE) \
US_SIMPLE_BUTTON_BASE(NAME, TITLE, IMAGE, ENABLE, true)
#define US_SIMPLE_BUTTON_PROPERTY_5(NAME, TITLE, IMAGE, ENABLE, VISIBLE) \
US_SIMPLE_BUTTON_BASE(NAME, TITLE, IMAGE, ENABLE, VISIBLE)
#define US_SIMPLE_BUTTON_ROUTER(A, B, C, D, E, FUNC, ...) FUNC
#define US_SIMPLE_BUTTON(...) \
US_SIMPLE_BUTTON_ROUTER(__VA_ARGS__,\
US_SIMPLE_BUTTON_PROPERTY_5(__VA_ARGS__),\
US_SIMPLE_BUTTON_PROPERTY_4(__VA_ARGS__),\
US_SIMPLE_BUTTON_PROPERTY_3(__VA_ARGS__),\
US_SIMPLE_BUTTON_PROPERTY_2(__VA_ARGS__),\
US_SIMPLE_BUTTON_PROPERTY_1(__VA_ARGS__),\
)
#define US_SIMPLE_BUTTON_BASE(NAME, TITLE, IMAGE, ENABLE, VISIBLE) \
US_PROPERTY_VIEW_ONLY(QString, NAME ## Title, TITLE) \
US_PROPERTY_VIEW_ONLY(QString, NAME ## Image, IMAGE) \
US_PROPERTY_VIEW_ONLY(bool, NAME ## Enable, ENABLE) \
US_PROPERTY_VIEW_ONLY(bool, NAME ## Visible, VISIBLE)
#endif // USSIMPLEBUTTON_H