You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
84 lines
2.2 KiB
84 lines
2.2 KiB
15 years ago
|
// This must be first
|
||
|
#ifdef HAVE_CONFIG_H
|
||
|
#include <config.h>
|
||
|
#endif
|
||
|
|
||
|
#include "klistboxdialog.h"
|
||
|
|
||
15 years ago
|
#include <tqlabel.h>
|
||
13 years ago
|
#include <tqlayout.h>
|
||
15 years ago
|
|
||
12 years ago
|
TDEListBoxDialog::TDEListBoxDialog( TQString& _selectedString,
|
||
15 years ago
|
const TQString& caption,
|
||
|
const TQString& labelText,
|
||
13 years ago
|
TQWidget* parent,
|
||
15 years ago
|
const char* name,
|
||
|
bool modal )
|
||
13 years ago
|
: KDialogBase( parent, name, modal, caption, Ok|Cancel, Ok, true ),
|
||
15 years ago
|
selectedString( _selectedString )
|
||
|
|
||
|
{
|
||
|
if ( !name )
|
||
12 years ago
|
setName( "TDEListBoxDialog" );
|
||
15 years ago
|
resize( 400, 180 );
|
||
|
|
||
15 years ago
|
TQFrame *page = makeMainWidget();
|
||
|
TQVBoxLayout *topLayout = new TQVBoxLayout( page, 0, spacingHint() );
|
||
|
labelAboveLA = new TQLabel( page, "labelAboveLA" );
|
||
15 years ago
|
labelAboveLA->setText( labelText );
|
||
|
|
||
|
topLayout->addWidget( labelAboveLA );
|
||
|
|
||
15 years ago
|
entriesLB = new TQListBox( page, "entriesLB" );
|
||
15 years ago
|
|
||
|
topLayout->addWidget( entriesLB );
|
||
|
|
||
15 years ago
|
commentBelowLA = new TQLabel( page, "commentBelowLA" );
|
||
15 years ago
|
commentBelowLA->setText( "" );
|
||
|
topLayout->addWidget( commentBelowLA );
|
||
|
commentBelowLA->hide();
|
||
|
|
||
|
// signals and slots connections
|
||
15 years ago
|
connect( entriesLB, TQT_SIGNAL( highlighted( const TQString& ) ),
|
||
|
this, TQT_SLOT( highlighted( const TQString& ) ) );
|
||
|
connect( entriesLB, TQT_SIGNAL( selected(int) ),
|
||
|
TQT_SLOT( slotOk() ) );
|
||
15 years ago
|
// buddies
|
||
|
labelAboveLA->setBuddy( entriesLB );
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
* Destroys the object and frees any allocated resources
|
||
|
*/
|
||
12 years ago
|
TDEListBoxDialog::~TDEListBoxDialog()
|
||
15 years ago
|
{
|
||
14 years ago
|
// no need to delete child widgets, TQt does it all for us
|
||
15 years ago
|
}
|
||
|
|
||
12 years ago
|
void TDEListBoxDialog::setLabelAbove(const TQString& label)
|
||
15 years ago
|
{
|
||
|
labelAboveLA->setText( label );
|
||
|
if( label.isEmpty() )
|
||
|
labelAboveLA->hide();
|
||
|
else
|
||
|
labelAboveLA->show();
|
||
|
}
|
||
|
|
||
12 years ago
|
void TDEListBoxDialog::setCommentBelow(const TQString& comment)
|
||
15 years ago
|
{
|
||
|
commentBelowLA->setText( comment );
|
||
|
if( comment.isEmpty() )
|
||
|
commentBelowLA->hide();
|
||
|
else
|
||
|
commentBelowLA->show();
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
12 years ago
|
void TDEListBoxDialog::highlighted( const TQString& txt )
|
||
15 years ago
|
{
|
||
|
selectedString = txt;
|
||
|
}
|
||
|
|
||
|
#include "klistboxdialog.moc"
|