kspread Library API Documentation

kspread_dlg_pasteinsert.cc

00001 /* This file is part of the KDE project
00002    Copyright (C) 2003 Norbert Andres <nandres@web.de>
00003              (C) 2002 Philipp Mueller <philipp.mueller@gmx.de>
00004              (C) 2002 John Dailey <dailey@vt.edu>
00005              (C) 2000-2002 Laurent Montel <montel@kde.org>
00006    
00007    This library is free software; you can redistribute it and/or
00008    modify it under the terms of the GNU Library General Public
00009    License as published by the Free Software Foundation; either
00010    version 2 of the License, or (at your option) any later version.
00011 
00012    This library is distributed in the hope that it will be useful,
00013    but WITHOUT ANY WARRANTY; without even the implied warranty of
00014    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015    Library General Public License for more details.
00016 
00017    You should have received a copy of the GNU Library General Public License
00018    along with this library; see the file COPYING.LIB.  If not, write to
00019    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00020    Boston, MA 02111-1307, USA.
00021 */
00022 
00023 
00024 #include "kspread_dlg_pasteinsert.h"
00025 #include "kspread_canvas.h"
00026 #include "kspread_doc.h"
00027 #include "kspread_sheet.h"
00028 #include "kspread_view.h"
00029 
00030 #include <qlayout.h>
00031 #include <klocale.h>
00032 #include <kbuttonbox.h>
00033 #include <qbuttongroup.h>
00034 #include <kdebug.h>
00035 #include <qradiobutton.h>
00036 #include <qcheckbox.h>
00037 
00038 KSpreadpasteinsert::KSpreadpasteinsert( KSpreadView* parent, const char* name,const QRect &_rect)
00039     : KDialogBase( parent, name, TRUE,i18n("Paste Inserting Cells"),Ok|Cancel )
00040 {
00041   m_pView = parent;
00042   rect=_rect;
00043 
00044   QWidget *page = new QWidget( this );
00045   setMainWidget(page);
00046   QVBoxLayout *lay1 = new QVBoxLayout( page, 0, spacingHint() );
00047 
00048   QButtonGroup *grp = new QButtonGroup( 1, QGroupBox::Horizontal, i18n("Insert"),page);
00049   grp->setRadioButtonExclusive( TRUE );
00050   grp->layout();
00051   lay1->addWidget(grp);
00052   rb1 = new QRadioButton( i18n("Move towards right"), grp );
00053   rb2 = new QRadioButton( i18n("Move towards bottom"), grp );
00054   rb1->setChecked(true);
00055 
00056   connect( this, SIGNAL( okClicked() ), this, SLOT( slotOk() ) );
00057 }
00058 
00059 void KSpreadpasteinsert::slotOk()
00060 {
00061     m_pView->doc()->emitBeginOperation( false );
00062     if( rb1->isChecked() )
00063         m_pView->activeSheet()->paste( m_pView->selection() ,
00064                                        true, Normal,OverWrite,true,-1);
00065     else if( rb2->isChecked() )
00066         m_pView->activeSheet()->paste( m_pView->selection() ,
00067                                        true, Normal,OverWrite,true,+1);
00068 
00069     m_pView->slotUpdateView( m_pView->activeSheet() );
00070     accept();
00071 }
00072 
00073 #include "kspread_dlg_pasteinsert.moc"
KDE Logo
This file is part of the documentation for kspread Library Version 1.4.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Mon Feb 13 09:43:02 2006 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003