CMS 3D CMS Logo

VisSkipEventDialog.cc

Go to the documentation of this file.
00001 /****************************************************************************
00002 ** Form implementation generated from reading ui file 'VisFramework/VisFrameworkBase/src/VisSkipEventDialog.ui'
00003 **
00004 ** Created: Fri Feb 9 10:33:45 2007
00005 **      by: The User Interface Compiler ($Id: VisSkipEventDialog.cc,v 1.1 2007/02/09 13:21:33 yana Exp $)
00006 **
00007 ** WARNING! All changes made in this file will be lost!
00008 ****************************************************************************/
00009 
00010 #include "VisFramework/VisFrameworkBase/interface/VisSkipEventDialog.h"
00011 
00012 #include <qvariant.h>
00013 #include <qpushbutton.h>
00014 #include <qlineedit.h>
00015 #include <qlayout.h>
00016 #include <qtooltip.h>
00017 #include <qwhatsthis.h>
00018 
00019 /*
00020  *  Constructs a VisSkipEventDialog as a child of 'parent', with the
00021  *  name 'name' and widget flags set to 'f'.
00022  *
00023  *  The dialog will by default be modeless, unless you set 'modal' to
00024  *  TRUE to construct a modal dialog.
00025  */
00026 VisSkipEventDialog::VisSkipEventDialog( QWidget* parent, const char* name, bool modal, WFlags fl )
00027     : QDialog( parent, name, modal, fl )
00028 {
00029     if ( !name )
00030         setName( "VisSkipEventDialog" );
00031     VisSkipEventDialogLayout = new QGridLayout( this, 1, 1, 11, 6, "VisSkipEventDialogLayout"); 
00032 
00033     topLayout = new QGridLayout( 0, 1, 1, 0, 6, "topLayout"); 
00034 
00035     forwardPushButton = new QPushButton( this, "forwardPushButton" );
00036 
00037     topLayout->addWidget( forwardPushButton, 0, 2 );
00038 
00039     skipNumberLineEdit = new QLineEdit( this, "skipNumberLineEdit" );
00040 
00041     topLayout->addWidget( skipNumberLineEdit, 0, 1 );
00042 
00043     backPushButton = new QPushButton( this, "backPushButton" );
00044 
00045     topLayout->addWidget( backPushButton, 0, 0 );
00046 
00047     VisSkipEventDialogLayout->addLayout( topLayout, 0, 0 );
00048     languageChange();
00049     resize( QSize(310, 52).expandedTo(minimumSizeHint()) );
00050     clearWState( WState_Polished );
00051 
00052     // signals and slots connections
00053     connect( backPushButton, SIGNAL( clicked() ), this, SLOT( skipBackwards() ) );
00054     connect( forwardPushButton, SIGNAL( clicked() ), this, SLOT( skipForward() ) );
00055     connect( skipNumberLineEdit, SIGNAL( returnPressed() ), this, SLOT( skip() ) );
00056 }
00057 
00058 /*
00059  *  Destroys the object and frees any allocated resources
00060  */
00061 VisSkipEventDialog::~VisSkipEventDialog()
00062 {
00063     // no need to delete child widgets, Qt does it all for us
00064 }
00065 
00066 /*
00067  *  Sets the strings of the subwidgets using the current
00068  *  language.
00069  */
00070 void VisSkipEventDialog::languageChange()
00071 {
00072     setCaption( tr( "Skip Events" ) );
00073     forwardPushButton->setText( tr( "Forward" ) );
00074     QToolTip::add( forwardPushButton, tr( "Go forward" ) );
00075     QWhatsThis::add( forwardPushButton, tr( "Skip specified number of events forward." ) );
00076     backPushButton->setText( tr( "Back" ) );
00077     QToolTip::add( backPushButton, tr( "Go back" ) );
00078     QWhatsThis::add( backPushButton, tr( "Skip specified number of events backwards." ) );
00079 }
00080 
00081 void VisSkipEventDialog::skipBackwards()
00082 {
00083     long num = skipNumberLineEdit->text ().toULong ();
00084     QString text;
00085     text = text.setNum (-num);
00086     skipNumberLineEdit->setText (text);
00087     accept ();
00088 }
00089 
00090 void VisSkipEventDialog::skipForward()
00091 {
00092     long num = skipNumberLineEdit->text ().toULong ();
00093     QString text;
00094     text = text.setNum (abs (num));
00095     skipNumberLineEdit->setText (text);
00096     accept ();
00097 }
00098 
00099 void VisSkipEventDialog::skip()
00100 {
00101     accept ();
00102 }
00103 

Generated on Tue Jun 9 17:50:04 2009 for CMSSW by  doxygen 1.5.4