1 // Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 // File: QtxWorkstackAction.h
24 // Author: Sergey TELKOV
26 #ifndef QTXWORKSTACKACTION_H
27 #define QTXWORKSTACKACTION_H
29 #include "QtxActionSet.h"
41 #pragma warning( disable:4251 )
44 class QTX_EXPORT QtxWorkstackAction : public QtxActionSet
49 //! Actions (menu items) ID
50 enum { SplitVertical = 0x0001, //!< "Split window vertically" operation
51 SplitHorizontal = 0x0002, //!< "Split window horizontally" operation
52 Windows = 0x0010, //!< A list of child windows menu items
53 Split = SplitVertical | SplitHorizontal,
54 Standard = Split | Windows };
56 QtxWorkstackAction( QtxWorkstack*, QObject* = 0 );
57 virtual ~QtxWorkstackAction();
59 QtxWorkstack* workstack() const;
60 QAction* getArrangeViewsAction();
62 int menuActions() const;
63 void setMenuActions( const int );
65 QIcon icon( const int ) const;
66 QString text( const int ) const;
67 int accel( const int ) const;
68 QString statusTip( const int ) const;
70 void setAccel( const int, const int );
71 void setIcon( const int, const QIcon& );
72 void setText( const int, const QString& );
73 void setStatusTip( const int, const QString& );
75 void perform( const int );
79 void onTriggered( int );
82 virtual void addedTo( QWidget* );
83 virtual void removedFrom( QWidget* );
89 void splitHorizontal();
90 void activateItem( const int );
93 QtxWorkstack* myWorkstack; //!< parent workstack
94 bool myWindowsFlag; //!< "show child windows items" flag
95 QAction* myArrangeViewsAction;
98 enum QtxSplitDlgMode{ ArrangeViews, CreateSubViews };
100 class QTX_EXPORT QtxSplitDlg : public QDialog
104 enum ViewMode{ XYZ, XY, XZ, YZ };
107 QtxSplitDlg( QWidget* = 0, QtxWorkstack* = NULL, QtxSplitDlgMode = ArrangeViews );
110 QList<int> getViewsMode();
113 QToolButton* createSplitButton( int, int );
117 QStackedLayout* myStackedSplitLayout;
118 QRadioButton* myButton2Views;
119 QRadioButton* myButton3Views;
120 QRadioButton* myButton4Views;
121 QPushButton* myButtonApply;
122 QPushButton* myButtonPrevious;
123 QPushButton* myButtonNext;
124 QList<QLabel*> myLabels;
125 QList<QComboBox*> myComboBox;
126 QListWidget* myViewsList;
128 QtxWorkstack* myWorkstack;
129 QtxSplitDlgMode myDlgMode;
133 int myNBSelectedViews;
135 QMap<QComboBox*, ViewMode> myMapComboBoxMode;
136 QMap<ViewMode, bool> myMapModeIsBusy;
140 void onChangeIcons();
141 void onSplitChanged(int);
142 void onComboBoxChanged(int);
143 void onPreviousViews();
145 void onSynchronize();
152 #pragma warning( default:4251 )