kspread
kspread_dlg_pasteinsert.cc00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #include <qlayout.h>
00024 #include <klocale.h>
00025 #include <kbuttonbox.h>
00026 #include <qbuttongroup.h>
00027 #include <kdebug.h>
00028 #include <qradiobutton.h>
00029 #include <qcheckbox.h>
00030
00031 #include "kspread_dlg_pasteinsert.h"
00032 #include "kspread_canvas.h"
00033 #include "kspread_doc.h"
00034 #include "kspread_sheet.h"
00035 #include "kspread_view.h"
00036 #include "selection.h"
00037
00038 using namespace KSpread;
00039
00040 PasteInsertDialog::PasteInsertDialog( View* parent, const char* name,const QRect &_rect)
00041 : KDialogBase( parent, name, TRUE,i18n("Paste Inserting Cells"),Ok|Cancel )
00042 {
00043 m_pView = parent;
00044 rect=_rect;
00045
00046 QWidget *page = new QWidget( this );
00047 setMainWidget(page);
00048 QVBoxLayout *lay1 = new QVBoxLayout( page, 0, spacingHint() );
00049
00050 QButtonGroup *grp = new QButtonGroup( 1, QGroupBox::Horizontal, i18n("Insert"),page);
00051 grp->setRadioButtonExclusive( TRUE );
00052 grp->layout();
00053 lay1->addWidget(grp);
00054 rb1 = new QRadioButton( i18n("Move towards right"), grp );
00055 rb2 = new QRadioButton( i18n("Move towards bottom"), grp );
00056 rb1->setChecked(true);
00057
00058 connect( this, SIGNAL( okClicked() ), this, SLOT( slotOk() ) );
00059 }
00060
00061 void PasteInsertDialog::slotOk()
00062 {
00063 m_pView->doc()->emitBeginOperation( false );
00064 if( rb1->isChecked() )
00065 m_pView->activeSheet()->paste( m_pView->selectionInfo()->lastRange(),
00066 true, Paste::Normal, Paste::OverWrite,
00067 true, -1 );
00068 else if( rb2->isChecked() )
00069 m_pView->activeSheet()->paste( m_pView->selectionInfo()->lastRange(),
00070 true, Paste::Normal, Paste::OverWrite,
00071 true, +1 );
00072
00073 m_pView->slotUpdateView( m_pView->activeSheet() );
00074 accept();
00075 }
00076
00077 #include "kspread_dlg_pasteinsert.moc"
|