summaryrefslogtreecommitdiffstats
path: root/amarok/src/hintlineedit.cpp
blob: a934218c65ac5a7bc5d3452f6e2386143c1d98a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#include <hintlineedit.h>
#include <tqvbox.h>
#include <tqlabel.h>
#include <tqfont.h>

HintLineEdit::HintLineEdit( const TQString &hint, const TQString &text, TQWidget *parent, const char *name )
   : KLineEdit( text, 0, name )
   , m_vbox( new TQVBox( parent ) )
{
    init();
    m_hint->setText( hint );
}

HintLineEdit::HintLineEdit( const TQString &text, TQWidget *parent, const char *name )
   : KLineEdit( text, 0, name )
   , m_vbox( new TQVBox( parent ) )
{
    init();
}

HintLineEdit::HintLineEdit( TQWidget *parent, const char *name )
   : KLineEdit( 0, name )
   , m_vbox( new TQVBox( parent ) )
{
    init();
}

void
HintLineEdit::init()
{
    reparent( m_vbox, 0, TQPoint(0,0), true );
    m_hint = new TQLabel( m_vbox );
    //m_hint->setBuddy( this );
    m_hint->setFocusPolicy( TQ_NoFocus );
    TQFont font;
    font.setPointSize( font.pointSize() - 2);
    m_hint->setFont( font );
}

HintLineEdit::~HintLineEdit()
{
    reparent( 0, 0, TQPoint(0,0), false );
    delete m_vbox;
}

void
HintLineEdit::setHint( const TQString &hint )
{
    m_hint->setText( hint );
}

TQObject *
HintLineEdit::parent()
{
    return m_vbox->parent();
}

#include "hintlineedit.moc"