• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeui
 

tdeui

Public Types | Public Slots | Signals | Public Member Functions | Protected Member Functions | List of all members
TDEActionSelector Class Reference

#include <tdeactionselector.h>

Inherits TQWidget.

Public Types

enum  MoveButton { ButtonAdd , ButtonRemove , ButtonUp , ButtonDown }
 
enum  ButtonIconSize {
  SmallIcon , Small , Medium , Large ,
  XLarge
}
 
enum  InsertionPolicy { BelowCurrent , Sorted , AtTop , AtBottom }
 

Public Slots

void polish ()
 

Signals

void added (TQListBoxItem *item)
 
void removed (TQListBoxItem *item)
 
void movedUp (TQListBoxItem *item)
 
void movedDown (TQListBoxItem *item)
 

Public Member Functions

 TDEActionSelector (TQWidget *parent=0, const char *name=0)
 
TQListBox * availableListBox () const
 
TQListBox * selectedListBox () const
 
bool moveOnDoubleClick () const
 
void setMoveOnDoubleClick (bool enable)
 
bool keyboardEnabled () const
 
void setKeyboardEnabled (bool enable)
 
TQString availableLabel () const
 
void setAvailableLabel (const TQString &text)
 
TQString selectedLabel () const
 
void setSelectedLabel (const TQString &text)
 
ButtonIconSize buttonIconSize () const
 
void setButtonIconSize (ButtonIconSize size)
 
InsertionPolicy availableInsertionPolicy () const
 
void setAvailableInsertionPolicy (InsertionPolicy policy)
 
InsertionPolicy selectedInsertionPolicy () const
 
void setSelectedInsertionPolicy (InsertionPolicy policy)
 
bool showUpDownButtons () const
 
void setShowUpDownButtons (bool show)
 
void setButtonIcon (const TQString &icon, MoveButton button)
 
void setButtonIconSet (const TQIconSet &iconset, MoveButton button)
 
void setButtonTooltip (const TQString &tip, MoveButton button)
 
void setButtonWhatsThis (const TQString &text, MoveButton button)
 
void setButtonsEnabled ()
 

Protected Member Functions

void keyPressEvent (TQKeyEvent *)
 
bool eventFilter (TQObject *, TQEvent *)
 

Detailed Description

A widget for selecting and arranging actions/objects.

This widget allows the user to select from a set of objects and arrange the order of the selected ones using two list boxes labeled "Available" and "Used" with horizontal arrows in between to move selected objects between the two, and vertical arrows on the right to arrange the order of the selected objects.

The widget moves objects to the other listbox when doubleclicked if the property moveOnDoubleClick is set to true (default). See moveOnDoubleClick() and setMoveOnDoubleClick().

The user control the widget using the keyboard if enabled (default), see keyboardEnabled.

Note that this may conflist with keyboard selection in the selected list box, if you set that to anything else than TQListBox::Single (which is the default).

To use it, simply construct an instance and then add items to the two listboxes, available through lbAvailable() and lbSelected(). Whenever you want, you can retrieve the selected options using TQListBox methods on lbSelected().

This way, you can use your own TQListBoxItem class, allowing you to easily store object data in those.

When an item is moved to a listbox, it is placed below the current item of that listbox.

Standard arrow icons are used, but you can use icons of your own choice if desired, see setButtonIcon(). It is also possible to set tooltips and whatsthis help for the buttons. See setButtonTooltip() and setButtonWhatsThis().

To set whatsthis or tooltips for the listboxes, access them through availableListbox() and selectedListBox().

All the moving buttons are automatically set enabled as expected.

Signals are sent each time an item is moved, allowing you to follow the users actions if you need to. See addedToSelection(), removedFromSelection(), movedUp() and movedDown()

Author
Anders Lund ander.nosp@m.s@al.nosp@m.web.d.nosp@m.k

Definition at line 79 of file tdeactionselector.h.

Member Enumeration Documentation

◆ ButtonIconSize

enum TDEActionSelector::ButtonIconSize

This enum identifies the icon sizes, used for the move buttons.

The values correspond to the following pixel sizes:

  • SmallIcon - the return value of IconSize( TDEIcon::Small ), the user defined size of a small icon in KDE. This is the default setting.
  • Small - 16px
  • Medium - 22px
  • Large - 32px
  • XLarge - 48px

Definition at line 125 of file tdeactionselector.h.

◆ InsertionPolicy

enum TDEActionSelector::InsertionPolicy

This enum defines policies for where to insert moved items in a listbox.

The following policies are currently defined:

  • BelowCurrent - The item is inserted below the listbox' currentItem() or at the end if there is no curent item.
  • Sorted - The listbox is sort()ed after one or more items are inserted.
  • AtTop - The item is inserted at index 0 in the listbox.
  • AtBottom - The item is inserted at the end of the listbox.
See also
availableInsertionPolicy(), setAvailableInsertionPolicy(), selectedInsertionPolicy(), setSelectedInsertionPolicy().

Definition at line 145 of file tdeactionselector.h.

◆ MoveButton

enum TDEActionSelector::MoveButton

This enum indentifies the moving buttons.

Definition at line 108 of file tdeactionselector.h.

Constructor & Destructor Documentation

◆ TDEActionSelector()

TDEActionSelector::TDEActionSelector ( TQWidget *  parent = 0,
const char *  name = 0 
)

Definition at line 48 of file tdeactionselector.cpp.

◆ ~TDEActionSelector()

TDEActionSelector::~TDEActionSelector ( )

Definition at line 119 of file tdeactionselector.cpp.

Member Function Documentation

◆ added

void TDEActionSelector::added ( TQListBoxItem *  item)
signal

Emitted when an item is moved to the "selected" listbox.

◆ availableInsertionPolicy()

TDEActionSelector::InsertionPolicy TDEActionSelector::availableInsertionPolicy ( ) const
Returns
The current insertion policy for the available listbox. The default policy for the available listbox is Sorted. See also InsertionPolicy, setAvailableInsertionPolicy().

Definition at line 291 of file tdeactionselector.cpp.

◆ availableLabel()

TQString TDEActionSelector::availableLabel ( ) const
Returns
The text of the label for the available items listbox.

Definition at line 259 of file tdeactionselector.cpp.

◆ availableListBox()

TQListBox * TDEActionSelector::availableListBox ( ) const
Returns
The TQListBox holding the available actions

Definition at line 128 of file tdeactionselector.cpp.

◆ buttonIconSize()

TDEActionSelector::ButtonIconSize TDEActionSelector::buttonIconSize ( ) const
Returns
the current ButtonIconSize.

Definition at line 279 of file tdeactionselector.cpp.

◆ eventFilter()

bool TDEActionSelector::eventFilter ( TQObject *  o,
TQEvent *  e 
)
protected

Reimplemented for internal reasons.

Definition at line 369 of file tdeactionselector.cpp.

◆ keyboardEnabled()

bool TDEActionSelector::keyboardEnabled ( ) const
Returns
Weather keyboard control is enabled.

When Keyboard control is enabled, the widget will react to the following keyboard actions:

  • CTRL + Right - simulate clicking the add button
  • CTRL + Left - simulate clicking the remove button
  • CTRL + Up - simulate clicking the up button
  • CTRL + Down - simulate clicking the down button

Additionally, pressing RETURN or ENTER on one of the list boxes will cause the current item of that listbox to be moved to the other listbox.

The keyboard actions are enabled by default.

See also
setKeyboardEnabled()

Definition at line 249 of file tdeactionselector.cpp.

◆ keyPressEvent()

void TDEActionSelector::keyPressEvent ( TQKeyEvent *  e)
protected

Reimplamented for internal reasons.

Definition at line 343 of file tdeactionselector.cpp.

◆ movedDown

void TDEActionSelector::movedDown ( TQListBoxItem *  item)
signal

Emitted when an item is moved downwards in the "selected" listbox.

◆ movedUp

void TDEActionSelector::movedUp ( TQListBoxItem *  item)
signal

Emitted when an item is moved upwards in the "selected" listbox.

◆ moveOnDoubleClick()

bool TDEActionSelector::moveOnDoubleClick ( ) const
Returns
Wheather moveOnDoubleClcik is enabled.

If enabled, an item in any listbox will be moved to the other one whenever doubleclicked.

See also
setMoveOnDoubleClick()

Definition at line 239 of file tdeactionselector.cpp.

◆ polish

void TDEActionSelector::polish ( )
slot

Emitted when an item is moved to the "selected" listbox.

Reimplemented for internal reasons. (calls setButtonsEnabled())

Definition at line 335 of file tdeactionselector.cpp.

◆ removed

void TDEActionSelector::removed ( TQListBoxItem *  item)
signal

Emitted when an item is moved out of the "selected" listbox.

◆ selectedInsertionPolicy()

TDEActionSelector::InsertionPolicy TDEActionSelector::selectedInsertionPolicy ( ) const
Returns
The current insertion policy for the selected listbox. The default policy for the selected listbox is BelowCurrent. See also InsertionPolicy, setSelectedInsertionPolicy().

Definition at line 301 of file tdeactionselector.cpp.

◆ selectedLabel()

TQString TDEActionSelector::selectedLabel ( ) const
Returns
the label of the selected items listbox.

Definition at line 269 of file tdeactionselector.cpp.

◆ selectedListBox()

TQListBox * TDEActionSelector::selectedListBox ( ) const
Returns
The TQListBox holding the selected actions

Definition at line 133 of file tdeactionselector.cpp.

◆ setAvailableInsertionPolicy()

void TDEActionSelector::setAvailableInsertionPolicy ( InsertionPolicy  policy)

Sets the insertion policy for the available listbox.

See also InsertionPolicy, availableInsertionPolicy().

Definition at line 296 of file tdeactionselector.cpp.

◆ setAvailableLabel()

void TDEActionSelector::setAvailableLabel ( const TQString &  text)

Sets the label for the available items listbox to text.

Note that this label has the listbox as its buddy, so that if you have a single ampersand in the text, the following character will become the accellerator to focus te listbox.

Definition at line 264 of file tdeactionselector.cpp.

◆ setButtonIcon()

void TDEActionSelector::setButtonIcon ( const TQString &  icon,
MoveButton  button 
)

Sets the pixmap of the button button to icon.

It calls SmallIconSet(pm) to generate the icon set.

Definition at line 138 of file tdeactionselector.cpp.

◆ setButtonIconSet()

void TDEActionSelector::setButtonIconSet ( const TQIconSet &  iconset,
MoveButton  button 
)

Sets the iconset for button button to iconset.

You can use this method to et a costum icon set. Either created by TQIconSet, or use the application instance of TDEIconLoader (recommended).

Definition at line 163 of file tdeactionselector.cpp.

◆ setButtonIconSize()

void TDEActionSelector::setButtonIconSize ( ButtonIconSize  size)

Sets the button icon size.

See ButtonIconSize for the possible values and their pixel meaning.

Definition at line 284 of file tdeactionselector.cpp.

◆ setButtonsEnabled()

void TDEActionSelector::setButtonsEnabled ( )

Sets the enabled state of all moving buttons to reflect the current options.

Be sure to call this if you add or removes items to either listbox after the widget is show()n

Definition at line 226 of file tdeactionselector.cpp.

◆ setButtonTooltip()

void TDEActionSelector::setButtonTooltip ( const TQString &  tip,
MoveButton  button 
)

Sets the tooltip for the button button to tip.

Definition at line 184 of file tdeactionselector.cpp.

◆ setButtonWhatsThis()

void TDEActionSelector::setButtonWhatsThis ( const TQString &  text,
MoveButton  button 
)

Sets the whatsthis help for button button to text.

Definition at line 205 of file tdeactionselector.cpp.

◆ setKeyboardEnabled()

void TDEActionSelector::setKeyboardEnabled ( bool  enable)

Sets the keyboard enabled depending on enable.

See also
keyboardEnabled()

Definition at line 254 of file tdeactionselector.cpp.

◆ setMoveOnDoubleClick()

void TDEActionSelector::setMoveOnDoubleClick ( bool  enable)

Sets moveOnDoubleClick to enable.

See also
moveOnDoubleClick()

Definition at line 244 of file tdeactionselector.cpp.

◆ setSelectedInsertionPolicy()

void TDEActionSelector::setSelectedInsertionPolicy ( InsertionPolicy  policy)

Sets the insertion policy for the selected listbox.

See also InsertionPolicy, selectedInsertionPolicy().

Definition at line 306 of file tdeactionselector.cpp.

◆ setSelectedLabel()

void TDEActionSelector::setSelectedLabel ( const TQString &  text)

Sets the label for the selected items listbox to text.

Note that this label has the listbox as its buddy, so that if you have a single ampersand in the text, the following character will become the accellerator to focus te listbox.

Definition at line 274 of file tdeactionselector.cpp.

◆ setShowUpDownButtons()

void TDEActionSelector::setShowUpDownButtons ( bool  show)

Sets wheather the Up and Down buttons should be displayed according to show.

Definition at line 316 of file tdeactionselector.cpp.

◆ showUpDownButtons()

bool TDEActionSelector::showUpDownButtons ( ) const
Returns
wheather the Up and Down buttons should be displayed.

Definition at line 311 of file tdeactionselector.cpp.


The documentation for this class was generated from the following files:
  • tdeactionselector.h
  • tdeactionselector.cpp

tdeui

Skip menu "tdeui"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdeui

Skip menu "tdeui"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeui by doxygen 1.9.4
This website is maintained by Timothy Pearson.