20 #ifndef KEDITLISTBOX_H
21 #define KEDITLISTBOX_H
23 #include <tqgroupbox.h>
24 #include <tqlistbox.h>
26 #include <tdelibs_export.h>
32 class KEditListBoxPrivate;
50 TQ_PROPERTY(
Button buttons READ buttonsProp WRITE setButtonsProp )
51 TQ_PROPERTY( TQStringList items READ items WRITE setItems )
62 enum Button { Add = 1, Remove = 2, UpDown = 4 };
63 enum { All = Add|Remove|UpDown };
78 bool checkAtEntering=
false,
int buttons = All );
85 KEditListBox(
const TQString& title, TQWidget *parent = 0,
86 const char *name = 0,
bool checkAtEntering=
false,
102 const CustomEditor &customEditor,
103 TQWidget *parent = 0,
const char *name = 0,
104 bool checkAtEntering =
false,
int buttons = All );
111 TQListBox*
listBox()
const {
return m_listBox; }
119 TQPushButton*
addButton()
const {
return servNewButton; }
127 TQPushButton*
upButton()
const {
return servUpButton; }
136 int count()
const {
return int(m_listBox->count()); }
140 void insertStringList(
const TQStringList& list,
int index=-1);
144 void insertStrList(
const TQStrList* list,
int index=-1);
148 void insertStrList(
const TQStrList& list,
int index=-1);
152 void insertStrList(
const char ** list,
int numStrings=-1,
int index=-1);
156 void insertItem(
const TQString& text,
int index=-1) {m_listBox->insertItem(text,index);}
164 TQString
text(
int index)
const {
return m_listBox->text(index); }
168 int currentItem()
const;
177 TQStringList items()
const;
184 void setItems(
const TQStringList& items);
190 inline Button buttonsProp()
const {
return (Button)buttons(); }
195 void setButtons( uint buttons );
196 inline void setButtonsProp( Button buttons ) { setButtons((uint)buttons); }
207 void added(
const TQString & text );
216 void added(
int item,
const TQString & text );
233 void removed(
int item,
const TQString & text );
242 void renamed(
const TQString &from,
const TQString &to );
252 void renamed(
int item,
const TQString &from,
const TQString &to );
260 void enableMoveButtons(
int index);
261 void typedSomething(
const TQString& text);
264 TQListBox *m_listBox;
265 TQPushButton *servUpButton, *servDownButton;
266 TQPushButton *servNewButton, *servRemoveButton;
270 void init(
bool checkAtEntering,
int buttons,
271 TQWidget *representationWidget = 0L );
274 virtual void virtual_hook(
int id,
void* data );
277 KEditListBoxPrivate*
const d;
290 : m_representationWidget( 0L ),
293 : m_representationWidget( repWidget ),
294 m_lineEdit( edit ) {}
297 TDEUI_EXPORT
void setRepresentationWidget( TQWidget *repWidget ) {
298 m_representationWidget = repWidget;
300 TDEUI_EXPORT
void setLineEdit(
KLineEdit *edit ) {
304 TDEUI_EXPORT
virtual TQWidget *representationWidget()
const {
305 return m_representationWidget;
307 TDEUI_EXPORT
virtual KLineEdit *lineEdit()
const {
312 TQWidget *m_representationWidget;
void insertItem(const TQString &text, int index=-1)
See TQListBox::insertItem()
void removed(int item, const TQString &text)
This signal is emitted when the user removes a string from the list.
int count() const
See TQListBox::count()
TQString currentText() const
See TQListBox::currentText()
void renamed(int item, const TQString &from, const TQString &to)
This signal is emitted when the user renames a list item.
void renamed(const TQString &from, const TQString &to)
This signal is emitted when the user renames a list item.
Button
Enumeration of the buttons, the listbox offers.
TQPushButton * addButton() const
Return a pointer to the Add button.
void removed(const TQString &text)
This signal is emitted when the user removes a string from the list.
TQPushButton * downButton() const
Return a pointer to the Down button.
void added(const TQString &text)
This signal is emitted when the user adds a new string to the list.
TQListBox * listBox() const
Return a pointer to the embedded TQListBox.
TQPushButton * upButton() const
Return a pointer to the Up button.
KLineEdit * lineEdit() const
Return a pointer to the embedded TQLineEdit.
TQString text(int index) const
See TQListBox::text()
void added(int item, const TQString &text)
This signal is emitted when the user adds a new string to the list.
TQPushButton * removeButton() const
Return a pointer to the Remove button.
An enhanced TQLineEdit widget for inputting text.