.TH "KSelectAction" kde3 "11 Jun 2005" "Version Version 3.4.1" "kdeui Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KSelectAction \- Action for selecting one of several items.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kactionclasses.h>\fP
.PP
Inherits \fBKAction\fP.
.PP
Inherited by KFontAction, KFontSizeAction, and \fBKListAction\fP.
.PP
.SS "Public Slots"

.in +1c
.ti -1c
.RI "virtual void \fBsetCurrentItem\fP (int index)"
.br
.ti -1c
.RI "virtual void \fBsetItems\fP (const \fBQStringList\fP &lst)"
.br
.ti -1c
.RI "virtual void \fBclear\fP ()"
.br
.ti -1c
.RI "virtual void \fBsetEditable\fP (bool)"
.br
.ti -1c
.RI "virtual void \fBsetComboWidth\fP (int width)"
.br
.in -1c
.SS "Signals"

.in +1c
.ti -1c
.RI "void \fBactivated\fP (int index)"
.br
.ti -1c
.RI "void \fBactivated\fP (const \fBQString\fP &text)"
.br
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKSelectAction\fP (const \fBQString\fP &text, const \fBKShortcut\fP &cut=\fBKShortcut\fP(), \fBQObject\fP *\fBparent\fP=0, const char *\fBname\fP=0)"
.br
.ti -1c
.RI "\fBKSelectAction\fP (const \fBQString\fP &text, const \fBKShortcut\fP &cut, const \fBQObject\fP *receiver, const char *slot, \fBQObject\fP *\fBparent\fP, const char *\fBname\fP=0)"
.br
.ti -1c
.RI "\fBKSelectAction\fP (const \fBQString\fP &text, const \fBQIconSet\fP &pix, const \fBKShortcut\fP &cut=\fBKShortcut\fP(), \fBQObject\fP *\fBparent\fP=0, const char *\fBname\fP=0)"
.br
.ti -1c
.RI "\fBKSelectAction\fP (const \fBQString\fP &text, const \fBQString\fP &pix, const \fBKShortcut\fP &cut=\fBKShortcut\fP(), \fBQObject\fP *\fBparent\fP=0, const char *\fBname\fP=0)"
.br
.ti -1c
.RI "\fBKSelectAction\fP (const \fBQString\fP &text, const \fBQIconSet\fP &pix, const \fBKShortcut\fP &cut, const \fBQObject\fP *receiver, const char *slot, \fBQObject\fP *\fBparent\fP, const char *\fBname\fP=0)"
.br
.ti -1c
.RI "\fBKSelectAction\fP (const \fBQString\fP &text, const \fBQString\fP &pix, const \fBKShortcut\fP &cut, const \fBQObject\fP *receiver, const char *slot, \fBQObject\fP *\fBparent\fP, const char *\fBname\fP=0)"
.br
.ti -1c
.RI "\fBKSelectAction\fP (\fBQObject\fP *\fBparent\fP=0, const char *\fBname\fP=0)"
.br
.ti -1c
.RI "virtual \fB~KSelectAction\fP ()"
.br
.ti -1c
.RI "virtual int \fBplug\fP (\fBQWidget\fP *widget, int index=-1)"
.br
.ti -1c
.RI "virtual bool \fBisEditable\fP () const "
.br
.ti -1c
.RI "virtual \fBQStringList\fP \fBitems\fP () const "
.br
.ti -1c
.RI "virtual void \fBchangeItem\fP (int index, const \fBQString\fP &text)"
.br
.ti -1c
.RI "virtual \fBQString\fP \fBcurrentText\fP () const "
.br
.ti -1c
.RI "virtual int \fBcurrentItem\fP () const "
.br
.ti -1c
.RI "virtual int \fBcomboWidth\fP () const "
.br
.ti -1c
.RI "\fBQPopupMenu\fP * \fBpopupMenu\fP () const "
.br
.ti -1c
.RI "void \fBsetRemoveAmpersandsInCombo\fP (bool b) KDE_DEPRECATED"
.br
.ti -1c
.RI "bool \fBremoveAmpersandsInCombo\fP () const "
.br
.ti -1c
.RI "void \fBsetMenuAccelsEnabled\fP (bool b)"
.br
.ti -1c
.RI "bool \fBmenuAccelsEnabled\fP () const "
.br
.in -1c
.SS "Protected Slots"

.in +1c
.ti -1c
.RI "virtual void \fBslotActivated\fP (int id)"
.br
.ti -1c
.RI "virtual void \fBslotActivated\fP (const \fBQString\fP &text)"
.br
.ti -1c
.RI "virtual void \fBslotActivated\fP ()"
.br
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "virtual void \fBchangeItem\fP (int id, int index, const \fBQString\fP &text)"
.br
.ti -1c
.RI "\fBQStringList\fP \fBcomboItems\fP () const "
.br
.ti -1c
.RI "virtual void \fBupdateCurrentItem\fP (int id)"
.br
.ti -1c
.RI "virtual void \fBupdateComboWidth\fP (int id)"
.br
.ti -1c
.RI "virtual void \fBupdateItems\fP (int id)"
.br
.ti -1c
.RI "virtual void \fBupdateClear\fP (int id)"
.br
.ti -1c
.RI "virtual void \fBvirtual_hook\fP (int id, void *data)"
.br
.in -1c
.SS "Properties"

.in +1c
.ti -1c
.RI "int \fBcurrentItem\fP"
.br
.ti -1c
.RI "\fBQStringList\fP \fBitems\fP"
.br
.ti -1c
.RI "bool \fBeditable\fP"
.br
.ti -1c
.RI "int \fBcomboWidth\fP"
.br
.ti -1c
.RI "\fBQString\fP \fBcurrentText\fP"
.br
.ti -1c
.RI "bool \fBmenuAccelsEnabled\fP"
.br
.in -1c
.SH "Detailed Description"
.PP 
Action for selecting one of several items. 

Action for selecting one of several items.
.PP
This action shows up a submenu with a list of items. One of them can be checked. If the user clicks on an item this item will automatically be checked, the formerly checked item becomes unchecked. There can be only one item checked at a time. 
.PP
Definition at line 329 of file kactionclasses.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KSelectAction::KSelectAction (const \fBQString\fP & text, const \fBKShortcut\fP & cut = \fC\fBKShortcut\fP()\fP, \fBQObject\fP * parent = \fC0\fP, const char * name = \fC0\fP)"
.PP
Constructs a select action with text and potential keyboard accelerator but nothing else. 
.PP
Use this only if you really know what you are doing.
.PP
\fBParameters:\fP
.RS 4
\fItext\fP The text that will be displayed. 
.br
\fIcut\fP The corresponding keyboard accelerator (shortcut). 
.br
\fIparent\fP This action's parent. 
.br
\fIname\fP An internal name for this action. 
.RE
.PP

.PP
Definition at line 364 of file kactionclasses.cpp.
.SS "KSelectAction::KSelectAction (const \fBQString\fP & text, const \fBKShortcut\fP & cut, const \fBQObject\fP * receiver, const char * slot, \fBQObject\fP * parent, const char * name = \fC0\fP)"
.PP
\fBParameters:\fP
.RS 4
\fItext\fP The text that will be displayed. 
.br
\fIcut\fP The corresponding keyboard accelerator (shortcut). 
.br
\fIreceiver\fP The SLOT's parent. 
.br
\fIslot\fP The SLOT to invoke to execute this action. 
.br
\fIparent\fP This action's parent. 
.br
\fIname\fP An internal name for this action. 
.RE
.PP

.PP
Definition at line 371 of file kactionclasses.cpp.
.SS "KSelectAction::KSelectAction (const \fBQString\fP & text, const \fBQIconSet\fP & pix, const \fBKShortcut\fP & cut = \fC\fBKShortcut\fP()\fP, \fBQObject\fP * parent = \fC0\fP, const char * name = \fC0\fP)"
.PP
\fBParameters:\fP
.RS 4
\fItext\fP The text that will be displayed. 
.br
\fIpix\fP The icons that go with this action. 
.br
\fIcut\fP The corresponding keyboard accelerator (shortcut). 
.br
\fIparent\fP This action's parent. 
.br
\fIname\fP An internal name for this action. 
.RE
.PP

.PP
Definition at line 379 of file kactionclasses.cpp.
.SS "KSelectAction::KSelectAction (const \fBQString\fP & text, const \fBQString\fP & pix, const \fBKShortcut\fP & cut = \fC\fBKShortcut\fP()\fP, \fBQObject\fP * parent = \fC0\fP, const char * name = \fC0\fP)"
.PP
\fBParameters:\fP
.RS 4
\fItext\fP The text that will be displayed. 
.br
\fIpix\fP The dynamically loaded icon that goes with this action. 
.br
\fIcut\fP The corresponding keyboard accelerator (shortcut). 
.br
\fIparent\fP This action's parent. 
.br
\fIname\fP An internal name for this action. 
.RE
.PP

.PP
Definition at line 387 of file kactionclasses.cpp.
.SS "KSelectAction::KSelectAction (const \fBQString\fP & text, const \fBQIconSet\fP & pix, const \fBKShortcut\fP & cut, const \fBQObject\fP * receiver, const char * slot, \fBQObject\fP * parent, const char * name = \fC0\fP)"
.PP
\fBParameters:\fP
.RS 4
\fItext\fP The text that will be displayed. 
.br
\fIpix\fP The icons that go with this action. 
.br
\fIcut\fP The corresponding keyboard accelerator (shortcut). 
.br
\fIreceiver\fP The SLOT's parent. 
.br
\fIslot\fP The SLOT to invoke to execute this action. 
.br
\fIparent\fP This action's parent. 
.br
\fIname\fP An internal name for this action. 
.RE
.PP

.PP
Definition at line 395 of file kactionclasses.cpp.
.SS "KSelectAction::KSelectAction (const \fBQString\fP & text, const \fBQString\fP & pix, const \fBKShortcut\fP & cut, const \fBQObject\fP * receiver, const char * slot, \fBQObject\fP * parent, const char * name = \fC0\fP)"
.PP
\fBParameters:\fP
.RS 4
\fItext\fP The text that will be displayed. 
.br
\fIpix\fP The dynamically loaded icon that goes with this action. 
.br
\fIcut\fP The corresponding keyboard accelerator (shortcut). 
.br
\fIreceiver\fP The SLOT's parent. 
.br
\fIslot\fP The SLOT to invoke to execute this action. 
.br
\fIparent\fP This action's parent. 
.br
\fIname\fP An internal name for this action. 
.RE
.PP

.PP
Definition at line 405 of file kactionclasses.cpp.
.SS "KSelectAction::KSelectAction (\fBQObject\fP * parent = \fC0\fP, const char * name = \fC0\fP)"
.PP
\fBParameters:\fP
.RS 4
\fIparent\fP This action's parent. 
.br
\fIname\fP An internal name for this action. 
.RE
.PP

.PP
Definition at line 415 of file kactionclasses.cpp.
.SS "KSelectAction::~\fBKSelectAction\fP ()\fC [virtual]\fP"
.PP
Destructor. 
.PP
Definition at line 421 of file kactionclasses.cpp.
.SH "Member Function Documentation"
.PP 
.SS "int KSelectAction::plug (\fBQWidget\fP * widget, int index = \fC-1\fP)\fC [virtual]\fP"
.PP
'Plug' or insert this action into a given widget. 
.PP
This will typically be a menu or a toolbar. From this point on, you will never need to directly manipulate the item in the menu or toolbar. You do all enabling/disabling/manipulation directly with your KSelectAction object.
.PP
\fBParameters:\fP
.RS 4
\fIwidget\fP The GUI element to display this action. 
.br
\fIindex\fP The index of the item. 
.RE
.PP

.PP
Reimplemented from \fBKAction\fP.
.PP
Reimplemented in \fBKRecentFilesAction\fP.
.PP
Definition at line 621 of file kactionclasses.cpp.
.PP
References KAction::activated(), QWhatsThis::add(), comboItems(), QObject::connect(), QObject::destroyed(), endl(), KToolBar::getCombo(), KAction::getToolButtonID(), KAction::iconSet(), KToolBar::insertCombo(), QMenuBar::insertItem(), QPopupMenu::insertItem(), isEditable(), QString::isEmpty(), KAction::isEnabled(), kdDebug(), kdWarning(), popupMenu(), QComboBox::setInsertionPolicy(), QMenuBar::setItemEnabled(), QPopupMenu::setItemEnabled(), QPopupMenu::setWhatsThis(), KAction::text(), KAction::toolTip(), and KAction::whatsThis().
.PP
Referenced by KRecentFilesAction::plug().
.SS "bool KSelectAction::isEditable () const\fC [virtual]\fP"
.PP
When this action is plugged into a toolbar, it creates a combobox. 
.PP
\fBReturns:\fP
.RS 4
true if the combo editable. 
.RE
.PP

.PP
Definition at line 793 of file kactionclasses.cpp.
.PP
Referenced by plug().
.SS "virtual \fBQStringList\fP KSelectAction::items () const\fC [virtual]\fP"
.PP
\fBReturns:\fP
.RS 4
the items that can be selected with this action. Use setItems to set them. 
.RE
.PP

.PP
Referenced by KRecentFilesAction::addURL(), KListAction::currentText(), KRecentFilesAction::removeURL(), KRecentFilesAction::saveEntries(), and KRecentFilesAction::setMaxItems().
.SS "void KSelectAction::changeItem (int index, const \fBQString\fP & text)\fC [virtual]\fP"
.PP
Changes the text of item. 
.PP
\fBParameters:\fP
.RS 4
\fIindex\fP to 
.br
\fItext\fP . 
.RE
.PP

.PP
Definition at line 498 of file kactionclasses.cpp.
.PP
References endl(), and kdWarning().
.SS "virtual \fBQString\fP KSelectAction::currentText () const\fC [virtual]\fP"
.PP
Returns the text of the currently selected item. 
.PP
Reimplemented in \fBKListAction\fP.
.SS "virtual int KSelectAction::currentItem () const\fC [virtual]\fP"
.PP
Returns the index of the current item. 
.PP
\fBSee also:\fP
.RS 4
\fBsetCurrentItem\fP 
.RE
.PP

.PP
Reimplemented in \fBKListAction\fP.
.SS "virtual int KSelectAction::comboWidth () const\fC [virtual]\fP"
.PP
When this action is plugged into a toolbar, it creates a combobox. 
.PP
This returns the maximum width set by setComboWidth 
.SS "\fBQPopupMenu\fP * KSelectAction::popupMenu () const"
.PP
Returns a pointer to the popup menu used by this action. 
.PP
Definition at line 468 of file kactionclasses.cpp.
.PP
References endl(), and kdDebug().
.PP
Referenced by plug().
.SS "void KSelectAction::setRemoveAmpersandsInCombo (bool b)"
.PP
\fBDeprecated\fP
.RS 4
See setMenuAccelsEnabled . 
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP
.RE
.PP

.PP
Definition at line 798 of file kactionclasses.cpp.
.PP
References setMenuAccelsEnabled().
.SS "bool KSelectAction::removeAmpersandsInCombo () const"
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP

.PP
Definition at line 803 of file kactionclasses.cpp.
.PP
References menuAccelsEnabled().
.SS "void KSelectAction::setMenuAccelsEnabled (bool b)"
.PP
Sets whether any occurrence of the ampersand character ( & ) in items should be interpreted as keyboard accelerator for items displayed in a menu or not. 
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP

.PP
Definition at line 808 of file kactionclasses.cpp.
.PP
Referenced by setRemoveAmpersandsInCombo().
.SS "bool KSelectAction::menuAccelsEnabled () const"
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP

.PP
Referenced by removeAmpersandsInCombo().
.SS "void KSelectAction::setCurrentItem (int index)\fC [virtual, slot]\fP"
.PP
Sets the currently checked item. 
.PP
\fBParameters:\fP
.RS 4
\fIindex\fP Index of the item (remember the first item is zero). 
.RE
.PP

.PP
Reimplemented in \fBKListAction\fP.
.PP
Definition at line 428 of file kactionclasses.cpp.
.PP
Referenced by KListAction::setCurrentItem().
.SS "void KSelectAction::setItems (const \fBQStringList\fP & lst)\fC [virtual, slot]\fP"
.PP
Sets the items to be displayed in this action You need to call this. 
.PP
Definition at line 533 of file kactionclasses.cpp.
.PP
References KAction::setEnabled().
.PP
Referenced by KRecentFilesAction::addURL(), KRecentFilesAction::loadEntries(), KRecentFilesAction::removeURL(), and KRecentFilesAction::setMaxItems().
.SS "void KSelectAction::clear ()\fC [virtual, slot]\fP"
.PP
Clears up all the items in this action. 
.PP
Definition at line 725 of file kactionclasses.cpp.
.PP
Referenced by KRecentFilesAction::clearURLList().
.SS "void KSelectAction::setEditable (bool)\fC [virtual, slot]\fP"
.PP
When this action is plugged into a toolbar, it creates a combobox. 
.PP
This makes the combo editable or read-only. 
.PP
Definition at line 788 of file kactionclasses.cpp.
.SS "void KSelectAction::setComboWidth (int width)\fC [virtual, slot]\fP"
.PP
When this action is plugged into a toolbar, it creates a combobox. 
.PP
This gives a _maximum_ size to the combobox. The minimum size is automatically given by the contents (the items). 
.PP
Definition at line 455 of file kactionclasses.cpp.
.SS "\fBQStringList\fP KSelectAction::comboItems () const\fC [protected]\fP"
.PP
Depending on the menuAccelsEnabled property this method will return the actions items in a way for inclusion in a combobox with the ampersand character removed from all items or not. 
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP

.PP
Definition at line 706 of file kactionclasses.cpp.
.PP
References QString::find(), and QString::remove().
.PP
Referenced by plug().
.SS "void KSelectAction::activated (int index)\fC [signal]\fP"
.PP
This signal is emitted when an item is selected;. 
.PP
\fBParameters:\fP
.RS 4
\fIindex\fP indicated the item selected. 
.RE
.PP

.SS "void KSelectAction::activated (const \fBQString\fP & text)\fC [signal]\fP"
.PP
This signal is emitted when an item is selected;. 
.PP
\fBParameters:\fP
.RS 4
\fItext\fP indicates the item selected. 
.RE
.PP


.SH "Author"
.PP 
Generated automatically by Doxygen for kdeui Library from the source code.
