20 #include "kmpropcontainer.h"
21 #include "kmpropwidget.h"
23 #include <kpushbutton.h>
25 #include <tdelocale.h>
26 #include <kseparator.h>
29 KMPropContainer::KMPropContainer(TQWidget *parent,
const char *name)
30 : TQWidget(parent,name)
32 KSeparator* sep =
new KSeparator( KSeparator::HLine,
this);
33 sep->setFixedHeight(5);
35 m_button =
new KPushButton(KGuiItem(i18n(
"Change..."),
"edit"),
this);
38 TQVBoxLayout *main_ =
new TQVBoxLayout(
this, 0, 10);
39 TQHBoxLayout *btn_ =
new TQHBoxLayout(0, 0, 0);
40 main_->addWidget(sep,0);
41 main_->addLayout(btn_,0);
43 btn_->addWidget(m_button);
46 KMPropContainer::~KMPropContainer()
50 void KMPropContainer::setWidget(KMPropWidget *w)
55 m_widget->reparent(
this,TQPoint(0,0));
56 connect(m_button,TQ_SIGNAL(clicked()),m_widget,TQ_SLOT(slotChange()));
57 connect(m_widget,TQ_SIGNAL(enable(
bool)),TQ_SIGNAL(enable(
bool)));
58 connect(m_widget,TQ_SIGNAL(enableChange(
bool)),TQ_SLOT(slotEnableChange(
bool)));
59 TQVBoxLayout *lay =
dynamic_cast<TQVBoxLayout*
>(layout());
62 lay->insertWidget(0,m_widget,1);
67 void KMPropContainer::setPrinter(KMPrinter *p)
70 m_widget->setPrinterBase(p);
73 void KMPropContainer::slotEnableChange(
bool on)
75 m_button->setEnabled(on && (m_widget ? m_widget->canChange() :
true));
77 #include "kmpropcontainer.moc"