#ifndef BROKENLINEDIALOG_H
#define BROKENLINEDIALOG_H

#include <QWidget>
#include <QDir>
#include <QMouseEvent>
#include "promptdialog.h"
#include "mybutton.h"
#include "setcontrolstyle.h"
//#include "Include/datafiledst.h"
#include "datafile/datafiledst.h"
#include "datafile/datafiledsr.h"
//#include "mctype/mainwidgetfunction.h"
#include <QDateTime>

namespace Ui {
class BrokenLineDialog;
}

class BrokenLineDialog : public QWidget
{
    Q_OBJECT

public:
    explicit BrokenLineDialog(QWidget *parent = 0);
    ~BrokenLineDialog();

    enum BTN_SHOW
    {
        BTN_BROKEN, //断线提示
        BTN_HEADEMB //隔头绣
    };


private slots:
    void on_buttonOk_clicked();
    void slotQuiEmbHeadBtnClick();//绗绣机机头按钮被点击
    void on_buttonHeadEmbOk_clicked();
    void on_buttonPgUp_clicked();
    void on_buttonPgDn_clicked();
    void on_buttonReset_clicked();
    void on_buttonReverse_clicked();
    void on_buttonCancel_clicked();
    void on_buttonQuiCurColorOrder_clicked();
    void on_buttonUp_clicked();
    void on_buttonDn_clicked();

private:
    Ui::BrokenLineDialog *ui;
    QList<QPushButton*> m_buttonEmbHeadList;
    int m_curColorOrder;//当前色序数
    int m_totalColorOrder;//总色序数
    int m_totalHead;//总机头数
    s16 m_curPage;
    u8 m_headBuf[HEADBUF];
    QString m_buttonStyle1;
    QString m_buttonStyle2;

private:
    void initWidget();
    void initControl();//初始化窗体控件，包括位置、尺寸、样式
    void initResolution1910();//初始化窗体控件为1920x1080分辨率
    void initResolution1006();//初始化窗体控件为1024x600分辨率
    void initControlStyle();//初始化窗体控件样式
    void refreshQuiColorOrderHead();//刷新绗绣机当前色序的机头工作号
    void initArabControlPos();//设置阿拉伯语时控件对齐方式

public:
    //int m_flag= 0;
    void initDialog(int sel = 0);//初始化窗体
    void initEmbHead(int headNum,int colorOrderNum,QString path);//初始化平绣机头
    void setTitleStr(QString str);//设置标题
    void setContentInfoStr(QString str);//设置内容
    void setContentStr(QString str);//设置内容
    void show(int flag=0);

    //鼠标事件
protected:
    void mousePressEvent(QMouseEvent *e);


signals:
    void siSetHeadData(u8* buf);

};

#endif // BROKENLINEDIALOG_H


