X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FXGUI%2FXGUI_MainWindow.cpp;h=fdaaf16f0e00e6524f6c4c581b35cda2f2d6666e;hb=ff8ca280553ca5b69794492d5c1c4b60b180959e;hp=c89e0fc0a1224586ceb3059717e6a4ef724db155;hpb=401394b2e312e5c4ecd6a410b90eb2c159a675bf;p=modules%2Fshaper.git diff --git a/src/XGUI/XGUI_MainWindow.cpp b/src/XGUI/XGUI_MainWindow.cpp index c89e0fc0a..fdaaf16f0 100644 --- a/src/XGUI/XGUI_MainWindow.cpp +++ b/src/XGUI/XGUI_MainWindow.cpp @@ -1,4 +1,5 @@ #include "XGUI_MainWindow.h" +#include "XGUI_Constants.h" #include "XGUI_MainMenu.h" #include "XGUI_ViewWindow.h" #include "XGUI_Viewer.h" @@ -23,12 +24,13 @@ #include #include #include - +#include XGUI_MainWindow::XGUI_MainWindow(QWidget* parent) : QMainWindow(parent), - myObjectBrowser(0), - myPythonConsole(0) + myObjectBrowser(0), + myPythonConsole(0), + myPropertyPanelDock(0) { setWindowTitle(tr("New Geom")); myMenuBar = new XGUI_MainMenu(this); @@ -38,7 +40,7 @@ XGUI_MainWindow::XGUI_MainWindow(QWidget* parent) myViewer = new XGUI_Viewer(this); - createDockWidgets(); + //createDockWidgets(); } XGUI_MainWindow::~XGUI_MainWindow(void) @@ -73,11 +75,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); } @@ -91,6 +89,23 @@ 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. @@ -99,10 +114,16 @@ void XGUI_MainWindow::createDockWidgets() { QDockWidget* aObjDock = createObjectBrowser(); addDockWidget(Qt::LeftDockWidgetArea, aObjDock); - QDockWidget* aPropPanelDock = createPropertyPanel(); - addDockWidget(Qt::LeftDockWidgetArea, aPropPanelDock); + myPropertyPanelDock = createPropertyPanel(); + addDockWidget(Qt::LeftDockWidgetArea, myPropertyPanelDock); + hidePropertyPanel(); //setWindowTitle(theTitle); } @@ -110,6 +131,8 @@ QDockWidget* XGUI_MainWindow::createPropertyPanel() { QDockWidget* aPropPanel = new QDockWidget(this); aPropPanel->setWindowTitle(tr("Property Panel")); + QAction* aViewAct = aPropPanel->toggleViewAction(); + aPropPanel->setObjectName(XGUI::PROP_PANEL); QWidget* aContent = new QWidget(aPropPanel); QVBoxLayout* aMainLay = new QVBoxLayout(aContent); @@ -117,7 +140,7 @@ QDockWidget* XGUI_MainWindow::createPropertyPanel() aPropPanel->setWidget(aContent); QWidget* aCustomWidget = new QWidget(aContent); - aCustomWidget->setObjectName("PropertyPanelWidget"); + aCustomWidget->setObjectName(XGUI::PROP_PANEL_WDG); aMainLay->addWidget(aCustomWidget); aMainLay->addStretch(1); @@ -130,13 +153,18 @@ QDockWidget* XGUI_MainWindow::createPropertyPanel() QPushButton* aBtn = new QPushButton(QIcon(":pictures/button_help.png"), "", aFrm); aBtn->setFlat(true); + //connect(aBtn, SIGNAL(clicked()), this, SIGNAL(propertyHelpPressed())); aBtnLay->addWidget(aBtn); aBtnLay->addStretch(1); aBtn = new QPushButton(QIcon(":pictures/button_ok.png"), "", aFrm); + aBtn->setObjectName(XGUI::PROP_PANEL_OK); aBtn->setFlat(true); + //connect(aBtn, SIGNAL(clicked()), this, SIGNAL(propertyOkPressed())); aBtnLay->addWidget(aBtn); aBtn = new QPushButton(QIcon(":pictures/button_cancel.png"), "", aFrm); + aBtn->setObjectName(XGUI::PROP_PANEL_CANCEL); aBtn->setFlat(true); + //connect(aBtn, SIGNAL(clicked()), this, SIGNAL(propertyClosePressed())); aBtnLay->addWidget(aBtn); return aPropPanel; @@ -148,9 +176,6 @@ QDockWidget* XGUI_MainWindow::createObjectBrowser() 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; }