28#include "kspread_doc.h"
29#include "kspread_sheet.h"
30#include "kspread_util.h"
31#include "kspread_view.h"
34#include "kspread_dlg_showColRow.h"
38ShowColRow::ShowColRow(
View* parent,
const char* name, Type _type )
39 : KDialogBase( parent, name,true,
"",Ok|Cancel )
44 TQWidget *page =
new TQWidget(
this );
46 TQVBoxLayout *lay1 =
new TQVBoxLayout( page, 0, spacingHint() );
48 TQLabel *label =
new TQLabel( page );
51 setCaption( i18n(
"Show Columns") );
52 label->setText(i18n(
"Select hidden columns to show:"));
55 setCaption( i18n(
"Show Rows") );
56 label->setText(i18n(
"Select hidden rows to show:"));
59 list=
new TQListBox(page);
61 lay1->addWidget( label );
62 lay1->addWidget( list );
64 bool showColNumber=m_pView->activeSheet()->getShowColumnNumber();
67 ColumnFormat *col=m_pView->activeSheet()->firstCol();
71 for( ; col; col = col->next() )
74 listInt.append(col->column());
77 TQValueList<int>::Iterator it;
78 for( it = listInt.begin(); it != listInt.end(); ++it )
83 listCol+=i18n(
"Column: %1").arg(text.setNum(*it));
85 list->insertStringList(listCol);
89 RowFormat *row=m_pView->activeSheet()->firstRow();
93 for( ; row; row = row->next() )
96 listInt.append(row->row());
99 TQValueList<int>::Iterator it;
100 for( it = listInt.begin(); it != listInt.end(); ++it )
101 listRow+=i18n(
"Row: %1").arg(text.setNum(*it));
103 list->insertStringList(listRow);
107 enableButtonOK(
false);
110 list->setSelectionMode(TQListBox::Multi);
111 connect(
this, TQ_SIGNAL( okClicked() ),
this, TQ_SLOT( slotOk() ) );
112 connect( list, TQ_SIGNAL(doubleClicked(TQListBoxItem *)),
this,TQ_SLOT(slotDoubleClicked(TQListBoxItem *)));
117void ShowColRow::slotDoubleClicked(TQListBoxItem *)
122void ShowColRow::slotOk()
125 for(
unsigned int i=0; i < list->count(); i++)
127 if (list->isSelected(i))
129 if (typeShow == Column)
131 region.
add(TQRect(*listInt.at(i), 1, 1, KS_rowMax));
135 region.
add(TQRect(1, *listInt.at(i), KS_colMax, 1));
140 if (typeShow == Column)
142 m_pView->activeSheet()->showColumn(region);
146 m_pView->activeSheet()->showRow(region);
152#include "kspread_dlg_showColRow.moc"
TQString columnName() const
Returns the column name of the cell.
The one for all class for points and ranges.
Element * add(const TQPoint &point, Sheet *sheet=0)
Adds the point point to this region.
The View class displays a KSpread document.