20 #include "kmwinfobase.h"
23 #include <tqlineedit.h>
26 KMWInfoBase::KMWInfoBase(
int n, TQWidget *parent,
const char *name)
27 : KMWizardPage(parent,name)
29 m_labels.setAutoDelete(
false);
30 m_edits.setAutoDelete(
false);
33 TQGridLayout *lay1 =
new TQGridLayout(
this, m_nlines+3, 2, 0, 10);
34 lay1->addRowSpacing(1,10);
35 lay1->setRowStretch(m_nlines+2,1);
36 lay1->setColStretch(1,1);
38 m_info =
new TQLabel(
this);
39 m_info->setTextFormat(TQt::RichText);
40 lay1->addMultiCellWidget(m_info,0,0,0,1);
42 for (
int i=0;i<m_nlines;i++)
44 m_labels.append(
new TQLabel(
this));
45 m_edits.append(
new TQLineEdit(
this));
46 lay1->addWidget(m_labels.last(),i+2,0);
47 lay1->addWidget(m_edits.last(),i+2,1);
51 void KMWInfoBase::setInfo(
const TQString& s)
56 void KMWInfoBase::setLabel(
int i,
const TQString& s)
58 if (i >= 0 && i < m_nlines)
59 m_labels.at(i)->setText(s);
62 void KMWInfoBase::setText(
int i,
const TQString& s)
64 if (i >= 0 && i < m_nlines)
65 m_edits.at(i)->setText(s);
68 TQString KMWInfoBase::text(
int i)
70 if (i >= 0 && i < m_nlines)
71 return m_edits.at(i)->text();
72 return TQString::null;
75 void KMWInfoBase::setCurrent(
int i)
77 if (i >= 0 && i < m_nlines)
79 m_edits.at(i)->selectAll();
80 m_edits.at(i)->setFocus();
84 TQLineEdit* KMWInfoBase::lineEdit(
int i )
86 if ( i >= 0 && i < m_nlines )
87 return m_edits.at( i );