#ifndef CCTRLPARAMTABLE_H
#define CCTRLPARAMTABLE_H

#include "cmwidget.h"
#include <QTableWidget>
#include <QGridLayout>
#include "variant.h"
#include <QDoubleValidator>
#include <QIntValidator>
#define M_Max_Table_RowY 100
#define M_Max_Table_ColoumX 100

#include "export_ctrls_common.h"
class CTRLS_COMMON_EXPORT CCtrlParamTable : public CMWidget
{
    Q_OBJECT
public:
    explicit CCtrlParamTable(QWidget *parent = 0);
public:
    QTableWidget* m_pTable;
    QGridLayout* m_pLayOut;
    Variant* m_pVariant[M_Max_Table_ColoumX*M_Max_Table_RowY];
    int32_t m_iRowCntY;
    int32_t m_iColoumCntX;
    int32_t m_iRowCurY;
    int32_t m_iColoumCurX;
    void MApplySelectItem(int32_t iColoumX, int32_t previousRow);
    void MFreshSelectItem(int32_t iColoumX,int32_t iRowY);

    void MParamInit_table(Variant **pParam , int32_t iColoumX, int32_t iRowY, const QStringList &nameList);

    virtual void MFresh();
    virtual void MApply();
    virtual void MTimeFresh();

    QDoubleValidator v_Double;
    QIntValidator v_Int;
signals:

public slots:
    void TableCellChanged(int currentRow, int currentColumn,
                            int previousRow, int previousColumn);
};

#endif // CCTRLPARAMTABLE_H
