24#include <tqbuttongroup.h>
25#include <tqradiobutton.h>
29#include "kspread_canvas.h"
30#include "kspread_doc.h"
31#include "kspread_sheet.h"
32#include "kspread_view.h"
35#include "kspread_dlg_special.h"
39SpecialDialog::SpecialDialog( View* parent, const char* name )
40 : KDialogBase( parent, name, true,i18n( "Special Paste"),Ok|Cancel )
43 TQWidget *page = new TQWidget( this );
45 TQVBoxLayout *lay1 = new TQVBoxLayout( page, 0, spacingHint() );
47 TQButtonGroup *grp = new TQButtonGroup( 1, TQt::Horizontal, i18n( "Paste What" ),page );
48 grp->setRadioButtonExclusive( true );
51 rb1 = new TQRadioButton( i18n( "Everything"), grp );
52 rb2 = new TQRadioButton( i18n( "Text"), grp );
53 rb3 = new TQRadioButton( i18n( "Format"), grp );
54 rb10 = new TQRadioButton( i18n( "Comment"), grp );
55 rb11 = new TQRadioButton( i18n( "Result"), grp );
57 rb4 = new TQRadioButton( i18n( "Everything without border"), grp );
58 rb1->setChecked( true);
60 grp = new TQButtonGroup( 1, TQt::Horizontal, i18n( "Operation"),page);
61 grp->setRadioButtonExclusive( true );
66 rb5 = new TQRadioButton( i18n( "Overwrite"), grp );
67 rb6 = new TQRadioButton( i18n( "Addition"), grp );
68 rb7 = new TQRadioButton( i18n( "Subtraction"), grp );
69 rb8 = new TQRadioButton( i18n( "Multiplication"), grp );
70 rb9 = new TQRadioButton( i18n( "Division"), grp );
71 rb5->setChecked( true);
77 connect( this, TQ_SIGNAL( okClicked() ), this, TQ_SLOT( slotOk() ) );
78 connect( rb3, TQ_SIGNAL( toggled( bool ) ), this, TQ_SLOT( slotToggled( bool ) ) );
79 connect( rb10, TQ_SIGNAL( toggled( bool ) ), this, TQ_SLOT( slotToggled( bool ) ) );
82void SpecialDialog::slotOk()
96 if( rb1->isChecked() )
98 else if( rb2->isChecked() )
100 else if( rb3->isChecked() )
102 else if( rb4->isChecked() )
104 else if( rb10->isChecked() )
106 else if( rb11->isChecked() )
109 if( rb5->isChecked() )
111 if( rb6->isChecked() )
113 if( rb7->isChecked() )
115 if( rb8->isChecked() )
117 if( rb9->isChecked() )
120 m_pView->doc()->emitBeginOperation( false );
121 m_pView->activeSheet()->paste( m_pView->selectionInfo()->lastRange(), true, sp, op );
122 m_pView->slotUpdateView( m_pView->activeSheet() );
126void SpecialDialog::slotToggled( bool b )
128 rb5->setEnabled( !b );
129 rb6->setEnabled( !b );
130 rb7->setEnabled( !b );
131 rb8->setEnabled( !b );
132 rb9->setEnabled( !b );
135#include "kspread_dlg_special.moc"
The View class displays a KSpread document.
Operation The current cell value treatment.
@ Result Result only, no formula.
@ NoBorder not the borders
|