24#include <tqmultilineedit.h>
25#include <tqpushbutton.h>
29#include <kbuttonbox.h>
31#include "kspread_canvas.h"
32#include "kspread_doc.h"
34#include "kspread_sheet.h"
35#include "kspread_view.h"
37#include "kspread_dlg_comment.h"
41CommentDialog::CommentDialog( View* parent, const char* name, const TQPoint &_marker)
42 : KDialogBase( parent, name,true,i18n( "Cell Comment"),Ok|Cancel )
46 TQWidget *page = new TQWidget( this );
48 TQVBoxLayout *lay1 = new TQVBoxLayout( page, 0, spacingHint() );
50 multiLine = new TQMultiLineEdit( page );
51 lay1->addWidget(multiLine);
53 multiLine->setFocus();
56 Cell *cell = m_pView->activeSheet()->cellAt( m_pView->canvasWidget()->markerColumn(), m_pView->canvasWidget()->markerRow() );
57 if(!cell-> format()->comment(marker.x(),marker.y()).isEmpty())
58 multiLine->setText(cell-> format()->comment(marker.x(),marker.y()));
60 connect( this, TQ_SIGNAL( okClicked() ), this, TQ_SLOT( slotOk() ) );
61 connect(multiLine, TQ_SIGNAL(textChanged ()), this, TQ_SLOT(slotTextChanged()));
65 resize( 400, height() );
68void CommentDialog::slotTextChanged()
70 enableButtonOK( !multiLine->text().isEmpty());
73void CommentDialog::slotOk()
75 m_pView->doc()->emitBeginOperation( false );
76 m_pView->activeSheet()->setSelectionComment( m_pView->selectionInfo(),
77 multiLine->text().stripWhiteSpace() );
78 m_pView->slotUpdateView( m_pView->activeSheet(), *m_pView->selectionInfo() );
83#include "kspread_dlg_comment.moc"
For every cell in the spread sheet there is a Cell object.
Format * format() const Returns the format object of this cell.
The View class displays a KSpread document.
|