#include <keditlistbox.h>
Inherits TQGroupBox.
Classes | |
class | CustomEditor |
Public Types | |
enum | Button { Add = 1 , Remove = 2 , UpDown = 4 } |
enum | { All = Add|Remove|UpDown } |
Signals | |
void | changed () |
void | added (const TQString &text) |
void | added (int item, const TQString &text) |
void | removed (const TQString &text) |
void | removed (int item, const TQString &text) |
void | renamed (const TQString &from, const TQString &to) |
void | renamed (int item, const TQString &from, const TQString &to) |
Public Member Functions | |
KEditListBox (TQWidget *parent=0, const char *name=0, bool checkAtEntering=false, int buttons=All) | |
KEditListBox (const TQString &title, TQWidget *parent=0, const char *name=0, bool checkAtEntering=false, int buttons=All) | |
KEditListBox (const TQString &title, const CustomEditor &customEditor, TQWidget *parent=0, const char *name=0, bool checkAtEntering=false, int buttons=All) | |
TQListBox * | listBox () const |
KLineEdit * | lineEdit () const |
TQPushButton * | addButton () const |
TQPushButton * | removeButton () const |
TQPushButton * | upButton () const |
TQPushButton * | downButton () const |
int | count () const |
void | insertStringList (const TQStringList &list, int index=-1) |
void | insertStrList (const TQStrList *list, int index=-1) |
void | insertStrList (const TQStrList &list, int index=-1) |
void | insertStrList (const char **list, int numStrings=-1, int index=-1) |
void | insertItem (const TQString &text, int index=-1) |
void | clear () |
TQString | text (int index) const |
int | currentItem () const |
TQString | currentText () const |
TQStringList | items () const |
void | setItems (const TQStringList &items) |
int | buttons () const |
Button | buttonsProp () const |
void | setButtons (uint buttons) |
void | setButtonsProp (Button buttons) |
Protected Slots | |
void | moveItemUp () |
void | moveItemDown () |
void | addItem () |
void | removeItem () |
void | enableMoveButtons (int index) |
void | typedSomething (const TQString &text) |
Protected Member Functions | |
virtual void | virtual_hook (int id, void *data) |
Detailed Description
An editable listbox.
This class provides an editable listbox ;-), this means a listbox which is accompanied by a line edit to enter new items into the listbox and pushbuttons to add and remove items from the listbox and two buttons to move items up and down.
Definition at line 44 of file keditlistbox.h.
Member Enumeration Documentation
◆ Button
enum KEditListBox::Button |
Enumeration of the buttons, the listbox offers.
Specify them in the constructor in the buttons parameter, or in setButtons.
Definition at line 62 of file keditlistbox.h.
Constructor & Destructor Documentation
◆ KEditListBox() [1/3]
KEditListBox::KEditListBox | ( | TQWidget * | parent = 0 , |
const char * | name = 0 , |
||
bool | checkAtEntering = false , |
||
int | buttons = All |
||
) |
Create an editable listbox.
If checkAtEntering
is true, after every character you type in the line edit KEditListBox will enable or disable the Add-button, depending whether the current content of the line edit is already in the listbox. Maybe this can become a performance hit with large lists on slow machines. If checkAtEntering
is false, it will be checked if you press the Add-button. It is not possible to enter items twice into the listbox.
Definition at line 48 of file keditlistbox.cpp.
◆ KEditListBox() [2/3]
KEditListBox::KEditListBox | ( | const TQString & | title, |
TQWidget * | parent = 0 , |
||
const char * | name = 0 , |
||
bool | checkAtEntering = false , |
||
int | buttons = All |
||
) |
Create an editable listbox.
The same as the other constructor, additionally it takes title
, which will be the title of the frame around the listbox.
Definition at line 55 of file keditlistbox.cpp.
◆ KEditListBox() [3/3]
KEditListBox::KEditListBox | ( | const TQString & | title, |
const CustomEditor & | customEditor, | ||
TQWidget * | parent = 0 , |
||
const char * | name = 0 , |
||
bool | checkAtEntering = false , |
||
int | buttons = All |
||
) |
Another constructor, which allows to use a custom editing widget instead of the standard KLineEdit widget.
E.g. you can use a KURLRequester or a KComboBox as input widget. The custom editor must consist of a lineedit and optionally another widget that is used as representation. A KComboBox or a KURLRequester have a KLineEdit as child-widget for example, so the KComboBox is used as the representation widget.
- See also
- KURLRequester::customEditor()
- Since
- 3.1
Definition at line 62 of file keditlistbox.cpp.
Member Function Documentation
◆ addButton()
|
inline |
Return a pointer to the Add button.
Definition at line 119 of file keditlistbox.h.
◆ added [1/2]
|
signal |
This signal is emitted when the user adds a new string to the list.
- Parameters
-
text is the added string.
- Since
- 3.2
◆ added [2/2]
|
signal |
This signal is emitted when the user adds a new string to the list.
- Parameters
-
item is the added item's position in the list. text is the added string.
- Since
- R14.1.0
- See also
- added( const TQString & text )
◆ buttons()
int KEditListBox::buttons | ( | ) | const |
Returns which buttons are visible.
Definition at line 406 of file keditlistbox.cpp.
◆ clear()
void KEditListBox::clear | ( | ) |
Clears both the listbox and the line edit.
Definition at line 364 of file keditlistbox.cpp.
◆ count()
|
inline |
See TQListBox::count()
Definition at line 136 of file keditlistbox.h.
◆ currentItem()
int KEditListBox::currentItem | ( | ) | const |
See TQListBox::currentItem()
Definition at line 300 of file keditlistbox.cpp.
◆ currentText()
|
inline |
See TQListBox::currentText()
Definition at line 172 of file keditlistbox.h.
◆ downButton()
|
inline |
Return a pointer to the Down button.
Definition at line 131 of file keditlistbox.h.
◆ insertItem()
|
inline |
See TQListBox::insertItem()
Definition at line 156 of file keditlistbox.h.
◆ insertStringList()
void KEditListBox::insertStringList | ( | const TQStringList & | list, |
int | index = -1 |
||
) |
See TQListBox::insertStringList()
Definition at line 371 of file keditlistbox.cpp.
◆ insertStrList() [1/3]
void KEditListBox::insertStrList | ( | const char ** | list, |
int | numStrings = -1 , |
||
int | index = -1 |
||
) |
See TQListBox::insertStrList()
Definition at line 386 of file keditlistbox.cpp.
◆ insertStrList() [2/3]
void KEditListBox::insertStrList | ( | const TQStrList & | list, |
int | index = -1 |
||
) |
See TQListBox::insertStrList()
Definition at line 381 of file keditlistbox.cpp.
◆ insertStrList() [3/3]
void KEditListBox::insertStrList | ( | const TQStrList * | list, |
int | index = -1 |
||
) |
See TQListBox::insertStringList()
Definition at line 376 of file keditlistbox.cpp.
◆ items()
TQStringList KEditListBox::items | ( | ) | const |
- Returns
- a stringlist of all items in the listbox
Definition at line 391 of file keditlistbox.cpp.
◆ lineEdit()
|
inline |
Return a pointer to the embedded TQLineEdit.
Definition at line 115 of file keditlistbox.h.
◆ listBox()
|
inline |
Return a pointer to the embedded TQListBox.
Definition at line 111 of file keditlistbox.h.
◆ removeButton()
|
inline |
Return a pointer to the Remove button.
Definition at line 123 of file keditlistbox.h.
◆ removed [1/2]
|
signal |
This signal is emitted when the user removes a string from the list.
- Parameters
-
text is the removed string.
- Since
- 3.2
◆ removed [2/2]
|
signal |
This signal is emitted when the user removes a string from the list.
- Parameters
-
item is the removed item's position in the list. text is the removed string.
- Since
- R14.1.0
- See also
- removed( const TQString & text )
◆ renamed [1/2]
|
signal |
This signal is emitted when the user renames a list item.
- Parameters
-
from is the original item's text. to is the new text of the item.
- Since
- R14.1.0
◆ renamed [2/2]
|
signal |
This signal is emitted when the user renames a list item.
- Parameters
-
item is the renamed item's position in the list. from is the original item's text. to is the new text of the item.
- Since
- R14.1.0
◆ setButtons()
void KEditListBox::setButtons | ( | uint | buttons | ) |
Specifies which buttons should be visible.
Definition at line 117 of file keditlistbox.cpp.
◆ setItems()
void KEditListBox::setItems | ( | const TQStringList & | items | ) |
Clears the listbox and sets the contents to items
.
- Since
- 3.4
Definition at line 400 of file keditlistbox.cpp.
◆ text()
|
inline |
See TQListBox::text()
Definition at line 164 of file keditlistbox.h.
◆ upButton()
|
inline |
Return a pointer to the Up button.
Definition at line 127 of file keditlistbox.h.
The documentation for this class was generated from the following files: