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.
61 lines
1.8 KiB
61 lines
1.8 KiB
/***************************************************************************
|
|
listdlg.cpp - description
|
|
-------------------
|
|
begin : Mon Nov 26 2001
|
|
copyright : (C) 2001 by Andras Mantia <amantia@kde.org>
|
|
***************************************************************************/
|
|
|
|
/***************************************************************************
|
|
* *
|
|
* This program is free software; you can redistribute it and/or modify *
|
|
* it under the terms of the GNU General Public License as published by *
|
|
* the Free Software Foundation; version 2 of the License. *
|
|
* (at your option) any later version. *
|
|
***************************************************************************/
|
|
|
|
#include "listdlg.h"
|
|
|
|
//kde include
|
|
#include <tdelistbox.h>
|
|
#include <tdelocale.h>
|
|
|
|
//qt includes
|
|
#include <tqpushbutton.h>
|
|
#include <tqstring.h>
|
|
#include <tqstringlist.h>
|
|
|
|
ListDlg::ListDlg(TQStringList &entryList,TQWidget* parent, const char *name )
|
|
:KDialogBase(parent,name), listbox(new TDEListBox(this))
|
|
{
|
|
TQ_CHECK_PTR(listbox);
|
|
setMainWidget(listbox);
|
|
showButtonApply(false);
|
|
enableButtonSeparator(true);
|
|
|
|
listbox->clear();
|
|
listbox->insertStringList(entryList);
|
|
if(entryList.count()>0)
|
|
{
|
|
listbox->setCurrentItem(0);
|
|
}
|
|
listbox->setMinimumSize(350,150);
|
|
adjustSize();
|
|
resize(sizeHint());
|
|
|
|
connect(listbox,TQT_SIGNAL(doubleClicked( TQListBoxItem * )), TQT_SLOT(slotOk()));
|
|
}
|
|
|
|
ListDlg::~ListDlg(){
|
|
}
|
|
|
|
TQString ListDlg::getEntry()
|
|
{
|
|
return listbox->currentText();
|
|
}
|
|
|
|
int ListDlg::getEntryNum()
|
|
{
|
|
return listbox->currentItem();
|
|
}
|
|
#include "listdlg.moc"
|