X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FXGUI%2FXGUI_MainWindow.cpp;h=cbc3e67f32994ff7338a1d2cceafdb534dc6bbf4;hb=6df60c642d0427e2cb42bd29e2c64d4e5dbdaee4;hp=99d2422e9c32dced0a0ce88ac985f384998ed7f5;hpb=420c997daf80ad43abc8cc65fb19b282169525c3;p=modules%2Fshaper.git diff --git a/src/XGUI/XGUI_MainWindow.cpp b/src/XGUI/XGUI_MainWindow.cpp index 99d2422e9..cbc3e67f3 100644 --- a/src/XGUI/XGUI_MainWindow.cpp +++ b/src/XGUI/XGUI_MainWindow.cpp @@ -28,9 +28,7 @@ XGUI_MainWindow::XGUI_MainWindow(QWidget* parent) : QMainWindow(parent), - myObjectBrowser(NULL), - myPythonConsole(NULL), - myPropertyPanelDock(NULL) + myPythonConsole(0) { setWindowTitle(tr("New Geom")); myMenuBar = new XGUI_MainMenu(this); @@ -39,8 +37,6 @@ XGUI_MainWindow::XGUI_MainWindow(QWidget* parent) setCentralWidget(aMdiArea); myViewer = new XGUI_Viewer(this); - - createDockWidgets(); } XGUI_MainWindow::~XGUI_MainWindow(void) @@ -53,18 +49,6 @@ QMdiArea* XGUI_MainWindow::mdiArea() const return static_cast(centralWidget()); } -//****************************************************** -void XGUI_MainWindow::showObjectBrowser() -{ - myObjectBrowser->parentWidget()->show(); -} - -//****************************************************** -void XGUI_MainWindow::hideObjectBrowser() -{ - myObjectBrowser->parentWidget()->hide(); -} - //****************************************************** void XGUI_MainWindow::showPythonConsole() { @@ -75,11 +59,7 @@ void XGUI_MainWindow::showPythonConsole() aDoc->setMinimumHeight(0); aDoc->setWindowTitle("Console"); myPythonConsole = new PyConsole_EnhConsole( aDoc, new PyConsole_EnhInterp()); - //myPythonConsole = new QTextEdit(aDoc); - //myPythonConsole->setGeometry(0,0,200, 50); - //myPythonConsole->setText(">>>"); aDoc->setWidget(myPythonConsole); - //myPythonConsole->setMinimumHeight(0); addDockWidget(Qt::TopDockWidgetArea, aDoc); tabifyDockWidget(myMenuBar->getLastDockWindow(), aDoc); } @@ -93,87 +73,4 @@ void XGUI_MainWindow::hidePythonConsole() myPythonConsole->parentWidget()->hide(); } -void XGUI_MainWindow::showPropertyPanel() -{ - QAction* aViewAct = myPropertyPanelDock->toggleViewAction(); - //setEnabled(true); - myPropertyPanelDock->show(); - myPropertyPanelDock->raise(); -} -void XGUI_MainWindow::hidePropertyPanel() -{ - QAction* aViewAct = myPropertyPanelDock->toggleViewAction(); - //setEnabled(false); - myPropertyPanelDock->hide(); -} - -/* - * Creates dock widgets, places them in corresponding area - * and tabifies if necessary. - */ -void XGUI_MainWindow::createDockWidgets() -{ - QDockWidget* aObjDock = createObjectBrowser(); - addDockWidget(Qt::LeftDockWidgetArea, aObjDock); - myPropertyPanelDock = createPropertyPanel(); - addDockWidget(Qt::LeftDockWidgetArea, myPropertyPanelDock); - hidePropertyPanel(); //setWindowTitle(tr("Property Panel")); - aPropPanel->setObjectName(XGUI::PROP_PANEL); - - QWidget* aContent = new QWidget(aPropPanel); - QVBoxLayout* aMainLay = new QVBoxLayout(aContent); - aMainLay->setContentsMargins(3, 3, 3, 3); - aPropPanel->setWidget(aContent); - - QWidget* aCustomWidget = new QWidget(aContent); - aCustomWidget->setObjectName(XGUI::PROP_PANEL_WDG); - aMainLay->addWidget(aCustomWidget); - aMainLay->addStretch(1); - - QFrame* aFrm = new QFrame(aContent); - aFrm->setFrameStyle(QFrame::Sunken); - aFrm->setFrameShape(QFrame::Panel); - QHBoxLayout* aBtnLay = new QHBoxLayout(aFrm); - aBtnLay->setContentsMargins(0, 0, 0, 0); - aMainLay->addWidget(aFrm); - - QPushButton* aBtn = new QPushButton(QIcon(":pictures/button_help.png"), "", aFrm); - aBtn->setFlat(true); - aBtnLay->addWidget(aBtn); - aBtnLay->addStretch(1); - aBtn = new QPushButton(QIcon(":pictures/button_ok.png"), "", aFrm); - aBtn->setObjectName(XGUI::PROP_PANEL_OK); - aBtn->setFlat(true); - aBtnLay->addWidget(aBtn); - aBtn = new QPushButton(QIcon(":pictures/button_cancel.png"), "", aFrm); - aBtn->setObjectName(XGUI::PROP_PANEL_CANCEL); - aBtn->setFlat(true); - aBtnLay->addWidget(aBtn); - - return aPropPanel; -} - -QDockWidget* XGUI_MainWindow::createObjectBrowser() -{ - QDockWidget* aObjDock = new QDockWidget(this); - aObjDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea); - aObjDock->setWindowTitle(tr("Object browser")); - myObjectBrowser = new XGUI_ObjectsBrowser(aObjDock); - //myObjectBrowser->setColumnCount(1); - //myObjectBrowser->setHeaderHidden(true); - aObjDock->setWidget(myObjectBrowser); -// fillObjectBrowser(); - return aObjDock; -}