• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeprint
 

tdeprint

  • tdeprint
  • management
kmpropcontainer.cpp
1 /*
2  * This file is part of the KDE libraries
3  * Copyright (c) 2001 Michael Goffioul <tdeprint@swing.be>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License version 2 as published by the Free Software Foundation.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public License
15  * along with this library; see the file COPYING.LIB. If not, write to
16  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  * Boston, MA 02110-1301, USA.
18  **/
19 
20 #include "kmpropcontainer.h"
21 #include "kmpropwidget.h"
22 
23 #include <kpushbutton.h>
24 #include <tqlayout.h>
25 #include <tdelocale.h>
26 #include <kseparator.h>
27 #include <kguiitem.h>
28 
29 KMPropContainer::KMPropContainer(TQWidget *parent, const char *name)
30 : TQWidget(parent,name)
31 {
32  KSeparator* sep = new KSeparator( KSeparator::HLine, this);
33  sep->setFixedHeight(5);
34 
35  m_button = new KPushButton(KGuiItem(i18n("Change..."), "edit"), this);
36  m_widget = 0;
37 
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);
42  btn_->addStretch(1);
43  btn_->addWidget(m_button);
44 }
45 
46 KMPropContainer::~KMPropContainer()
47 {
48 }
49 
50 void KMPropContainer::setWidget(KMPropWidget *w)
51 {
52  if (!m_widget)
53  {
54  m_widget = w;
55  m_widget->reparent(this,TQPoint(0,0));
56  connect(m_button,TQT_SIGNAL(clicked()),m_widget,TQT_SLOT(slotChange()));
57  connect(m_widget,TQT_SIGNAL(enable(bool)),TQT_SIGNAL(enable(bool)));
58  connect(m_widget,TQT_SIGNAL(enableChange(bool)),TQT_SLOT(slotEnableChange(bool)));
59  TQVBoxLayout *lay = dynamic_cast<TQVBoxLayout*>(layout());
60  if (lay)
61  {
62  lay->insertWidget(0,m_widget,1);
63  }
64  }
65 }
66 
67 void KMPropContainer::setPrinter(KMPrinter *p)
68 {
69  if (m_widget)
70  m_widget->setPrinterBase(p);
71 }
72 
73 void KMPropContainer::slotEnableChange(bool on)
74 {
75  m_button->setEnabled(on && (m_widget ? m_widget->canChange() : true));
76 }
77 #include "kmpropcontainer.moc"

tdeprint

Skip menu "tdeprint"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

tdeprint

Skip menu "tdeprint"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  •     tdecore
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  • tdeioslave
  •   http
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeprint by doxygen 1.8.8
This website is maintained by Timothy Pearson.