00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #include "VisFramework/VisFrameworkBase/interface/VisEventNavigationDialog.h"
00011
00012 #include <qvariant.h>
00013 #include <qpushbutton.h>
00014 #include <qlineedit.h>
00015 #include <qbuttongroup.h>
00016 #include <qradiobutton.h>
00017 #include <qlayout.h>
00018 #include <qtooltip.h>
00019 #include <qwhatsthis.h>
00020
00021
00022
00023
00024
00025
00026
00027
00028 VisEventNavigationDialog::VisEventNavigationDialog( QWidget* parent, const char* name, bool modal, WFlags fl )
00029 : QDialog( parent, name, modal, fl )
00030 {
00031 if ( !name )
00032 setName( "VisEventNavigationDialog" );
00033 VisEventNavigationDialogLayout = new QGridLayout( this, 1, 1, 11, 6, "VisEventNavigationDialogLayout");
00034
00035 skipNumberLineEdit = new QLineEdit( this, "skipNumberLineEdit" );
00036
00037 VisEventNavigationDialogLayout->addWidget( skipNumberLineEdit, 0, 1 );
00038
00039 buttonLayout = new QVBoxLayout( 0, 0, 6, "buttonLayout");
00040
00041 okPushButton = new QPushButton( this, "okPushButton" );
00042 buttonLayout->addWidget( okPushButton );
00043
00044 closePushButton = new QPushButton( this, "closePushButton" );
00045 buttonLayout->addWidget( closePushButton );
00046
00047 VisEventNavigationDialogLayout->addLayout( buttonLayout, 0, 2 );
00048
00049 buttonGroup = new QButtonGroup( this, "buttonGroup" );
00050 buttonGroup->setExclusive( TRUE );
00051 buttonGroup->setColumnLayout(0, Qt::Vertical );
00052 buttonGroup->layout()->setSpacing( 6 );
00053 buttonGroup->layout()->setMargin( 11 );
00054 buttonGroupLayout = new QGridLayout( buttonGroup->layout() );
00055 buttonGroupLayout->setAlignment( Qt::AlignTop );
00056
00057 forwardRadioButton = new QRadioButton( buttonGroup, "forwardRadioButton" );
00058 forwardRadioButton->setChecked( TRUE );
00059
00060 buttonGroupLayout->addWidget( forwardRadioButton, 0, 0 );
00061
00062 backRadioButton = new QRadioButton( buttonGroup, "backRadioButton" );
00063
00064 buttonGroupLayout->addWidget( backRadioButton, 1, 0 );
00065
00066 VisEventNavigationDialogLayout->addWidget( buttonGroup, 0, 0 );
00067 languageChange();
00068 resize( QSize(369, 103).expandedTo(minimumSizeHint()) );
00069 clearWState( WState_Polished );
00070
00071
00072 connect( okPushButton, SIGNAL( clicked() ), this, SLOT( skip() ) );
00073 connect( closePushButton, SIGNAL( clicked() ), this, SLOT( close() ) );
00074 connect( skipNumberLineEdit, SIGNAL( returnPressed() ), this, SLOT( skip() ) );
00075 }
00076
00077
00078
00079
00080 VisEventNavigationDialog::~VisEventNavigationDialog()
00081 {
00082
00083 }
00084
00085
00086
00087
00088
00089 void VisEventNavigationDialog::languageChange()
00090 {
00091 setCaption( tr( "Event Navigation" ) );
00092 okPushButton->setText( tr( "Go" ) );
00093 QToolTip::add( okPushButton, tr( "Skip events" ) );
00094 QWhatsThis::add( okPushButton, tr( "Skip specified number of events forward." ) );
00095 closePushButton->setText( tr( "Close" ) );
00096 QToolTip::add( closePushButton, tr( "Close the dialog" ) );
00097 QWhatsThis::add( closePushButton, tr( "Close the dialog." ) );
00098 buttonGroup->setTitle( tr( "Skip" ) );
00099 forwardRadioButton->setText( tr( "Forward" ) );
00100 backRadioButton->setText( tr( "Back" ) );
00101 }
00102
00103 void VisEventNavigationDialog::skipBackwards()
00104 {
00105 qWarning( "VisEventNavigationDialog::skipBackwards(): Not implemented yet" );
00106 }
00107
00108 void VisEventNavigationDialog::skipForward()
00109 {
00110 qWarning( "VisEventNavigationDialog::skipForward(): Not implemented yet" );
00111 }
00112
00113 void VisEventNavigationDialog::skip()
00114 {
00115 accept ();
00116 }
00117