Salome HOME
refs #30 - Sketch base GUI: create, draw lines
[modules/shaper.git] / src / XGUI / XGUI_MainWindow.cpp
index 99d2422e9c32dced0a0ce88ac985f384998ed7f5..cbc3e67f32994ff7338a1d2cceafdb534dc6bbf4 100644 (file)
@@ -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<QMdiArea*>(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();
-  //<! Restore ability to close panel from the window's menu
-  aViewAct->setEnabled(true);
-  myPropertyPanelDock->show();
-  myPropertyPanelDock->raise();
-}
 
-void XGUI_MainWindow::hidePropertyPanel()
-{
-  QAction* aViewAct = myPropertyPanelDock->toggleViewAction();
-  //<! Do not allow to show empty property panel
-  aViewAct->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(); //<! Invisible by default
-
-  tabifyDockWidget(aObjDock, myPropertyPanelDock);
-}
-
-
-QDockWidget* XGUI_MainWindow::createPropertyPanel()
-{
-  QDockWidget* aPropPanel = new QDockWidget(this);
-  aPropPanel->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;
-}