#ifndef FORMLISTWIDGET_H
#define FORMLISTWIDGET_H

#include <QWidget>
#include <QTableWidgetItem>

#include "common.h"
#include "slistwidget.h"

namespace Ui {
class FormListWidget;
}

class FormListWidget : public QWidget
{
    Q_OBJECT

public:
    explicit FormListWidget(QWidget *parent = nullptr);
    virtual ~FormListWidget();

    virtual void resizeEvent(QResizeEvent *event);

    virtual void keyPressEvent(QKeyEvent *event);
    virtual void keyReleaseEvent(QKeyEvent *event);

    virtual void wheelEvent(QWheelEvent *event);

    virtual void ExecuteMenu();

    virtual void ChangeHeader();

    int GetCurrentRowIndex();

    virtual void CellDoubleClicked(int nRow, int nColumn);

    virtual void Init();

    virtual int GetSelectIndexWorklist(int nRow);



protected:
    int m_nMaxItemShow;
    int m_nCurrentRowIndex;
    SListWidget* m_pListWidget;
    QFrame* m_pHorizontalScrollBarWidget;
    QFrame* m_pVerticalScrollBarWidget;
    SSlideBar* m_pVerticalScrollBar;
    SSlideBar* m_pHorizontalScrollBar;
    bool m_bDoubleClicked;

public slots:
    void actionTriggered(int action);

private slots:
    void on_tableWidget_itemDoubleClicked(QTableWidgetItem *item);

    void on_tableWidget_itemSelectionChanged();


    void on_tableWidget_cellDoubleClicked(int row, int column);

    void on_tableWidget_cellClicked(int row, int column);

    void on_tableWidget_itemClicked(QTableWidgetItem *item);

signals:
    void ChangeMenu(int nID);

private:
    Ui::FormListWidget *ui;

    int m_nCurrentPos;


};

#endif // FORMLISTWIDGET_H
