]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
IPAL BugID9021, added a new dialog box for a list of existent studies
authorsrn <srn@opencascade.com>
Tue, 12 Jul 2005 09:38:41 +0000 (09:38 +0000)
committersrn <srn@opencascade.com>
Tue, 12 Jul 2005 09:38:41 +0000 (09:38 +0000)
src/STD/Makefile.in
src/STD/STD_Application.cxx
src/STD/STD_Application.h
src/STD/STD_LoadStudiesDlg.cxx [new file with mode: 0644]
src/STD/STD_LoadStudiesDlg.h [new file with mode: 0644]

index 01408775b023a0b5f7070fcc46919692653d44f0..7bcec25613c5698e4b25cfedf1b80d20e6ed282a 100755 (executable)
@@ -17,7 +17,8 @@ EXPORT_HEADERS= STD_Application.h \
                STD_MDIDesktop.h \
                STD_SDIDesktop.h \
                STD_TabDesktop.h \
-               STD_CloseDlg.h
+               STD_CloseDlg.h \
+               STD_LoadStudiesDlg.h
                     
 # .po files to transform in .qm
 PO_FILES = STD_images.po \
@@ -30,13 +31,15 @@ LIB_SRC= STD_Application.cxx \
         STD_MDIDesktop.cxx \
         STD_SDIDesktop.cxx \
         STD_TabDesktop.cxx \
-        STD_CloseDlg.cxx
+        STD_CloseDlg.cxx \
+        STD_LoadStudiesDlg.cxx
 
 LIB_MOC =  STD_Application.h \
           STD_MDIDesktop.h \
           STD_SDIDesktop.h \
           STD_TabDesktop.h \
-          STD_CloseDlg.h
+          STD_CloseDlg.h \
+          STD_LoadStudiesDlg.h
 
 RESOURCES_FILES = \
 config \
index c9ec632cb1dd6753f99b731a126e567820db3b7c..d0c62c30a9b5d4287bf1e8660072b381b24dde1b 100755 (executable)
@@ -270,6 +270,10 @@ bool STD_Application::onOpenDoc( const QString& aName )
   return res;
 }
 
+void STD_Application::onLoadDoc()
+{     
+}
+
 bool STD_Application::onLoadDoc( const QString& aName )
 {
   bool res = true;
index 6d6fd6e88710fba916a594199ea2558d2241aadd..e5041ccfdc7faba1860e6ab1f59ccaf37971aa1e 100755 (executable)
@@ -78,7 +78,7 @@ public slots:
   virtual void          onOpenDoc();
   virtual bool          onOpenDoc( const QString& );
 
-  //virtual void          onLoadDoc();
+  virtual void          onLoadDoc();
   virtual bool          onLoadDoc( const QString& );
 
   virtual void          onExit();
diff --git a/src/STD/STD_LoadStudiesDlg.cxx b/src/STD/STD_LoadStudiesDlg.cxx
new file mode 100644 (file)
index 0000000..96c8882
--- /dev/null
@@ -0,0 +1,69 @@
+#include "STD_LoadStudiesDlg.h"
+
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qlistbox.h>
+#include <qpushbutton.h>
+using namespace std;
+
+#define SPACING_SIZE             6
+#define MARGIN_SIZE             11
+#define MIN_LISTBOX_WIDTH      150
+#define MIN_LISTBOX_HEIGHT     100
+
+//================================================================================
+/*! Public -
+ * \brief creates a Load study dialog box
+ * \param parent a parent widget
+ * \param modal bool argument, if true the dialog box is a modal dialog box
+ * \param f style flags
+ * 
+ */
+//================================================================================
+STD_LoadStudiesDlg::STD_LoadStudiesDlg( QWidget* parent,  bool modal, WFlags fl )
+    : QDialog(parent, "STD_LoadStudiesDlg", modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
+{
+    resize( 321, 181 ); 
+    setCaption( tr("DLG_LOAD_STUDY_CAPTION") );
+    setSizeGripEnabled( TRUE );
+
+    QGridLayout* aTopLayout = new QGridLayout(this);
+    aTopLayout->setMargin(MARGIN_SIZE);
+    aTopLayout->setSpacing(SPACING_SIZE);
+
+    TextLabel1 = new QLabel( this, "TextLabel1" );
+    TextLabel1->setGeometry( QRect( 11, 12, 297, 16 ) ); 
+    TextLabel1->setText( tr( "MEN_STUDIES_CHOICE"  ) );
+
+    QHBoxLayout* aBtnLayout = new QHBoxLayout;
+    aBtnLayout->setSpacing( SPACING_SIZE );
+    aBtnLayout->setMargin( 0 );
+    
+    buttonOk = new QPushButton( this, "buttonOk" );
+    buttonOk->setText( tr( "BUT_OK"  ) );
+    buttonOk->setAutoDefault( true );
+    buttonOk->setDefault( true );
+    
+    buttonCancel = new QPushButton( this, "buttonCancel" );
+    buttonCancel->setText( tr( "BUT_CANCEL"  ) );
+    buttonCancel->setAutoDefault( true ); 
+  
+    aBtnLayout->addWidget( buttonOk );
+    aBtnLayout->addItem( new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ) );
+    aBtnLayout->addWidget( buttonCancel );
+
+    ListComponent = new QListBox( this, "ListComponent" );
+    ListComponent->setVScrollBarMode(QListBox::AlwaysOn);
+    ListComponent->setMinimumSize(MIN_LISTBOX_WIDTH, MIN_LISTBOX_HEIGHT);
+    ListComponent->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
+    ListComponent->setSelectionMode(QListBox::Single);
+
+    aTopLayout->addWidget(TextLabel1,    0, 0);
+    aTopLayout->addWidget(ListComponent, 1, 0);
+    aTopLayout->addLayout(aBtnLayout,    2, 0);
+
+    // signals and slots connections
+    connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) );
+    connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
+}
+
diff --git a/src/STD/STD_LoadStudiesDlg.h b/src/STD/STD_LoadStudiesDlg.h
new file mode 100644 (file)
index 0000000..c05ea22
--- /dev/null
@@ -0,0 +1,48 @@
+#ifndef STD_LOADSTUDIESDLG_H
+#define STD_LOADSTUDIESDLG_H
+
+#include <qvariant.h>
+#include <qdialog.h>
+class QVBoxLayout; 
+class QHBoxLayout; 
+class QGridLayout; 
+class QLabel;
+class QListBox;
+class QListBoxItem;
+class QPushButton;
+
+/*!\class STD_LoadStudiesDlg
+ * \brief Describes a dialog box that gives a list of opened studies.
+ * 
+ */
+class STD_LoadStudiesDlg : public QDialog
+{ 
+   Q_OBJECT
+
+public:
+   STD_LoadStudiesDlg( QWidget* parent = 0, bool modal = FALSE, WFlags fl = 0 );
+   ~STD_LoadStudiesDlg() {}
+
+  /*!\var TextLabel1
+   * \brief stores a dialog text label
+   */
+  QLabel* TextLabel1;
+  
+  /*!\var buttonOk
+   * \brief stores a dialog button OK
+   */
+  QPushButton* buttonOk;
+
+  /*!\var buttonCancel
+   * \brief stores a dialog button Cancel
+   */  
+  QPushButton* buttonCancel;
+
+  /*!\var ListComponent
+   * \brief stores a dialog list compoent
+   */ 
+   QListBox* ListComponent;
+
+};
+
+#endif // STD_LOADSTUDIESDLG_H