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

tdeprint

  • tdeprint
  • management
kmwinfobase.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 "kmwinfobase.h"
21 
22 #include <tqlabel.h>
23 #include <tqlineedit.h>
24 #include <tqlayout.h>
25 
26 KMWInfoBase::KMWInfoBase(int n, TQWidget *parent, const char *name)
27 : KMWizardPage(parent,name)
28 {
29  m_labels.setAutoDelete(false);
30  m_edits.setAutoDelete(false);
31 
32  m_nlines = n;
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);
37 
38  m_info = new TQLabel(this);
39  m_info->setTextFormat(TQt::RichText);
40  lay1->addMultiCellWidget(m_info,0,0,0,1);
41 
42  for (int i=0;i<m_nlines;i++)
43  {
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);
48  }
49 }
50 
51 void KMWInfoBase::setInfo(const TQString& s)
52 {
53  m_info->setText(s);
54 }
55 
56 void KMWInfoBase::setLabel(int i, const TQString& s)
57 {
58  if (i >= 0 && i < m_nlines)
59  m_labels.at(i)->setText(s);
60 }
61 
62 void KMWInfoBase::setText(int i, const TQString& s)
63 {
64  if (i >= 0 && i < m_nlines)
65  m_edits.at(i)->setText(s);
66 }
67 
68 TQString KMWInfoBase::text(int i)
69 {
70  if (i >= 0 && i < m_nlines)
71  return m_edits.at(i)->text();
72  return TQString::null;
73 }
74 
75 void KMWInfoBase::setCurrent(int i)
76 {
77  if (i >= 0 && i < m_nlines)
78  {
79  m_edits.at(i)->selectAll();
80  m_edits.at(i)->setFocus();
81  }
82 }
83 
84 TQLineEdit* KMWInfoBase::lineEdit( int i )
85 {
86  if ( i >= 0 && i < m_nlines )
87  return m_edits.at( i );
88  else
89  return NULL;
90 }

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
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeprint by doxygen 1.9.1
This website is maintained by Timothy Pearson.