kspread

kspread_dlg_pasteinsert.cpp
1/* This file is part of the KDE project
2 Copyright (C) 2003 Norbert Andres <nandres@web.de>
3 (C) 2002 Philipp Mueller <philipp.mueller@gmx.de>
4 (C) 2002 John Dailey <dailey@vt.edu>
5 (C) 2000-2002 Laurent Montel <montel@kde.org>
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public
9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version.
11
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Library General Public License for more details.
16
17 You should have received a copy of the GNU Library General Public License
18 along with this library; see the file COPYING.LIB. If not, write to
19 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 * Boston, MA 02110-1301, USA.
21*/
22
23#include <tqlayout.h>
24#include <tdelocale.h>
25#include <kbuttonbox.h>
26#include <tqbuttongroup.h>
27#include <kdebug.h>
28#include <tqradiobutton.h>
29#include <tqcheckbox.h>
30
31#include "kspread_dlg_pasteinsert.h"
32#include "kspread_canvas.h"
33#include "kspread_doc.h"
34#include "kspread_sheet.h"
35#include "kspread_view.h"
36#include "selection.h"
37
38using namespace KSpread;
39
40PasteInsertDialog::PasteInsertDialog( View* parent, const char* name,const TQRect &_rect)
41 : KDialogBase( parent, name, true,i18n("Paste Inserting Cells"),Ok|Cancel )
42{
43 m_pView = parent;
44 rect=_rect;
45
46 TQWidget *page = new TQWidget( this );
47 setMainWidget(page);
48 TQVBoxLayout *lay1 = new TQVBoxLayout( page, 0, spacingHint() );
49
50 TQButtonGroup *grp = new TQButtonGroup( 1, TQt::Horizontal, i18n("Insert"),page);
51 grp->setRadioButtonExclusive( true );
52 grp->layout();
53 lay1->addWidget(grp);
54 rb1 = new TQRadioButton( i18n("Move towards right"), grp );
55 rb2 = new TQRadioButton( i18n("Move towards bottom"), grp );
56 rb1->setChecked(true);
57
58 connect( this, TQ_SIGNAL( okClicked() ), this, TQ_SLOT( slotOk() ) );
59}
60
61void PasteInsertDialog::slotOk()
62{
63 m_pView->doc()->emitBeginOperation( false );
64 if( rb1->isChecked() )
65 m_pView->activeSheet()->paste( m_pView->selectionInfo()->lastRange(),
67 true, -1 );
68 else if( rb2->isChecked() )
69 m_pView->activeSheet()->paste( m_pView->selectionInfo()->lastRange(),
71 true, +1 );
72
73 m_pView->slotUpdateView( m_pView->activeSheet() );
74 accept();
75}
76
77#include "kspread_dlg_pasteinsert.moc"
The View class displays a KSpread document.
@ OverWrite
Overwrite.
@ Normal
Everything.
The KSpread namespace.
Definition commands.h:39