Back to index

scribus-ng  1.3.4.dfsg+svn20071115
mdup.cpp
Go to the documentation of this file.
00001 /*
00002 For general Scribus (>=1.3.2) copyright and licensing information please refer
00003 to the COPYING file provided with the program. Following this notice may exist
00004 a copyright and/or license notice that predates the release of Scribus 1.3.2
00005 for which a new license (GPL+exception) is in place.
00006 */
00007 #include "mdup.h"
00008 #include "mdup.moc"
00009 
00010 #include <qlabel.h>
00011 #include <qlineedit.h>
00012 #include <qpushbutton.h>
00013 #include <qlayout.h>
00014 #include <qvariant.h>
00015 #include <qtooltip.h>
00016 #include "units.h"
00017 #include "commonstrings.h"
00018 
00019 extern QPixmap loadIcon(QString nam);
00020 
00021 Mdup::Mdup( QWidget* parent, double Dx, double Dy, int Ein )
00022               : QDialog( parent, "m", true, 0 )
00023 {
00024        setCaption( tr( "Multiple Duplicate" ) );
00025        setIcon(loadIcon("AppIcon.png"));
00026        MdupLayout = new QVBoxLayout( this );
00027        MdupLayout->setSpacing( 5 );
00028        MdupLayout->setMargin( 10 );
00029        Layout4 = new QGridLayout;
00030        Layout4->setSpacing( 6 );
00031        Layout4->setMargin( 0 );
00032        Ncopies = new QSpinBox( this, "Ncopies" );
00033        Ncopies->setMaxValue( 100 );
00034        Ncopies->setMinValue( 1 );
00035        Ncopies->setValue(1);
00036        Layout4->addWidget( Ncopies, 0, 1 );
00037        ShiftH = new MSpinBox( -1000, 1000, this, 2 );
00038        ShiftH->setValue(Dx);
00039        Layout4->addWidget( ShiftH, 1, 1 );
00040        ShiftV = new MSpinBox( -1000, 1000, this, 2 );
00041        ShiftV->setValue(Dy);
00042        Layout4->addWidget( ShiftV, 2, 1 );
00043        QString Suffix = unitGetSuffixFromIndex(Ein);
00044        ShiftH->setSuffix(Suffix);
00045        ShiftV->setSuffix(Suffix);
00046        TextLabel1 = new QLabel( Ncopies, tr( "&Number of Copies:" ), this, "TextLabel1" );
00047        Layout4->addWidget( TextLabel1, 0, 0 );
00048        TextLabel1_2 = new QLabel( ShiftH, tr( "&Horizontal Shift:" ), this, "TextLabel1_2" );
00049        Layout4->addWidget( TextLabel1_2, 1, 0 );
00050        TextLabel1_2_2 = new QLabel( ShiftV, tr( "&Vertical Shift:" ), this, "TextLabel1_2_2" );
00051        Layout4->addWidget( TextLabel1_2_2, 2, 0 );
00052        MdupLayout->addLayout( Layout4 );
00053        Layout3 = new QHBoxLayout;
00054        Layout3->setSpacing( 6 );
00055        Layout3->setMargin( 0 );
00056        QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
00057        Layout3->addItem( spacer );
00058        PushButton12 = new QPushButton( CommonStrings::tr_OK, this, "PushButton12" );
00059        PushButton12->setDefault( true );
00060        Layout3->addWidget( PushButton12 );
00061        PushButton13 = new QPushButton( CommonStrings::tr_Cancel, this, "PushButton13" );
00062        Layout3->addWidget( PushButton13 );
00063        MdupLayout->addLayout( Layout3 );
00064        QWidget::setTabOrder ( Ncopies, ShiftH );
00065        QWidget::setTabOrder ( ShiftH, ShiftV );
00066        QWidget::setTabOrder ( ShiftV, PushButton12 );
00067        QWidget::setTabOrder ( PushButton12, PushButton13 );
00068        QWidget::setTabOrder ( PushButton13, Ncopies );
00069        Ncopies->setFocus();
00070        setMaximumSize(sizeHint());
00071 
00072        // signals and slots connections
00073        connect( PushButton12, SIGNAL( clicked() ), this, SLOT( accept() ) );
00074        connect( PushButton13, SIGNAL( clicked() ), this, SLOT( reject() ) );
00075 }
00076 
00077