84 lines
3.5 KiB
C++
84 lines
3.5 KiB
C++
#ifndef FM_BUTTON_H
|
|
#define FM_BUTTON_H
|
|
|
|
#include "rm_button.h"
|
|
#include "fm_layer.h"
|
|
|
|
|
|
|
|
extern FM_COLOR_SET g_default_text_button_color_set[5];
|
|
|
|
class FMButton : public RMButton
|
|
{
|
|
Q_OBJECT
|
|
private:
|
|
void _setStyleSheet(const char* iconName);
|
|
void _setColorStyleSheet(const char* iconName, FM_COLOR_SET* color);
|
|
void _setCheckStyleSheet(const char* iconName);
|
|
void _setPropertyStyleSheet(const char* iconName,const char* property);
|
|
void _setStaticStyleSheet(const char* iconName);
|
|
public:
|
|
void _setPressCheckStyleSheet(const char* iconName);
|
|
|
|
void updateProperty(const char* property,bool enable);
|
|
|
|
#if (LIVE_LANGUAGE2)
|
|
enum FMBUTTON_TYPE{
|
|
BUTTON_TYPE_UNKNOWN = 0,
|
|
BUTTON_TYPE_ICON = 1,
|
|
BUTTON_TYPE_COLOR_ICON = 2,
|
|
BUTTON_TYPE_CHECK_ICON = 3,
|
|
BUTTON_TYPE_STATIC = 4,
|
|
BUTTON_TYPE_PROPERTY_ICON = 5,
|
|
};
|
|
FMBUTTON_TYPE type;
|
|
FM_COLOR_SET colorset[FM_COLOR_SET_COUNT]; // COLOR 저장
|
|
void setIcon(QString iconName) {
|
|
if(type == BUTTON_TYPE_COLOR_ICON) {
|
|
_setColorStyleSheet(iconName.toLocal8Bit().data(),colorset);
|
|
}
|
|
else if (type == BUTTON_TYPE_ICON) {
|
|
_setStyleSheet(iconName.toLocal8Bit().data());
|
|
}
|
|
}
|
|
#endif // LIVE_LANGUAGE2
|
|
|
|
int valueTag; // value tag
|
|
FMButton(QWidget *parent = 0);
|
|
~FMButton();
|
|
|
|
|
|
void blockFor(int ms);
|
|
|
|
static FMButton* btnEmpty(QWidget* parent, QLayout* layout,QString toolTip, QSize size, FM_COLOR_SET* color);
|
|
|
|
static FMButton* btnType0(QWidget* parent, QLayout* layout,const char* iconName, QString toolTip, QSize size, FM_COLOR_SET* color);
|
|
static FMButton* btnTypeChecked(QWidget* parent, QLayout* layout,const char* iconName, const char* iconName2, QString toolTip, QSize size, FM_COLOR_SET* color);
|
|
static FMButton* btnTypeText(QWidget* parent, QLayout* layout,QString title, QString toolTip, QSize size, FM_COLOR_SET* color);
|
|
static FMButton* btnTypeTextColor(QWidget* parent, QLayout* layout,QString title, QString toolTip, QSize size, FM_COLOR_SET* color);
|
|
|
|
#if (LIVE_LANGUAGE2)
|
|
static FMButton* btnColor2(QWidget* parent, QLayout* layout, const char* iconName, const char* toolTip, QSize size, FM_COLOR_SET* color);
|
|
static FMButton* btnStatic2(QWidget* parent, QLayout* layout, const char* iconName, const char* toolTip, QSize size);
|
|
static FMButton* btn2(QWidget* parent, QLayout* layout, const char* iconName, const char* toolTip, QSize size, int index = -1);
|
|
|
|
static FMButton* btnCheck2(QWidget* parent, QLayout* layout, const char* iconName, const char* toolTip, QSize size);
|
|
|
|
/**
|
|
* @brief Property 지정 버튼
|
|
*/
|
|
static FMButton* btnProperty(QWidget* parent, QLayout* layout, const char* iconName, const char* toolTip, const char* property, QSize size);
|
|
|
|
//! CHECKED 설정 이미지를 PRESSED 로 사용
|
|
static FMButton* btnPressCheck2(QWidget* parent, QLayout* layout, const char* iconName, const char* toolTip);
|
|
#else // LIVE_LANGUAGE2
|
|
static FMButton* btnColor(QWidget* parent, QLayout* layout, const char* iconName, QString toolTip, QSize size, FM_COLOR_SET* color);
|
|
static FMButton* btnStatic(QWidget* parent, QLayout* layout, const char* iconName, QString toolTip, QSize size);
|
|
static FMButton* btn(QWidget* parent, QLayout* layout, const char* iconName, QString toolTip, QSize size, int index = -1);
|
|
static FMButton* btnCheck(QWidget* parent, QLayout* layout, const char* iconName, QString toolTip, QSize size);
|
|
#endif // LIVE_LANGUAGE2
|
|
|
|
};
|
|
|
|
#endif // FM_BUTTON_H
|