#ifndef LIGHTSHOWWIDGET_H
#define LIGHTSHOWWIDGET_H
#include <QGraphicsView>
#include <QWheelEvent>
#include "LedStringWidget.h"

#include <QObject>


#define PAN_SPEED 1

class CLightShowWidget : public QGraphicsView
{
    Q_OBJECT

public:
    CLightShowWidget(QWidget *parent = 0);
    void ScaleView(qreal scaleFactor);
    void Pan(QPointF delta);

    void showEvent(QShowEvent *event);
    void mousePressEvent(QMouseEvent *event);
    void mouseReleaseEvent(QMouseEvent *event);
    void mouseMoveEvent(QMouseEvent *event);

    bool mDoMousePan;

    qreal mScale;
    QPoint mLasMousePos;
    QGraphicsRectItem *mViewportRect, *mSceneRect, *mLedStringRect;
    QGraphicsScene *mScene;
    QTransform mCurTransform, mNominalTransform;

    CLedStringWidget *mLedStringWidget;


public slots:
    void ZoomIn();
    void ZoomOut();

protected:
    void wheelEvent(QWheelEvent *event);


};

#endif // LIGHTSHOWWIDGET_H
