Version: 9.12.0
QtxWorkstackAction.h
Go to the documentation of this file.
1 // Copyright (C) 2007-2023 CEA, EDF, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
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.
10 //
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.
15 //
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
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 
23 // File: QtxWorkstackAction.h
24 // Author: Sergey TELKOV
25 //
26 #ifndef QTXWORKSTACKACTION_H
27 #define QTXWORKSTACKACTION_H
28 
29 #include "QtxActionSet.h"
30 #include <QDialog>
31 
32 class QtxWorkstack;
33 class QRadioButton;
34 class QStackedLayout;
35 class QListWidget;
36 class QComboBox;
37 class QLabel;
38 class QToolButton;
39 
40 #ifdef WIN32
41 #pragma warning( disable:4251 )
42 #endif
43 
45 {
46  Q_OBJECT
47 
48 public:
50  enum { SplitVertical = 0x0001,
51  SplitHorizontal = 0x0002,
52  Windows = 0x0010,
53  Split = SplitVertical | SplitHorizontal,
54  Standard = Split | Windows };
55 
57  virtual ~QtxWorkstackAction();
58 
59  QtxWorkstack* workstack() const;
60  QAction* getArrangeViewsAction();
61 
62  int menuActions() const;
63  void setMenuActions( const int );
64 
65  QIcon icon( const int ) const;
66  QString text( const int ) const;
67  int accel( const int ) const;
68  QString statusTip( const int ) const;
69 
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& );
74 
75  void perform( const int );
76 
77 private slots:
78  void onAboutToShow();
79  void onTriggered( int );
80 
81 protected:
82  virtual void addedTo( QWidget* );
83  virtual void removedFrom( QWidget* );
84 
85 private:
86  void updateContent();
87  void updateWindows();
88  void splitVertical();
89  void splitHorizontal();
90  void activateItem( const int );
91 
92 private:
96 };
97 
99 
101 {
102  Q_OBJECT
103 
104  enum ViewMode{ XYZ, XY, XZ, YZ };
105 
106 public:
108  ~QtxSplitDlg();
109  int getSplitMode();
110  QList<int> getViewsMode();
111 
112 private :
113  QToolButton* createSplitButton( int, int );
114  void initialize();
115  void valid();
116 
117  QStackedLayout* myStackedSplitLayout;
118  QRadioButton* myButton2Views;
119  QRadioButton* myButton3Views;
120  QRadioButton* myButton4Views;
121  QPushButton* myButtonApply;
122  QPushButton* myButtonPrevious;
123  QPushButton* myButtonNext;
127 
130 
135  QMap<QComboBox*, ViewMode> myMapComboBoxMode;
136  QMap<ViewMode, bool> myMapModeIsBusy;
137 
138 private slots:
139 
140  void onChangeIcons();
141  void onSplitChanged(int);
142  void onComboBoxChanged(int);
143  void onPreviousViews();
144  void onNextViews();
145  void onSynchronize();
146  void onCloseViews();
147  void onStackViews();
148  void onApply();
149 };
150 
151 #ifdef WIN32
152 #pragma warning( default:4251 )
153 #endif
154 
155 #endif
QtxSplitDlgMode
Definition: QtxWorkstackAction.h:98
@ CreateSubViews
Definition: QtxWorkstackAction.h:98
@ ArrangeViews
Definition: QtxWorkstackAction.h:98
#define QTX_EXPORT
Definition: Qtx.h:36
For more information see QT documentation.
Definition: SUIT_Application.h:42
An action class which is represented in the menu bar (or toolbar) as a group of items (which can be c...
Definition: QtxActionSet.h:35
virtual void addedTo(QWidget *)
Called when this action set is added to the menu bar (or toolbar).
Definition: QtxActionSet.cxx:254
virtual void removedFrom(QWidget *)
Called when this action set is removed from the menu bar (or toolbar).
Definition: QtxActionSet.cxx:265
Used for arranging views(menu item "Window->Arrange Views") and for creating sub-views of current vie...
Definition: QtxWorkstackAction.h:101
QPushButton * myButtonNext
Definition: QtxWorkstackAction.h:123
QRadioButton * myButton4Views
Definition: QtxWorkstackAction.h:120
QStackedLayout * myStackedSplitLayout
Definition: QtxWorkstackAction.h:117
QRadioButton * myButton3Views
Definition: QtxWorkstackAction.h:119
QtxWorkstack * myWorkstack
Definition: QtxWorkstackAction.h:128
bool myIsCloseViews
Definition: QtxWorkstackAction.h:134
int mySplitMode
Definition: QtxWorkstackAction.h:132
QMap< ViewMode, bool > myMapModeIsBusy
Definition: QtxWorkstackAction.h:136
QRadioButton * myButton2Views
Definition: QtxWorkstackAction.h:118
QPushButton * myButtonPrevious
Definition: QtxWorkstackAction.h:122
QList< QLabel * > myLabels
Definition: QtxWorkstackAction.h:124
QListWidget * myViewsList
Definition: QtxWorkstackAction.h:126
QMap< QComboBox *, ViewMode > myMapComboBoxMode
Definition: QtxWorkstackAction.h:135
QtxSplitDlgMode myDlgMode
Definition: QtxWorkstackAction.h:129
QList< QComboBox * > myComboBox
Definition: QtxWorkstackAction.h:125
ViewMode
Definition: QtxWorkstackAction.h:104
QPushButton * myButtonApply
Definition: QtxWorkstackAction.h:121
int myNBSelectedViews
Definition: QtxWorkstackAction.h:133
int myViewsNB
Definition: QtxWorkstackAction.h:131
Implements actions group for menu Windows with standard operations, like "Split vertical",...
Definition: QtxWorkstackAction.h:45
bool myWindowsFlag
"show child windows items" flag
Definition: QtxWorkstackAction.h:94
QtxWorkstack * myWorkstack
parent workstack
Definition: QtxWorkstackAction.h:93
QAction * myArrangeViewsAction
Definition: QtxWorkstackAction.h:95
Workstack widget.
Definition: QtxWorkstack.h:57
Definition: VTKViewer_ArcBuilder.h:60