00001 #ifndef SXUIVIEW_H_INCLUDED
00002 #define SXUIVIEW_H_INCLUDED
00003
00004 #include <QGraphicsView>
00005 #include "sxGlobal.h"
00006
00007 class sxUiPort;
00008 class QComboBox;
00009
00013 class SX_GUISDKEXPORT sxUiView : public QGraphicsView
00014 {
00015 Q_OBJECT
00016
00017 class PrivateData;
00018 PrivateData * d_p;
00019 public:
00020 sxUiView(QGraphicsScene * scn, QWidget * parent = 0);
00021 ~sxUiView();
00022
00023 void SetEditMode(int mode);
00024 int EditMode() const;
00025 void SetZoomComboBox(QComboBox * cb);
00026
00027
00028 enum {EditNone, EditSelect, EditSelecting, EditMove,
00029 EditMoving, EditConnect, EditConnecting,
00030 EditDelete, EditDeleteConnection};
00031
00032 protected:
00033 void mousePressEvent( QMouseEvent * event );
00034 void mouseMoveEvent( QMouseEvent * event );
00035 void mouseReleaseEvent( QMouseEvent * event );
00036 void mouseDoubleClickEvent( QMouseEvent * event );
00037 void drawForeground( QPainter * painter, const QRectF & rect );
00038 void drawBackground( QPainter * painter, const QRectF & rect );
00039
00040 private:
00041 void ConnectPort(sxUiPort * port);
00042 void SetMovable(int mode);
00043 void SetModified(bool flag = true);
00044 void zoomValueChanged(qreal val);
00045 public slots:
00046 void zoomValueChanged(const QString& txt);
00047 void captureToImage();
00048 void zoomFit();
00049 };
00050
00051 #endif // SXUIVIEW_H_INCLUDED