Back to index

scribus-ng  1.3.4.dfsg+svn20071115
insertTable.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 "insertTable.h"
00008 #include "insertTable.moc"
00009 
00010 #include "commonstrings.h"
00011 
00012 extern QPixmap loadIcon(QString nam);
00013 
00014 InsertTable::InsertTable( QWidget* parent, int maxRow, int maxCol )
00015               : QDialog( parent, "InsertTable", true, 0 )
00016 
00017 {
00018        setCaption( tr( "Insert Table" ) );
00019        setIcon(loadIcon("AppIcon.png"));
00020 
00021        InsertTableLayout = new QVBoxLayout( this, 11, 8, "InsertTableLayout");
00022        layout2 = new QGridLayout( 0, 1, 1, 0, 6, "layout2");
00023        Cols = new QSpinBox( 1, maxCol, 1, this, "Cols" );
00024        layout2->addWidget( Cols, 1, 1 );
00025        Text1 = new QLabel( tr( "Number of rows:" ), this, "Text1" );
00026        Text2 = new QLabel( tr( "Number of columns:" ), this, "Text2" );
00027        layout2->addWidget( Text1, 0, 0 );
00028        layout2->addWidget( Text2, 1, 0 );
00029        Rows = new QSpinBox( 1, maxRow, 1, this, "Rows" );
00030        layout2->addWidget( Rows, 0, 1 );
00031        InsertTableLayout->addLayout( layout2 );
00032        layout1 = new QHBoxLayout( 0, 0, 6, "layout1");
00033        okButton = new QPushButton( CommonStrings::tr_OK, this, "okButton" );
00034        cancelButton = new QPushButton( CommonStrings::tr_Cancel, this, "cancelButton" );
00035        okButton->setDefault( true );
00036        layout1->addWidget( okButton );
00037        layout1->addWidget( cancelButton );
00038        InsertTableLayout->addLayout( layout1 );
00039        resize( QSize(200, 111).expandedTo(minimumSizeHint()) );
00040 
00041        setTabOrder ( Rows, Cols );
00042        setTabOrder ( Cols, okButton );
00043        setTabOrder ( okButton, cancelButton);
00044        setTabOrder ( cancelButton, Rows );
00045        Rows->setFocus();
00046        // signals and slots connections
00047        connect( okButton, SIGNAL( clicked() ), this, SLOT( accept() ) );
00048        connect( cancelButton, SIGNAL( clicked() ), this, SLOT( reject() ) );
00049 }
00050