]> SALOME platform Git repositories - tools/install.git/commitdiff
Salome HOME
Add "Close" button for Help window + "Escape" key also closes Help window.
authorvsr <vsr@opencascade.com>
Fri, 25 Feb 2005 06:34:13 +0000 (06:34 +0000)
committervsr <vsr@opencascade.com>
Fri, 25 Feb 2005 06:34:13 +0000 (06:34 +0000)
src/SALOME_HelpWindow.cxx
src/SALOME_HelpWindow.hxx
src/icons.h

index a08b99564af4da30a392480619b405a2eae7b13b..36835e6c74831dd07ef5807dce717b0d0cb1dfc6 100644 (file)
@@ -50,7 +50,7 @@ HelpWindow::HelpWindow( SALOME_InstallWizard* wizard ) : QMainWindow( 0, "Salome
   addToolBar( toolbar, "Toolbar" );
   QToolButton* button;
   // --> back
-  button = new QToolButton( QIconSet( (const char**)back ), 
+  button = new QToolButton( QIconSet( (const char**)_img_back ), 
                             tr( "Backward" ), 
                             "", 
                             browser, 
@@ -59,7 +59,7 @@ HelpWindow::HelpWindow( SALOME_InstallWizard* wizard ) : QMainWindow( 0, "Salome
   button->setEnabled( FALSE );
   connect( browser, SIGNAL( backwardAvailable( bool ) ), button, SLOT( setEnabled( bool ) ) );
   // --> forward
-  button = new QToolButton( QIconSet( (const char**)forward ), 
+  button = new QToolButton( QIconSet( (const char**)_img_forward ), 
                             tr( "Forward" ), 
                             "", 
                             browser, 
@@ -68,13 +68,20 @@ HelpWindow::HelpWindow( SALOME_InstallWizard* wizard ) : QMainWindow( 0, "Salome
   button->setEnabled( FALSE );
   connect( browser, SIGNAL( forwardAvailable( bool ) ),  button, SLOT( setEnabled( bool ) ) );
   // --> home
-  button = new QToolButton( QIconSet( (const char**)home ), 
+  button = new QToolButton( QIconSet( (const char**)_img_home ), 
                             tr( "Home" ), 
                             "", 
                             browser, 
                             SLOT( home() ), 
                             toolbar );
   toolbar->addSeparator();
+  button = new QToolButton( QIconSet( (const char**)_img_close ), 
+                            tr( "Close" ), 
+                            "", 
+                            this, 
+                            SLOT( close() ), 
+                            toolbar );
+  toolbar->addSeparator();
   // --> logo
   QLabel* logo = new QLabel( toolbar, "logo" );
   logo->setPixmap( QPixmap( (const char**)image1_data ) );
@@ -109,6 +116,18 @@ HelpWindow::~HelpWindow()
 {
 }
 // ================================================================
+/*!
+ *  HelpWindow::keyPressEvent
+ *  Key press event handler
+ */
+// ================================================================
+void HelpWindow::keyPressEvent( QKeyEvent* e )
+{
+  if ( e->key() == Key_Escape )
+    close();
+  QMainWindow::keyPressEvent( e );
+}
+// ================================================================
 /*!
  *  HelpWindow::openHelp [ static ]
  *  Creates Help window ane return pointer to it if help file exists,
index 0ae3183a952bf8c02e53eb2f08880988e57c1f54..297d77b5c6ff8cd4e5071f48aee5b9d0eca54e83 100644 (file)
@@ -28,6 +28,9 @@ public:
   // opens/raises Help window
   static HelpWindow* openHelp( SALOME_InstallWizard* wizard );
 
+protected:
+  void keyPressEvent( QKeyEvent* e );
+
 private:
   QTextBrowser*   browser;    // help window browser
 };
index ae908b8503de2250b252ebfec0ff13fcb48cd137..771d1fe54df7c3ae764c2e70063ac45b9964f8ca 100644 (file)
@@ -3034,7 +3034,7 @@ static const char* const SALOME_Logo_xpm[] = {
 "QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt",
 "QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt"};
 
-static const char* const back[]={
+static const char* const _img_back[]={
 "16 16 5 1",
 "# c #000000",
 "a c #ffffff",
@@ -3058,7 +3058,7 @@ static const char* const back[]={
 "................",
 "......................"};
 
-static const char* const forward[]={
+static const char* const _img_forward[]={
 "16 16 5 1",
 "# c #000000",
 "a c #ffffff",
@@ -3083,7 +3083,7 @@ static const char* const forward[]={
 "................",
 "................"};
 
-static const char* const home[]={
+static const char* const _img_home[]={
 "16 16 4 1",
 "# c #000000",
 "a c #ffffff",
@@ -3107,6 +3107,28 @@ static const char* const home[]={
 "..#####.######..",
 "................"};
 
+static const char* const _img_close[]={
+"16 16 3 1",
+". c None",
+"# c #800000",
+"a c #ffffff",
+"................",
+"................",
+".##a........##a.",
+".####a.....##a..",
+"..####a...##a...",
+"....###a.#a.....",
+".....#####a.....",
+"......###a......",
+".....#####a.....",
+"....###a.##a....",
+"...###a...##a...",
+"..###a.....#a...",
+"..###a......#a..",
+"...#a........#a.",
+"................",
+"................"};
+
 static const char* const image1_data[] = { 
 "54 20 415 2",
 "bH c #004f87",