Salome HOME
Property "isOpen" property added.
[modules/gui.git] / src / SPlot2d / SPlot2d_SetupPlot2dDlg.h
1 //  Copyright (C) 2003  CEA/DEN, EDF R&D
2 //
3 //
4 //
5 //  File   : SPlot2d_SetupPlot2dDlg.h
6 //  Author : Vadim SANDLER
7 //  Module : SALOME
8 //  $Header$
9
10 #ifndef SPlot2d_SetupPlot2dDlg_H
11 #define SPlot2d_SetupPlot2dDlg_H
12
13 #include "Plot2d_Curve.h"
14
15 #include <SALOMEDSClient_SObject.hxx>
16
17 #include <qdialog.h>
18 #include <qptrlist.h>
19
20 //=================================================================================
21 // class    : SPlot2d_SetupPlot2dDlg
22 // purpose  : Dialog box for setup Plot2d view
23 //=================================================================================
24
25 class QScrollView;
26 class QPushButton;
27 class QLabel;
28 class QCheckBox;
29 class QComboBox;
30 class QSpinBox;
31 class QToolButton;
32 class SPlot2d_ItemContainer;
33
34 class SPlot2d_SetupPlot2dDlg : public QDialog
35
36   Q_OBJECT
37
38 public:
39   SPlot2d_SetupPlot2dDlg( _PTR(SObject) object, QWidget* parent = 0 );
40   ~SPlot2d_SetupPlot2dDlg();
41
42   void getCurves( QPtrList<Plot2d_Curve>& container );
43   void getCurvesSource( int& horIndex, QValueList<int>& verIndexes );
44   bool getCurveAttributes( const int vIndex, bool& isAuto, int& marker, int& line, int& lineWidth, QColor& color);
45
46 private slots:
47   void onHBtnToggled( bool );
48   void onVBtnToggled( bool );
49   void enableControls();
50
51 private:
52   QScrollView*                myView;
53   QPushButton*                myOkBtn;
54   QPushButton*                myCancelBtn;
55   QPtrList<SPlot2d_ItemContainer> myItems;
56
57   _PTR(SObject)               myObject;
58 };
59
60 class SPlot2d_ItemContainer : public QObject
61 {
62   Q_OBJECT
63
64 public:
65   SPlot2d_ItemContainer( QObject* parent = 0, const char* name = 0 );
66   
67   void   createWidgets( QWidget* parentWidget );
68   void   enableWidgets( bool enable );
69
70   void   setHorizontalOn( bool on );
71   bool   isHorizontalOn() const;
72   void   setVerticalOn( bool on );
73   bool   isVerticalOn() const;
74   bool   isAutoAssign() const;
75   void   setAutoAssign( bool on );
76   void   setLine( const int line, const int width );
77   int    getLine() const;
78   int    getLineWidth() const;
79   void   setMarker( const int marker );
80   int    getMarker() const;
81   void   setColor( const QColor& color );
82   QColor getColor() const;
83
84 protected:
85   void   updateState();
86
87 signals:
88   void   autoClicked();
89   void   horToggled( bool );
90   void   verToggled( bool );
91
92 public slots:
93   void   onAutoChanged();
94   void   onColorChanged();
95   void   onHVToggled( bool );
96
97 public:
98   bool                  myEnabled;
99   QToolButton*          myHBtn;
100   QToolButton*          myVBtn;
101   QLabel*               myTitleLab;
102   QLabel*               myUnitLab;
103   QCheckBox*            myAutoCheck;
104   QComboBox*            myLineCombo;
105   QSpinBox*             myLineSpin;
106   QComboBox*            myMarkerCombo;
107   QToolButton*          myColorBtn;
108 };
109
110 #endif // SPlot2d_SetupPlot2dDlg_H
111