#ifndef CCTRLGRAPHBUTTON_H
#define CCTRLGRAPHBUTTON_H

#include <QRect>
#include <QColor>
#include <QPainter>
#include <QVector>
#include <QMap>
#include "export_ctrls_common.h"
class CTRLS_COMMON_EXPORT CCtrlGraphButton
{
public:
    enum BtnPictureType
    {
        STR,
        EXPAND_H,
        REDUCE_H,
        EXPAND_V,
        REDUCE_V,
        LEFT,
        RIGHT,
        LEFT2,
        RIGHT2,
        UP,
        DOWN,
        UP2,
        DOWN2,
    };
    enum BtnState
    {
        PRESS,
        RELEASE,
    };
    CCtrlGraphButton();
    CCtrlGraphButton(int iBtnType,bool bDirectY);
    CCtrlGraphButton(QString& str,bool bDirectY);
    QRect m_rect;
    QColor m_pressColor;
    QColor m_releaseColor;
    int m_iBtnType;
    QString m_str;
    int m_iState;
    bool m_bChecked;
    void DrawButton(QPainter& painter);
    bool m_bBtnDirectY;
private:
    enum TriAngleDirect
    {
        TRI_UP,
        TRI_DOWN,
        TRI_LEFT,
        TRI_RIGHT,
    };
    void DrawTriAngle(QPainter& painter,const QRect& rect,int iType);
};
typedef QVector<CCtrlGraphButton> GRAPHBTNVECTOR;

typedef QMap<int,CCtrlGraphButton> GRAPHBTNMAP;
#endif // CCTRLGRAPHBUTTON_H
