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

kate

  • kate
  • utils
dockviewbase.cpp
1/* This file is part of the KDE project
2 Copyright (C) 2002 Anders Lund <anders.lund@lund.tdcadsl.dk>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License version 2 as published by the Free Software Foundation.
7
8 This library is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 Library General Public License for more details.
12
13 You should have received a copy of the GNU Library General Public License
14 along with this library; see the file COPYING.LIB. If not, write to
15 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16 Boston, MA 02110-1301, USA.
17*/
18
19#include "dockviewbase.h"
20#include "dockviewbase.moc"
21
22#include <tqlabel.h>
23#include <tqlayout.h>
24
25//#include <kdebug.h>
26
27namespace Kate {
28
29// data storage
30class DockViewBasePrivate {
31 public:
32 TQWidget *header;
33 TQLabel *lTitle;
34 TQLabel *lPrefix;
35};
36
37}
38
39Kate::DockViewBase::DockViewBase( TQWidget* parent, const char* name )
40 : TQVBox( parent, name ),
41 d ( new Kate::DockViewBasePrivate )
42{
43 init( TQString::null, TQString::null );
44}
45
46Kate::DockViewBase::DockViewBase( const TQString &prefix, const TQString &title, TQWidget* parent, const char* name )
47 : TQVBox( parent, name ),
48 d ( new Kate::DockViewBasePrivate )
49{
50 init( prefix, title );
51}
52
53Kate::DockViewBase::~DockViewBase()
54{
55 delete d;
56}
57
58void Kate::DockViewBase::setTitlePrefix( const TQString &prefix )
59{
60 d->lPrefix->setText( prefix );
61 d->lPrefix->show();
62}
63
64TQString Kate::DockViewBase::titlePrefix() const
65{
66 return d->lPrefix->text();
67}
68
69void Kate::DockViewBase::setTitle( const TQString &title )
70{
71 d->lTitle->setText( title );
72 d->lTitle->show();
73}
74
75TQString Kate::DockViewBase::title() const
76{
77 return d->lTitle->text();
78}
79
80void Kate::DockViewBase::setTitle( const TQString &prefix, const TQString &title )
81{
82 setTitlePrefix( prefix );
83 setTitle( title );
84}
85
86void Kate::DockViewBase::init( const TQString &prefix, const TQString &title )
87{
88 setSpacing( 4 );
89 d->header = new TQWidget( this );
90 d->header->setSizePolicy( TQSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Fixed, true ) );
91 TQHBoxLayout *lo = new TQHBoxLayout( d->header );
92 lo->setSpacing( 6 );
93 lo->insertSpacing( 0, 6 );
94 d->lPrefix = new TQLabel( title, d->header );
95 lo->addWidget( d->lPrefix );
96 d->lTitle = new TQLabel( title, d->header );
97 lo->addWidget( d->lTitle );
98 lo->setStretchFactor( d->lTitle, 1 );
99 lo->insertSpacing( -1, 6 );
100 if ( prefix.isEmpty() ) d->lPrefix->hide();
101 if ( title.isEmpty() ) d->lTitle->hide();
102}
Kate::DockViewBase::titlePrefix
TQString titlePrefix() const
Definition: dockviewbase.cpp:64
Kate::DockViewBase::setTitle
void setTitle(const TQString &title)
Set the title to title.
Definition: dockviewbase.cpp:69
Kate::DockViewBase::title
TQString title() const
Definition: dockviewbase.cpp:75
Kate::DockViewBase::DockViewBase
DockViewBase(TQWidget *parent=0, const char *name=0)
Create a KateDockViewBase.
Definition: dockviewbase.cpp:39
Kate::DockViewBase::setTitlePrefix
void setTitlePrefix(const TQString &prefix)
Set the title prefix to prefix.
Definition: dockviewbase.cpp:58
Kate
Namespace collecting as much of the internal Kate classes as we can manage.
Definition: kateapp.h:32

kate

Skip menu "kate"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

kate

Skip menu "kate"
  • kate
  • libkonq
  • twin
  •   lib
Generated for kate by doxygen 1.9.4
This website is maintained by Timothy Pearson.