\image html occ_view_minimized.png
\image html occ_view_maximized.png
-<b>Minimize/Maximize</b> - these buttons allow switching the current
+<b>Create sub-views/Maximize</b> - these buttons allow switching the current
view area to the minimized / maximized state.
+
+<b>Create sub-views</b> - user can select the layout and types of child sub-views:
+
+\image html create_sub-views_dlg.png
+
+- <b>Sub-views Layout</b>
+
+ - Three radio-buttons to specify numbers of the views to arrange (2, 3 or 4).
+
+ - Buttons (depending on the chosen number of views) with images to specify
+ view layout.
+
+ - Buttons "Previous" and "Next" for possibility to change split schemas.
+
+- <b>Sub-views Properties</b>
+
+ - Type of each sub-view: XZ, YZ, XY or XYZ.
+
+<b>Maximize</b> - the current view area will be converted to maximized state.
+
<hr>
\image html occ_view_sync.png
<li><b>Close</b> - closes the currently active viewer window.</li>
<li><b>Close all</b> - closes all viewer windows.</li>
<li><b>Group all</b> - arranges all created viewer windows on the same desktop</li>
+<li><b>Arrange Views</b> - choice of split scheme and list of used views.
+\image html arrange_views_dlg.png
+
+- <b>Views Layout</b>
+
+ - Three radio-buttons to specify numbers of the views to arrange (2, 3 or 4).
+
+ - Buttons (depending on the chosen number of views) with images to specify
+ view layout.
+
+ - Buttons "Previous" and "Next" for possibility to change split schemas.
+
+- <b>Views List</b>
+
+ - The list of opened view windows - the user have to select corresponding
+ views to be arranged.
+
+ - Two radio-buttons that specify an action to be applied to the remaining views.
+
+ - "Close the remaining views" - all remaining views will be closed.
+
+ - "Stack the remaining views" - all remaining views will be stacker to the
+ last tab area.
+
<li><b>Split Vertically</b> and <b>Split Horizontally</b> allows to split
the representation area into two parts, in horizontal or vertical
direction.</li>
#include "OCCViewer_ViewModel.h"
#include <SUIT_ViewManager.h>
+#include <SUIT_Session.h>
+#include <SUIT_ResourceMgr.h>
+
+#include <QtxResourceMgr.h>
+#include <QtxWorkstackAction.h>
#include <QFrame>
#include <QLayout>
#include <QApplication>
OCCViewer_ViewFrame::OCCViewer_ViewFrame(SUIT_Desktop* theDesktop, OCCViewer_Viewer* theModel)
- : OCCViewer_ViewWindow( theDesktop, theModel ), myPopupRequestedView(0)
+ : OCCViewer_ViewWindow( theDesktop, theModel ), myPopupRequestedView(0), mySplitMode(-1)
{
QFrame* centralFrame = new QFrame( this );
setCentralWidget( centralFrame );
myLayout->setMargin( 0 );
myLayout->setSpacing( 1 );
- myLayout->addWidget( view0, 1, 1 );
+ myLayout->addWidget( view0, 0, 0 );
+ myMaximizedView = view0;
connectViewSignals(view0);
}
}
}
-
//**************************************************************************************
void OCCViewer_ViewFrame::onMaximizedView( OCCViewer_ViewWindow* theView, bool isMaximized)
{
+ myMaximizedView = theView;
if (isMaximized) {
if (myViews.count() <= 1)
return;
-
myLayout->setColumnStretch(0, 0);
myLayout->setColumnStretch(1, 0);
+ myLayout->addWidget( theView, 0, 0 );
int i = 0;
OCCViewer_ViewWindow* view = 0;
- for ( i = BOTTOM_RIGHT; i <= TOP_RIGHT; i++) {
+ for ( i = BOTTOM_RIGHT; i <= TOP_RIGHT; i++ ) {
view = myViews.at(i);
view->setVisible( view == theView );
view->setMaximized( view == theView, false );
}
+ mySplitMode = -1;
+ myViewsMode.clear();
}
else {
- OCCViewer_Viewer* aModel = dynamic_cast<OCCViewer_Viewer*>(myManager->getViewModel());
- if (!aModel) return;
+ createSubViews();
- myLayout->setColumnStretch(0, 10);
- myLayout->setColumnStretch(1, 10);
-
- int i = 0;
- if (myViews.count() == 1) {
- //QColor aColor = myViews.at( MAIN_VIEW )->backgroundColor();
- OCCViewer_ViewWindow* view = 0;
- for ( i = BOTTOM_LEFT; i <= TOP_RIGHT; i++) {
- view = aModel->createSubWindow();
- view->set2dMode( (Mode2dType) i );
- view->setParent( centralWidget() );
- view->setViewManager(myManager);
- updateWindowTitle( view );
- myViews.append( view );
- aModel->initView(view);
- view->setMaximized(false, false);
- view->setDropDownButtons( dropDownButtons() );
- connectViewSignals(view);
- view->setBackground(aModel->background(i));
- }
- myLayout->addWidget( myViews.at(BOTTOM_LEFT), 1, 0 );
- myLayout->addWidget( myViews.at(TOP_LEFT), 0, 0 );
- myLayout->addWidget( myViews.at(TOP_RIGHT), 0, 1 );
+ QtxSplitDlg CreateSubViewsDlg( this, NULL, CreateSubViews );
+ if ( CreateSubViewsDlg.exec() ) {
+ mySplitMode = CreateSubViewsDlg.getSplitMode();
+ myViewsMode = CreateSubViewsDlg.getViewsMode();
+ splitSubViews();
}
+ else {
+ myMaximizedView->setMaximized(true);
+ }
+ }
+ myLayout->invalidate();
+}
+
+//**************************************************************************************
+void OCCViewer_ViewFrame::createSubViews()
+{
+ OCCViewer_Viewer* aModel = dynamic_cast<OCCViewer_Viewer*>(myManager->getViewModel());
+ if (!aModel) return;
+ int i = 0;
+ if (myViews.count() == 1) {
+ //QColor aColor = myViews.at( MAIN_VIEW )->backgroundColor();
OCCViewer_ViewWindow* view = 0;
- for ( i = BOTTOM_RIGHT; i <= TOP_RIGHT; i++) {
- view = myViews.at(i);
+ for ( i = BOTTOM_LEFT; i <= TOP_RIGHT; i++) {
+ view = aModel->createSubWindow();
+ view->set2dMode( (Mode2dType) i );
+ view->setParent( centralWidget() );
+ view->setViewManager(myManager);
+ updateWindowTitle( view );
+ myViews.append( view );
+ aModel->initView(view);
+ view->setMaximized(false, false);
+ view->setDropDownButtons( dropDownButtons() );
+ connectViewSignals(view);
+ view->setBackground(aModel->background(i));
+ }
+ }
+}
+
+void OCCViewer_ViewFrame::splitSubViews()
+{
+ if( mySplitMode == -1 )
+ return;
+
+ int aNbViews;
+ if ( mySplitMode >= 0 && mySplitMode < 2)
+ aNbViews = 2;
+ else if( mySplitMode >= 2 && mySplitMode < 8 )
+ aNbViews = 3;
+ else if( mySplitMode >=8 && mySplitMode < 29 )
+ aNbViews = 4;
+
+ if( aNbViews != myViewsMode.count() )
+ return;
+
+ int SubViews3Map[6][3][4] = {
+ { {0,0,1,1}, {0,1,1,1}, {0,2,1,1} },
+ { {0,0,1,1}, {1,0,1,1}, {2,0,1,1} },
+ { {0,0,1,1}, {1,0,1,1}, {0,1,2,1} },
+ { {0,0,2,1}, {0,1,1,1}, {1,1,1,1} },
+ { {0,0,1,2}, {1,0,1,1}, {1,1,1,1} },
+ { {0,0,1,1}, {0,1,1,1}, {1,0,1,2} }
+ };
+
+ int SubViews4Map[21][4][4] = {
+ { {0,0,1,1}, {0,1,1,1}, {0,2,1,1}, {0,3,1,1} },
+ { {0,0,1,1}, {1,0,1,1}, {2,0,1,1}, {3,0,1,1} },
+ { {0,0,1,1}, {0,1,1,1}, {1,0,1,1}, {1,1,1,1} },
+ { {0,0,1,1}, {1,0,1,1}, {0,1,2,1}, {0,2,2,1} },
+ { {0,0,2,1}, {0,1,1,1}, {1,1,1,1}, {0,2,2,1} },
+ { {0,0,2,1}, {0,1,2,1}, {0,2,1,1}, {1,2,1,1} },
+ { {0,0,1,1}, {0,1,1,1}, {1,0,1,2}, {2,0,1,2} },
+ { {0,0,1,2}, {1,0,1,1}, {1,1,1,1}, {2,0,1,2} },
+ { {0,0,1,2}, {1,0,1,2}, {2,0,1,1}, {2,1,1,1} },
+ { {0,0,1,1}, {1,0,1,1}, {0,1,2,1}, {2,0,1,2} },
+ { {0,0,2,1}, {0,1,1,1}, {1,1,1,1}, {2,0,1,2} },
+ { {0,0,1,2}, {1,0,1,1}, {2,0,1,1}, {1,1,2,1} },
+ { {0,0,1,2}, {1,0,2,1}, {1,1,1,1}, {2,1,1,1} },
+ { {0,0,2,1}, {0,1,1,1}, {0,2,1,1}, {1,1,1,2} },
+ { {0,0,2,1}, {0,1,1,2}, {1,1,1,1}, {1,2,1,1} },
+ { {0,0,1,1}, {0,1,1,1}, {1,0,1,2}, {0,2,2,1} },
+ { {0,0,1,2}, {1,0,1,1}, {1,1,1,1}, {0,2,2,1} },
+ { {0,0,1,3}, {1,0,1,1}, {1,1,1,1}, {1,2,1,1} },
+ { {0,0,1,1}, {0,1,1,1}, {0,2,1,1}, {1,0,1,3} },
+ { {0,0,1,1}, {1,0,1,1}, {2,0,1,1}, {0,1,3,1} },
+ { {0,0,3,1}, {0,1,1,1}, {1,1,1,1}, {2,1,1,1} },
+ };
+
+ if( aNbViews == 2 ) {
+ if( mySplitMode == 0 ) {
+ myLayout->addWidget( myViews.at(myViewsMode[0]), 0,0,2,1 );
+ myLayout->addWidget( myViews.at(myViewsMode[1]), 0,1,2,1 );
+ }
+ else if( mySplitMode == 1 ) {
+ myLayout->addWidget( myViews.at(myViewsMode[0]), 0,0,1,2 );
+ myLayout->addWidget( myViews.at(myViewsMode[1]), 1,0,1,2 );
+ }
+ }
+ else if( aNbViews == 3 ) {
+ int aSplitMode = mySplitMode - 2;
+ for( int i = 0; i < 3; i++ ) {
+ myLayout->addWidget( myViews.at(myViewsMode[i]),
+ SubViews3Map[aSplitMode][i][0],
+ SubViews3Map[aSplitMode][i][1],
+ SubViews3Map[aSplitMode][i][2],
+ SubViews3Map[aSplitMode][i][3]);
+ }
+ }
+ else if( aNbViews == 4 ) {
+ int aSplitMode = mySplitMode - 8;
+ for( int i = 0; i < 4; i++ ) {
+ myLayout->addWidget( myViews.at(myViewsMode[i]),
+ SubViews4Map[aSplitMode][i][0],
+ SubViews4Map[aSplitMode][i][1],
+ SubViews4Map[aSplitMode][i][2],
+ SubViews4Map[aSplitMode][i][3]);
+ }
+ }
+
+ OCCViewer_ViewWindow* view = 0;
+ for ( int i = 0; i< myViews.count(); i++ ) {
+ view = myViews.at(i);
+ bool isShowed = false;
+ for( int j = 0; j < myViewsMode.count(); j++ ) {
+ OCCViewer_ViewWindow* view2 = 0;
+ view2 = myViews.at( myViewsMode[j] );
+ if( view == view2 )
+ isShowed = true;
+ }
+ if( isShowed ) {
view->show();
view->setMaximized( false, false );
///////////////QApplication::processEvents(); // VSR: hangs up ?
- if (view != theView)
+ if ( view != myMaximizedView )
view->onViewFitAll();
}
+ else
+ view->setVisible( false );
}
- myLayout->invalidate();
}
+//**************************************************************************************
OCCViewer_ViewPort3d* OCCViewer_ViewFrame::getViewPort(int theView)
{
return getView(theView)? getView(theView)->getViewPort() : 0;
}
+//**************************************************************************************
void OCCViewer_ViewFrame::updateEnabledDrawMode()
{
foreach (OCCViewer_ViewWindow* aView, myViews) {
}
}
+//**************************************************************************************
void OCCViewer_ViewFrame::setCuttingPlane( bool on, const double x , const double y , const double z,
const double dx, const double dy, const double dz)
{
QString OCCViewer_ViewFrame::getVisualParameters()
{
QStringList params;
+ QStringList splitParams;
+ if( mySplitMode != -1 && myViewsMode.count() != 0 ) {
+ splitParams << QString::number( mySplitMode );
+ foreach ( int aViewMode, myViewsMode )
+ splitParams << QString::number( aViewMode );
+ params.append( splitParams.join("*") );
+ }
+ else
+ params.append( QString::number( mySplitMode ) );
int maximizedView = 999;
for ( int i = BOTTOM_RIGHT; i <= TOP_RIGHT && i < myViews.count(); i++) {
if ( getView(i)->isVisible() )
QStringList params = parameters.split( "|" );
if ( params.count() > 1 ) {
int maximizedView = params[0].toInt();
- if ( myViews.count() < params.count()-1 )
- onMaximizedView( getView(MAIN_VIEW), false ); // secondary views are not created yet, but should be
- for ( int i = 1; i < params.count(); i++ ) {
- int idx = i-1;
+ if ( myViews.count() < params.count()-2 )
+ createSubViews(); // secondary views are not created yet, but should be
+
+ for ( int i = 2; i < params.count(); i++ ) {
+ int idx = i-2;
getView( idx )->setVisualParameters( params[i] );
}
- onMaximizedView( getView( maximizedView ), maximizedView != -1 ); // set proper sib-window maximized
+
+ QStringList aSplitParams = params[1].split("*");
+ if( aSplitParams.count() > 1 ) {
+ mySplitMode = aSplitParams[0].toInt();
+ for( int i = 1; i < aSplitParams.count(); i++ )
+ myViewsMode << aSplitParams[i].toInt();
+ }
+ if( mySplitMode != -1 )
+ splitSubViews();
+ else
+ onMaximizedView( getView( maximizedView ), true ); // set proper sub-window maximized
}
else {
// handle obsolete versions - no parameters for xy, yz, xz views
private:
void connectViewSignals( OCCViewer_ViewWindow* theView );
void updateWindowTitle( OCCViewer_ViewWindow* theView );
+ void createSubViews();
+ void splitSubViews();
QList<OCCViewer_ViewWindow*> myViews;
QGridLayout* myLayout;
+ OCCViewer_ViewWindow* myMaximizedView;
+ int mySplitMode;
+ QList<int> myViewsMode;
OCCViewer_ViewWindow* myPopupRequestedView;
};
</message>
<message>
<source>MNU_MINIMIZE_VIEW</source>
- <translation>Minimize</translation>
+ <translation>Create sub-views</translation>
</message>
</context>
<context>
</message>
<message>
<source>MNU_MINIMIZE_VIEW</source>
- <translation>Minimiser</translation>
+ <translation>Créer les sous-vues</translation>
</message>
</context>
<context>
)
QT4_WRAP_CPP(GUI_HEADERS_MOC ${GUI_HEADERS})
+SET(RCCS Qtx.qrc)
+QT4_ADD_RESOURCES(RCC_SRCS ${RCCS})
+
SET(qtx_SOURCES
Qtx.cxx
QtxAction.cxx
)
ADD_DEFINITIONS(${QT_DEFINITIONS})
-ADD_LIBRARY(qtx ${qtx_SOURCES} ${GUI_HEADERS_MOC})
+ADD_LIBRARY(qtx ${qtx_SOURCES} ${GUI_HEADERS_MOC} ${RCC_SRCS})
TARGET_LINK_LIBRARIES(qtx ${QT_LIBRARIES} ${OPENGL_LIBRARIES})
INSTALL(TARGETS qtx EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
QtxWebBrowser.h
)
INSTALL(FILES ${COMMON_HEADERS_H} DESTINATION ${SALOME_INSTALL_HEADERS})
-QT4_INSTALL_TS_RESOURCES("${GUITS_SOURCES}" "${SALOME_GUI_INSTALL_RES_DATA}")
+QT4_INSTALL_TS_RESOURCES("${GUITS_SOURCES}" "${SALOME_GUI_INSTALL_RES_DATA}")
\ No newline at end of file
--- /dev/null
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>images/qtx_split2_1.png</file>
+ <file>images/qtx_split2_2.png</file>
+ <file>images/qtx_split3_1.png</file>
+ <file>images/qtx_split3_2.png</file>
+ <file>images/qtx_split3_3.png</file>
+ <file>images/qtx_split3_4.png</file>
+ <file>images/qtx_split3_5.png</file>
+ <file>images/qtx_split3_6.png</file>
+ <file>images/qtx_split4_1.png</file>
+ <file>images/qtx_split4_2.png</file>
+ <file>images/qtx_split4_3.png</file>
+ <file>images/qtx_split4_4.png</file>
+ <file>images/qtx_split4_5.png</file>
+ <file>images/qtx_split4_6.png</file>
+ <file>images/qtx_split4_7.png</file>
+ <file>images/qtx_split4_8.png</file>
+ <file>images/qtx_split4_9.png</file>
+ <file>images/qtx_split4_10.png</file>
+ <file>images/qtx_split4_11.png</file>
+ <file>images/qtx_split4_12.png</file>
+ <file>images/qtx_split4_13.png</file>
+ <file>images/qtx_split4_14.png</file>
+ <file>images/qtx_split4_15.png</file>
+ <file>images/qtx_split4_16.png</file>
+ <file>images/qtx_split4_17.png</file>
+ <file>images/qtx_split4_18.png</file>
+ <file>images/qtx_split4_19.png</file>
+ <file>images/qtx_split4_20.png</file>
+ <file>images/qtx_split4_21.png</file>
+</qresource>
+</RCC>
+
if ( lst.count() > 1 )
{
- if ( myActionsMap[SplitVertical]->isEnabled() )
- pm->addAction( myActionsMap[SplitVertical] );
- if ( myActionsMap[SplitHorizontal]->isEnabled() )
- pm->addAction( myActionsMap[SplitHorizontal] );
+ if ( !myActionsMap[SplitVertical]->isEnabled() )
+ myActionsMap[SplitVertical]->setEnabled(true);
+ pm->addAction( myActionsMap[SplitVertical] );
+ if ( !myActionsMap[SplitHorizontal]->isEnabled() )
+ myActionsMap[SplitHorizontal]->setEnabled(true);
+ pm->addAction( myActionsMap[SplitHorizontal] );
pm->addSeparator();
}
idx++;
area_src->removeWidget( wid, true );
area_to->insertWidget( wid, idx );
+ wid->showMaximized();
return true;
}
}
#include <QMenu>
#include <QWidgetList>
+#include <QGroupBox>
+#include <QVBoxLayout>
+#include <QHBoxLayout>
+#include <QRadioButton>
+#include <QPushButton>
+#include <QListWidget>
+#include <QStackedLayout>
+#include <QToolButton>
+#include <QIcon>
+#include <QPixmap>
+#include <QButtonGroup>
+#include <QCheckBox>
+#include <QLabel>
+#include <QComboBox>
+
+const char* const prev_xpm[] = {
+"16 16 12 1",
+" c None",
+". c #111111",
+"+ c #ACACAC",
+"@ c #FC6D6E",
+"# c #FB6364",
+"$ c #F25B5C",
+"% c #EA5859",
+"& c #C1494A",
+"* c #B64545",
+"= c #AB4040",
+"- c #A03C3C",
+"; c #99393A",
+" . ",
+" ..+ ",
+" .@...... ",
+" .@@@@@@@.+ ",
+" .########.+ ",
+" .$$$$$$$$$.+ ",
+" .%%%%%%%%%%.+ ",
+" .&&&&&&&&&&&.+ ",
+" .**********.+ ",
+" +.=========.+ ",
+" +.--------.+ ",
+" +.;;;;;;;.+ ",
+" +.;......+ ",
+" +..++++++ ",
+" +.+ ",
+" ++ "};
+
+const char* const next_xpm[] = {
+"16 16 12 1",
+" c None",
+". c #111111",
+"+ c #FC6D6E",
+"@ c #FB6364",
+"# c #F25B5C",
+"$ c #EA5859",
+"% c #C1494A",
+"& c #B64545",
+"* c #ACACAC",
+"= c #AB4040",
+"- c #A03C3C",
+"; c #99393A",
+" . ",
+" .. ",
+" ......+. ",
+" .+++++++. ",
+" .@@@@@@@@. ",
+" .#########. ",
+" .$$$$$$$$$$. ",
+" .%%%%%%%%%%%. ",
+" .&&&&&&&&&&.**",
+" .=========.** ",
+" .--------.** ",
+" .;;;;;;;.** ",
+" ......;.** ",
+" ****..** ",
+" .** ",
+" ** "};
/*!
\class QtxWorkstackAction
connect( this, SIGNAL( triggered( int ) ), this, SLOT( onTriggered( int ) ) );
setMenuActions( Standard );
+
+ myArrangeViewsAction = new QAction( tr( "Arrange Views" ), this );
}
/*!
return myWorkstack;
}
+/*!
+ \brief Get arrange views action.
+*/
+QAction* QtxWorkstackAction::getArrangeViewsAction()
+{
+ return myArrangeViewsAction;
+}
+
/*!
\brief Set actions to be visible in the menu.
bool count = workstack() ? workstack()->splitWindowList().count() > 1 : 0;
action( SplitVertical )->setEnabled( count );
action( SplitHorizontal )->setEnabled( count );
+ count = workstack() ? workstack()->windowList().count() > 1 : 0;
+ myArrangeViewsAction->setEnabled( count );
updateWindows();
}
else
activateItem( id - Windows - 1 );
}
+
+/*!
+ \class QtxSplitDlg
+ \brief Used for arranging views(menu item "Window->Arrange Views")
+ and for creating sub-views of current view(button "Create sub-views")
+*/
+
+/*!
+ \brief Constructor.
+ \param parent - parent object
+ \param workstack - Work Stack widget
+ \param mode - mode of current dialog
+*/
+QtxSplitDlg::QtxSplitDlg( QWidget* parent, QtxWorkstack* workstack, QtxSplitDlgMode mode )
+: QDialog( parent ),
+ myWorkstack( workstack ),
+ myDlgMode( mode ),
+ myViewsNB(2),
+ mySplitMode(0),
+ myNBSelectedViews(0),
+ myIsCloseViews( false )
+{
+ Q_INIT_RESOURCE(Qtx);
+
+ setModal( true );
+ setObjectName( "Qtx_Split" );
+
+ if( mode == ArrangeViews )
+ setWindowTitle( tr( "Arrange views" ) );
+ else if( mode == CreateSubViews )
+ setWindowTitle( tr( "Create sub-views") );
+
+ QVBoxLayout* topLayout = new QVBoxLayout( this );
+ topLayout->setMargin( 11 ); topLayout->setSpacing( 6 );
+
+ /////////////////////////////////////////////////////////////////////
+ QGroupBox* aGroupViewsLayout = new QGroupBox();
+ if( mode == ArrangeViews )
+ aGroupViewsLayout->setTitle( tr("Views Layout") );
+ else if( mode == CreateSubViews )
+ aGroupViewsLayout->setTitle( tr("Sub-views Layout") );
+
+ QGridLayout* OptionsViewsLayout = new QGridLayout( aGroupViewsLayout );
+
+ // Radio Buttons for selecting the number of views
+ QVBoxLayout* RadioButtonsLayout = new QVBoxLayout();
+ myButton2Views = new QRadioButton( "2", this );
+ myButton3Views = new QRadioButton( "3", this );
+ myButton4Views = new QRadioButton( "4", this );
+
+ myButton2Views->setChecked( true );
+
+ RadioButtonsLayout->addWidget( myButton2Views );
+ RadioButtonsLayout->addWidget( myButton3Views );
+ RadioButtonsLayout->addWidget( myButton4Views );
+
+ // Buttons for possibility of switching the variants of split
+ myButtonPrevious = new QPushButton( this );
+ myButtonPrevious->setIcon( QIcon( prev_xpm ) );
+ myButtonPrevious->setAutoDefault(true);
+ myButtonPrevious->setEnabled( false );
+
+ myButtonNext = new QPushButton( this );
+ myButtonNext->setIcon( QIcon( next_xpm ) );
+ myButtonNext->setAutoDefault(true);
+ myButtonNext->setEnabled( false );
+
+ // Split options
+ myStackedSplitLayout = new QStackedLayout();
+
+ QButtonGroup* SplitOptions = new QButtonGroup( this );
+ SplitOptions->setExclusive( true );
+
+ // Arrange icons for 2 views according to next scheme
+ // x
+ // x
+ QGridLayout* aSplit2Layout = new QGridLayout();
+ for( int i=1; i<=2; i++ ) {
+ QToolButton* aSplitBtn = createSplitButton( 2, i );
+ aSplit2Layout->addWidget( aSplitBtn, i-1, 0 );
+ SplitOptions->addButton( aSplitBtn, i-1 );
+ }
+ QWidget* aSplit2Widget = new QWidget( this );
+ aSplit2Widget->setLayout( aSplit2Layout );
+ myStackedSplitLayout->addWidget( aSplit2Widget );
+
+ // Arrange icons for 3 views according to next scheme
+ // x x x
+ // x x x
+ QGridLayout* aSplit3Layout = new QGridLayout();
+ bool anIconPosition = 0;
+ for( int i=1; i<=6; i++ ) {
+ QToolButton* aSplitBtn = createSplitButton( 3, i );
+ aSplit3Layout->addWidget( aSplitBtn, anIconPosition, int((i-1)/2) );
+ SplitOptions->addButton( aSplitBtn, i+1 );
+ anIconPosition = !anIconPosition;
+ }
+ QWidget* aSplit3Widget = new QWidget( this );
+ aSplit3Widget->setLayout( aSplit3Layout );
+ myStackedSplitLayout->addWidget( aSplit3Widget );
+
+ // Arrange icons for 4 views according to next scheme
+ // x x x x x x x x x
+ // x x x x x x x x x
+ // x x x
+ QGridLayout* aSplit4Layout = new QGridLayout();
+ int aPosition = 0;
+ for( int i=1; i<=21; i++ ) {
+ QToolButton* aSplitBtn = createSplitButton( 4, i );
+ SplitOptions->addButton( aSplitBtn, i+7 );
+ if( i <= 9 ) {
+ aSplit4Layout->addWidget( aSplitBtn, int((i-1)/3), aPosition );
+ aPosition = ( aPosition == 2 ) ? 0: aPosition + 1;
+ }
+ else if( i > 9 && i <= 17 ) {
+ aSplit4Layout->addWidget( aSplitBtn, int( (i-10)/4), aPosition );
+ aPosition = ( aPosition == 3 ) ? 0: aPosition + 1;
+ }
+ else if( i>17 ) {
+ aSplit4Layout->addWidget( aSplitBtn, int( (i-18)/2 ), aPosition );
+ aPosition = ( aPosition == 1 ) ? 0: aPosition + 1;
+ }
+ if( i == 9 || i == 17 || i == 21 ) { //finish set icon in current stack widget
+ QWidget* aSplit4Widget = new QWidget( this );
+ aSplit4Widget->setLayout( aSplit4Layout );
+ myStackedSplitLayout->addWidget( aSplit4Widget );
+ aSplit4Layout = new QGridLayout();
+ }
+ }
+
+ QHBoxLayout* ArrowLayout = new QHBoxLayout();
+ ArrowLayout->addSpacing(130);
+ ArrowLayout->addWidget( myButtonPrevious );
+ ArrowLayout->addWidget( myButtonNext );
+ ArrowLayout->addSpacing(130);
+
+ OptionsViewsLayout->addLayout( ArrowLayout, 0, 1, 1, 2);
+ OptionsViewsLayout->addLayout( RadioButtonsLayout, 1, 0 );
+ OptionsViewsLayout->addLayout( myStackedSplitLayout, 1, 1, 1, 2 );
+
+ /////////////////////////////////////////////////////////////////////
+
+ QGroupBox* GroupProperties = new QGroupBox();
+
+ if( mode == ArrangeViews ) {
+ GroupProperties->setTitle( tr("Views List") );
+
+ QVBoxLayout* ViewsListLayout = new QVBoxLayout( GroupProperties );
+
+ QWidgetList aWidgetList = myWorkstack->windowList();
+ myViewsList = new QListWidget( GroupProperties );
+ myViewsList->setSelectionMode(QAbstractItemView::SingleSelection);
+ connect( myViewsList, SIGNAL( itemClicked(QListWidgetItem*) ), this, SLOT( onSynchronize() ) );
+
+ for( int i=0; i< aWidgetList.count(); i++ ) {
+ QWidget* aWidget = aWidgetList.at(i);
+ QListWidgetItem* anItem = new QListWidgetItem( aWidget->windowTitle(), myViewsList );
+ anItem->setCheckState( Qt::Unchecked );
+ anItem->setFlags( anItem->flags() & ~Qt::ItemIsSelectable );
+ }
+
+ QRadioButton* CloseViews = new QRadioButton( GroupProperties );
+ CloseViews->setText( tr( "Close remaining views" ) );
+ connect( CloseViews, SIGNAL( pressed() ), this, SLOT( onCloseViews() ) );
+
+ QRadioButton* StackViews = new QRadioButton( GroupProperties );
+ StackViews->setText( tr( "Stack remaining views in the last area" ) );
+ StackViews->setChecked( true );
+ connect( StackViews, SIGNAL( pressed() ), this, SLOT( onStackViews() ) );
+
+ ViewsListLayout->addWidget( myViewsList );
+ ViewsListLayout->addWidget( CloseViews );
+ ViewsListLayout->addWidget( StackViews );
+ }
+ else {
+ GroupProperties->setTitle( tr( "Sub-views Properties" ) );
+ for( int i = 0; i < 4; i++ ) {
+ QLabel* SubView = new QLabel( tr( "Sub-view" ) + " " + QString::number(i+1),
+ GroupProperties);
+ myLabels << SubView;
+
+ QComboBox* ComboBox = new QComboBox( GroupProperties );
+ ComboBox->addItem("XYZ");
+ ComboBox->addItem("XY");
+ ComboBox->addItem("XZ");
+ ComboBox->addItem("YZ");
+ myComboBox.append( ComboBox );
+ myMapComboBoxMode.insert( ComboBox, (ViewMode)i );
+ ComboBox->setCurrentIndex(i);
+ connect( ComboBox, SIGNAL( currentIndexChanged (int) ), this, SLOT( onComboBoxChanged(int) ) );
+ }
+
+ QGridLayout* SubViewsPropLayout = new QGridLayout( GroupProperties );
+ SubViewsPropLayout->addWidget( myLabels[0], 0, 0 );
+ SubViewsPropLayout->addWidget( myComboBox[0], 0, 1 );
+ SubViewsPropLayout->addWidget( myLabels[1], 0, 2 );
+ SubViewsPropLayout->addWidget( myComboBox[1], 0, 3 );
+ SubViewsPropLayout->addWidget( myLabels[2], 1, 0 );
+ SubViewsPropLayout->addWidget( myComboBox[2], 1, 1 );
+ SubViewsPropLayout->addWidget( myLabels[3], 1, 2 );
+ SubViewsPropLayout->addWidget( myComboBox[3], 1, 3 );
+ }
+
+ /////////////////////////////////////////////////////////////////////
+
+ QGroupBox* GroupButtons = new QGroupBox();
+ QHBoxLayout* GroupButtonsLayout = new QHBoxLayout(GroupButtons);
+
+ myButtonApply = new QPushButton(tr( "&Apply" ), GroupButtons);
+ myButtonApply->setAutoDefault(true);
+ myButtonApply->setDefault(true);
+ myButtonApply->setEnabled( false );
+ QPushButton* buttonClose = new QPushButton(tr( "&Close" ), GroupButtons);
+ buttonClose->setAutoDefault(true);
+
+ GroupButtonsLayout->addWidget( myButtonApply );
+ GroupButtonsLayout->addSpacing(100);
+ GroupButtonsLayout->addWidget( buttonClose );
+
+ /////////////////////////////////////////////////////////////////////
+
+ topLayout->addWidget( aGroupViewsLayout );
+ topLayout->insertStretch(1);
+ topLayout->addWidget( GroupProperties );
+ topLayout->addWidget( GroupButtons );
+
+
+ connect( myButton2Views, SIGNAL( pressed() ), this, SLOT( onChangeIcons() ) );
+ connect( myButton3Views, SIGNAL( pressed() ), this, SLOT( onChangeIcons() ) );
+ connect( myButton4Views, SIGNAL( pressed() ), this, SLOT( onChangeIcons() ) );
+ connect( myButtonPrevious, SIGNAL( pressed() ), this, SLOT( onPreviousViews() ) );
+ connect( myButtonNext, SIGNAL( pressed() ), this, SLOT( onNextViews() ) );
+ connect( SplitOptions, SIGNAL( buttonClicked(int) ), SLOT( onSplitChanged(int)));
+ connect( buttonClose, SIGNAL( pressed() ), this, SLOT( reject() ) );
+ connect( myButtonApply, SIGNAL( pressed() ), this, SLOT( onApply() ) );
+
+ initialize();
+}
+
+/*!
+ \brief Destructor
+*/
+QtxSplitDlg::~QtxSplitDlg()
+{
+}
+
+/*!
+ \brief Return current split mode
+*/
+int QtxSplitDlg::getSplitMode()
+{
+ return mySplitMode;
+}
+
+/*!
+ \brief Return selected view modes
+*/
+QList<int> QtxSplitDlg::getViewsMode()
+{
+ QList<int> aList;
+ for ( int i = 0; i < myViewsNB; i++ ) {
+ int aMode = myMapComboBoxMode[myComboBox[i]];
+ aList<<aMode;
+ }
+ return aList;
+}
+
+/*!
+ \brief Create new QToolButton using icon of split mode
+*/
+QToolButton* QtxSplitDlg::createSplitButton( int theViewsNB, int theSplitMode )
+{
+ QString anImageName = QString( ":/images/qtx_split%1_%2.png" )
+ .arg(theViewsNB).arg(theSplitMode).toLatin1().constData();
+ QPixmap aSplitIcon( anImageName );
+ QToolButton* aSplitBtn = new QToolButton( this );
+ aSplitBtn->setCheckable( true );
+ aSplitBtn->setIcon( aSplitIcon );
+ aSplitBtn->setIconSize( QSize( aSplitIcon.width(), aSplitIcon.height() ) );
+ return aSplitBtn;
+}
+
+/*!
+ \brief Initialisation of widgets
+*/
+void QtxSplitDlg::initialize()
+{
+ if( myDlgMode == ArrangeViews ) {
+ int aViewsNumber = myWorkstack->windowList().count();
+ if( aViewsNumber == 2 ) {
+ myButton3Views->setEnabled( false );
+ myButton4Views->setEnabled( false );
+ }
+ else if( aViewsNumber == 3 )
+ myButton4Views->setEnabled( false );
+ }
+ else if( myDlgMode == CreateSubViews ) {
+ for( int i = 0; i < 4; i++) {
+ if( i < myViewsNB )
+ myMapModeIsBusy[(ViewMode)i] = true;
+ else
+ myMapModeIsBusy[ (ViewMode)i] = false;
+ }
+ onSynchronize();
+ }
+}
+
+/*!
+ \brief Verification if all items necessary for dialog were selected
+*/
+void QtxSplitDlg::valid()
+{
+ bool isValid = false;
+ if( myViewsNB == 2 )
+ isValid = ( mySplitMode >= 0 && mySplitMode < 2 )? true:false;
+ else if( myViewsNB == 3 )
+ isValid = ( mySplitMode >= 2 && mySplitMode < 8 )? true:false;
+ else if( myViewsNB == 4)
+ isValid = ( mySplitMode >=8 && mySplitMode < 29 )?true:false;
+
+ if( myDlgMode == ArrangeViews ) {
+ if( myNBSelectedViews != myViewsNB)
+ isValid = false;
+ }
+ myButtonApply->setEnabled( isValid );
+}
+
+/*!
+ \brief Called when number of views was changed
+ and it's necessary to set others split icons
+*/
+void QtxSplitDlg::onChangeIcons()
+{
+ if( myButton2Views->isDown() ) {
+ myViewsNB = 2;
+ mySplitMode = 0;
+ myStackedSplitLayout->setCurrentIndex(0);
+ myButtonPrevious->setEnabled( false );
+ myButtonNext->setEnabled( false );
+ }
+ else if( myButton3Views->isDown() ) {
+ myViewsNB = 3;
+ mySplitMode = 2;
+ myStackedSplitLayout->setCurrentIndex(1);
+ myButtonPrevious->setEnabled( false );
+ myButtonNext->setEnabled( false );
+ }
+ else if( myButton4Views->isDown() ) {
+ myViewsNB = 4;
+ mySplitMode = 8;
+ myStackedSplitLayout->setCurrentIndex(2);
+ myButtonPrevious->setEnabled( false );
+ myButtonNext->setEnabled( true );
+ }
+ onSynchronize();
+}
+
+/*!
+ \brief Called when user selects an icon for split
+*/
+void QtxSplitDlg::onSplitChanged( int theMode )
+{
+ mySplitMode = theMode;
+ valid();
+}
+
+/*!
+ \brief Called when user selects item of Combo Box
+*/
+void QtxSplitDlg::onComboBoxChanged( int theItem )
+{
+ QMap<ViewMode,bool > aModeEnabledMap;
+ for( int i = 0; i < 4; i++ )
+ aModeEnabledMap[(ViewMode)i] = false;
+ QComboBox* aSender = qobject_cast<QComboBox*>(sender());
+ for ( int i=0;i<4;i++ )
+ if( myComboBox[i] == aSender )
+ myMapComboBoxMode[myComboBox[i]]=(ViewMode)theItem;
+
+ for( int i = 0; i < 4; i++ ) {
+ if( myComboBox[i]->isVisible() ) {
+ ViewMode aViewMode = myMapComboBoxMode[myComboBox[i]];
+ aModeEnabledMap[aViewMode] = true;
+ }
+ }
+ for( int i = 0; i < 4; i++ ) {
+ if( myComboBox[i] != aSender ) {
+ ViewMode aNewMode;
+ if( myMapComboBoxMode[myComboBox[i]] == (ViewMode)(theItem) ) {
+ for( int j = 0; j < 4; j++ )
+ if( !aModeEnabledMap[(ViewMode)j] )
+ aNewMode = (ViewMode)j;
+ myComboBox[i]->setCurrentIndex( (int)aNewMode );
+ }
+ }
+ }
+}
+
+/*!
+ \brief Called when user taps previous button
+*/
+void QtxSplitDlg::onPreviousViews()
+{
+ int aCurrentIndex = myStackedSplitLayout->currentIndex();
+ myStackedSplitLayout->setCurrentIndex( aCurrentIndex - 1 );
+ if( myStackedSplitLayout->currentIndex() == 2 )
+ myButtonPrevious->setEnabled( false );
+ if( myStackedSplitLayout->currentIndex() < 4 )
+ myButtonNext->setEnabled( true );
+}
+
+/*!
+ \brief Called when user taps next button
+*/
+void QtxSplitDlg::onNextViews()
+{
+ int aCurrentIndex = myStackedSplitLayout->currentIndex();
+ myStackedSplitLayout->setCurrentIndex( aCurrentIndex + 1 );
+ if( myStackedSplitLayout->currentIndex() == 4 )
+ myButtonNext->setEnabled( false );
+ if( myStackedSplitLayout->currentIndex() > 2 )
+ myButtonPrevious->setEnabled( true );
+}
+
+/*!
+ \brief Synchronize data and widgets
+*/
+void QtxSplitDlg::onSynchronize( )
+{
+ if( myDlgMode == ArrangeViews) {
+ int aCheckedNumber = 0;
+ for( int i=0; i < myViewsList->count(); i++ ) {
+ if( myViewsList->item(i)->checkState() == Qt::Checked )
+ aCheckedNumber++;
+ if( aCheckedNumber == myViewsNB )
+ for( int p = i+1; p < myViewsList->count(); p++ )
+ myViewsList->item(p)->setCheckState( Qt::Unchecked );
+ }
+ if( aCheckedNumber == myViewsNB ) {
+ for( int i=0; i < myViewsList->count(); i++ )
+ if( myViewsList->item(i)->checkState() == Qt::Unchecked )
+ myViewsList->item(i)->setFlags( myViewsList->item(i)->flags() & ~Qt::ItemIsEnabled );
+ }
+ else if( aCheckedNumber < myViewsNB ) {
+ for( int i=0; i < myViewsList->count(); i++ )
+ if( myViewsList->item(i)->checkState() == Qt::Unchecked )
+ myViewsList->item(i)->setFlags( myViewsList->item(i)->flags() | Qt::ItemIsEnabled );
+ }
+ myNBSelectedViews = aCheckedNumber;
+ }
+ else if( myDlgMode == CreateSubViews ) {
+ foreach( QComboBox* aBox, myComboBox )
+ aBox->setVisible( true );
+ foreach( QLabel* aLabel, myLabels )
+ aLabel->setVisible( true );
+
+ for( int i = myViewsNB; i < 4; i++ ) {
+ myComboBox[i]->setVisible( false );
+ myLabels[i]->setVisible( false );
+ }
+ for( int i = 0; i < 4; i++ )
+ myComboBox[i]->setCurrentIndex(i);
+ }
+ valid();
+}
+
+/*!
+ \brief Called when check box "Close remaining views" is active
+*/
+void QtxSplitDlg::onCloseViews()
+{
+ myIsCloseViews = true;
+}
+
+/*!
+ \brief Called when check box "Stack remaining views
+ in the last area" is active
+*/
+void QtxSplitDlg::onStackViews()
+{
+ myIsCloseViews = false;
+}
+
+/*!
+ \brief Apply dialog
+*/
+void QtxSplitDlg::onApply()
+{
+ if( myDlgMode == ArrangeViews ) {
+ myWorkstack->stack();
+ int Split3Map[6][6] = {
+ // View, Dir, View,Move, Dir
+ { 1, 1, 2, -1, 1 },
+ { 1, 2, 2, -1, 2 },
+ { 2, 1, 1, -1, 2 },
+ { 1, 1, 2, 1, 2 },
+ { 1, 2, 2, 1, 1 },
+ { 2, 2, 1, -1, 1 },
+ };
+
+ int Split4Map[21][9] = {
+ // View, Dir, View,Move, Dir, View,Move, Dir
+ { 1, 1, 2, -1, 1, 3, -1, 1 },
+ { 1, 2, 2, -1, 2, 3, -1, 2 },
+ { 1, 1, 2, -1, 2, 3, 1, 2 },
+ { 2, 1, 3, -1, 1, 1, -1, 2 },
+ { 1, 1, 3, -1, 1, 2, 1, 2 },
+ { 1, 1, 2, -1, 1, 3, 2, 2 },
+ { 2, 2, 3, -1, 2, 1, -1, 1 },
+ { 1, 2, 3, -1, 2, 2, 1, 1 },
+ { 1, 2, 2, -1, 2, 3, 2, 1 },
+ { 3, 2, 2, -1, 1, 1, -1, 2 },
+ { 3, 2, 1, -1, 1, 2, 1, 2 },
+ { 1, 2, 3, 1, 1, 2, 1, 2 },
+ { 1, 2, 2, 1, 1, 3, 2, 2 },
+ { 1, 1, 3, 1, 2, 2, 1, 1 },
+ { 1, 1, 2, 1, 2, 3, 2, 1 },
+ { 3, 1, 2, -1, 2, 1, -1, 1 },
+ { 3, 1, 1, -1, 2, 2, 1, 1 },
+ { 1, 2, 2, 1, 1, 3, 1, 1 },
+ { 3, 2, 1, -1, 1, 2, -1, 1 },
+ { 3, 1, 1, -1, 2, 2, -1, 2 },
+ { 1, 1, 2, 1, 2, 3, 1, 2 }
+ };
+
+ QWidgetList aWidgetList = myWorkstack->windowList();
+ QWidgetList aListChecked;
+ QWidgetList aListUnchecked;
+ QtxWorkstack::SplitType aSplitType = QtxWorkstack::SplitMove;
+
+ for( int i = 0; i < myViewsList->count(); i++ ) {
+ QString aName = myViewsList->item(i)->text();
+ for( int j = 0; j< aWidgetList.count(); j++ ) {
+ QWidget* aWidget = aWidgetList.at(j);
+ if( aWidget->windowTitle() == aName ) {
+ if( myViewsList->item(i)->checkState() == Qt::Checked )
+ aListChecked.append( aWidget );
+ else if( myViewsList->item(i)->checkState() == Qt::Unchecked )
+ aListUnchecked.append( aWidget );
+ }
+ }
+ }
+
+ if( myViewsNB == 2 )
+ {
+ if( aListChecked.size() != 2 )
+ return;
+ if( mySplitMode == 0)
+ myWorkstack->Split( aListChecked.at(1),Qt::Horizontal, aSplitType );
+ else if( mySplitMode == 1 )
+ myWorkstack->Split( aListChecked.at(1),Qt::Vertical, aSplitType );
+ }
+ else if( myViewsNB == 3 ) {
+ if( aListChecked.size() != 3 )
+ return;
+ mySplitMode = mySplitMode - 2;
+ myWorkstack->Split( aListChecked.at( Split3Map[mySplitMode][0] ),
+ Qt::Orientation( Split3Map[mySplitMode][1] ),
+ aSplitType );
+ if( Split3Map[mySplitMode][3] >= 0 )
+ myWorkstack->move( aListChecked.at( Split3Map[mySplitMode][2] ),
+ aListChecked.at( Split3Map[mySplitMode][3] ),
+ false );
+
+ myWorkstack->Split( aListChecked.at( Split3Map[mySplitMode][2] ),
+ Qt::Orientation( Split3Map[mySplitMode][4] ),
+ aSplitType );
+ }
+ else if( myViewsNB == 4 ) {
+ if( aListChecked.size() != 4 )
+ return;
+ mySplitMode = mySplitMode - 8;
+ myWorkstack->Split( aListChecked.at( Split4Map[mySplitMode][0] ),
+ Qt::Orientation( Split4Map[mySplitMode][1] ),
+ aSplitType );
+ if( Split4Map[mySplitMode][3] >= 0 )
+ myWorkstack->move( aListChecked.at( Split4Map[mySplitMode][2] ),
+ aListChecked.at( Split4Map[mySplitMode][3] ),
+ false );
+
+ myWorkstack->Split( aListChecked.at( Split4Map[mySplitMode][2] ),
+ Qt::Orientation( Split4Map[mySplitMode][4] ),
+ aSplitType );
+ if( Split4Map[mySplitMode][6] >= 0 )
+ myWorkstack->move( aListChecked.at( Split4Map[mySplitMode][5] ),
+ aListChecked.at( Split4Map[mySplitMode][6] ),
+ false );
+
+ myWorkstack->Split( aListChecked.at( Split4Map[mySplitMode][5] ),
+ Qt::Orientation( Split4Map[mySplitMode][7] ),
+ aSplitType );
+ }
+ for( int i = 0; i < aListUnchecked.count(); i++ ) {
+ if( myIsCloseViews )
+ aListUnchecked.at(i)->close();
+ else
+ myWorkstack->move( aListUnchecked.at(i),
+ aListChecked.at( myViewsNB - 1 ),
+ false );
+ }
+ }
+ accept();
+}
#define QTXWORKSTACKACTION_H
#include "QtxActionSet.h"
+#include <QDialog>
class QtxWorkstack;
+class QRadioButton;
+class QStackedLayout;
+class QListWidget;
+class QComboBox;
+class QLabel;
+class QToolButton;
#ifdef WIN32
#pragma warning( disable:4251 )
virtual ~QtxWorkstackAction();
QtxWorkstack* workstack() const;
+ QAction* getArrangeViewsAction();
int menuActions() const;
void setMenuActions( const int );
private:
QtxWorkstack* myWorkstack; //!< parent workstack
bool myWindowsFlag; //!< "show child windows items" flag
+ QAction* myArrangeViewsAction;
+};
+
+enum QtxSplitDlgMode{ ArrangeViews, CreateSubViews };
+
+class QTX_EXPORT QtxSplitDlg : public QDialog
+{
+ Q_OBJECT
+
+ enum ViewMode{ XYZ, XY, XZ, YZ };
+
+public:
+ QtxSplitDlg( QWidget* = 0, QtxWorkstack* = NULL, QtxSplitDlgMode = ArrangeViews );
+ ~QtxSplitDlg();
+ int getSplitMode();
+ QList<int> getViewsMode();
+
+private :
+ QToolButton* createSplitButton( int, int );
+ void initialize();
+ void valid();
+
+ QStackedLayout* myStackedSplitLayout;
+ QRadioButton* myButton2Views;
+ QRadioButton* myButton3Views;
+ QRadioButton* myButton4Views;
+ QPushButton* myButtonApply;
+ QPushButton* myButtonPrevious;
+ QPushButton* myButtonNext;
+ QList<QLabel*> myLabels;
+ QList<QComboBox*> myComboBox;
+ QListWidget* myViewsList;
+
+ QtxWorkstack* myWorkstack;
+ QtxSplitDlgMode myDlgMode;
+
+ int myViewsNB;
+ int mySplitMode;
+ int myNBSelectedViews;
+ bool myIsCloseViews;
+ QMap<QComboBox*, ViewMode> myMapComboBoxMode;
+ QMap<ViewMode, bool> myMapModeIsBusy;
+
+private slots:
+
+ void onChangeIcons();
+ void onSplitChanged(int);
+ void onComboBoxChanged(int);
+ void onPreviousViews();
+ void onNextViews();
+ void onSynchronize();
+ void onCloseViews();
+ void onStackViews();
+ void onApply();
};
#ifdef WIN32
<source>Split horizontally</source>
<translation>Diviser horizontalement</translation>
</message>
+ <message>
+ <source>Arrange Views</source>
+ <translation>Disposer les vues</translation>
+ </message>
</context>
<context>
<name>QtxColorButton</name>
<translation>Modifier l'arrière plan</translation>
</message>
</context>
+<context>
+ <name>QtxSplitDlg</name>
+ <message>
+ <source>Arrange views</source>
+ <translation>Disposer les vues</translation>
+ </message>
+ <message>
+ <source>Create sub-views</source>
+ <translation>Créer les sous-vues</translation>
+ </message>
+ <message>
+ <source>Views Layout</source>
+ <translation>Mise en page des vues</translation>
+ </message>
+ <message>
+ <source>Sub-views Layout</source>
+ <translation>Mise en page des sous-vues</translation>
+ </message>
+ <message>
+ <source>Views List</source>
+ <translation>Liste des vues</translation>
+ </message>
+ <message>
+ <source>Close remaining views</source>
+ <translation>Fermer les vues restantes</translation>
+ </message>
+ <message>
+ <source>Stack remaining views in the last area</source>
+ <translation>Empiler les vues restantes dans la dernière zone</translation>
+ </message>
+ <message>
+ <source>Sub-views Properties</source>
+ <translation>Propriétés des sous-vues</translation>
+ </message>
+ <message>
+ <source>Sub-view</source>
+ <translation>Sous-vue</translation>
+ </message>
+ <message>
+ <source>&Apply</source>
+ <translation>&Appliquer</translation>
+ </message>
+ <message>
+ <source>&Close</source>
+ <translation>&Fermer</translation>
+ </message>
+</context>
</TS>
myWorkstackAction->setStatusTip( QtxWorkstackAction::SplitVertical, tr( "PRP_DESK_WINDOW_VSPLIT" ) );
myWorkstackAction->setAccel( QtxWorkstackAction::SplitVertical, Qt::ALT + Qt::SHIFT + Qt::Key_V );
+ QAction* anArrangeViewsAction = myWorkstackAction->getArrangeViewsAction();
+ if( anArrangeViewsAction )
+ connect( anArrangeViewsAction, SIGNAL( triggered() ), this, SLOT( onArrangeViews() ) );
+
QtxActionMenuMgr* mMgr = menuMgr();
if ( !mMgr )
return;
int winMenuId = mMgr->insert( tr( "MEN_DESK_WINDOW" ), -1, 100 );
+ mMgr->insert( anArrangeViewsAction, winMenuId, -1 );
mMgr->insert( myWorkstackAction, winMenuId, -1 );
mMgr->insert( QtxActionMenuMgr::separator(), winMenuId, -1 );
}
+/*!
+ Emit Arrange Views menu activated.
+*/
+void STD_TabDesktop::onArrangeViews()
+{
+ QtxSplitDlg ArrangeViewsDlg( this, workstack(), ArrangeViews );
+ ArrangeViewsDlg.exec();
+}
+
/*!
Convert STD_TabDesktop enumerations to QtxWorkstackAction
*/
private slots:
void onWindowActivated( QWidget* );
+ void onArrangeViews();
protected:
void createActions();