00001
00002
00003
00004
00005
00006
00007
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
00021
00022
00023
00024
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
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
00060
00061 VisSkipEventDialog::~VisSkipEventDialog()
00062 {
00063
00064 }
00065
00066
00067
00068
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