.TH "KSelectAction" 3 "28 Jan 2004" "kdeui Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KSelectAction \- Action for selecting one of several items. Action for selecting one of several items.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kaction.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
.RI "\fISets the currently checked item. \fP"
.ti -1c
.RI "virtual void \fBsetItems\fP (const  \fBQStringList\fP &lst)"
.br
.RI "\fISets the items to be displayed in this action You need to call this. \fP"
.ti -1c
.RI "virtual void \fBclear\fP ()"
.br
.RI "\fIClears up all the items in this action. \fP"
.ti -1c
.RI "virtual void \fBsetEditable\fP (bool)"
.br
.RI "\fIWhen this action is plugged into a toolbar, it creates a combobox. \fP"
.ti -1c
.RI "virtual void \fBsetComboWidth\fP (int width)"
.br
.RI "\fIWhen this action is plugged into a toolbar, it creates a combobox. \fP"
.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  KShortcut &cut=KShortcut(), \fBQObject\fP *\fBparent\fP=0, const  char *\fBname\fP=0)"
.br
.RI "\fIConstructs a select action with text and potential keyboard accelerator but nothing else. \fP"
.ti -1c
.RI "\fBKSelectAction\fP (const  \fBQString\fP &text, const  KShortcut &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  KShortcut &cut=KShortcut(), \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  KShortcut &cut=KShortcut(), \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  KShortcut &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  KShortcut &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
.RI "\fIDestructor. \fP"
.ti -1c
.RI "virtual int \fBplug\fP (\fBQWidget\fP *widget, int index=-1)"
.br
.RI "\fI'Plug' or insert this action into a given widget. \fP"
.ti -1c
.RI "virtual bool \fBisEditable\fP () const "
.br
.RI "\fIWhen this action is plugged into a toolbar, it creates a combobox. \fP"
.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
.RI "\fIWhen this action is plugged into a toolbar, it creates a combobox. \fP"
.ti -1c
.RI "\fBQPopupMenu\fP * \fBpopupMenu\fP () const "
.br
.ti -1c
.RI "void \fBsetRemoveAmpersandsInCombo\fP (bool b)"
.br
.RI "\fIDeprecated. \fP"
.ti -1c
.RI "bool \fBremoveAmpersandsInCombo\fP () const "
.br
.RI "\fI\fBSince:\fP
.RS 4
3.1 
.RE
.PP
\fP"
.ti -1c
.RI "void \fBsetMenuAccelsEnabled\fP (bool b)"
.br
.RI "\fISets whether any occurence of the ampersand character ( & ) in items should be interpreted as keyboard accelerator for items displayed in a menu or not. \fP"
.ti -1c
.RI "bool \fBmenuAccelsEnabled\fP () const "
.br
.RI "\fI\fBSince:\fP
.RS 4
3.1 
.RE
.PP
\fP"
.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
.RI "\fIDepending 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. \fP"
.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
.SH "Detailed Description"
.PP 
Action for selecting one of several items. Action for selecting one of several items. 

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 854 of file kaction.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KSelectAction::KSelectAction (const \fBQString\fP & text, const KShortcut & cut = KShortcut(), \fBQObject\fP * parent = 0, const char * name = 0)"
.PP
Constructs a select action with text and potential keyboard accelerator but nothing else. 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
Definition at line 1468 of file kaction.cpp.
.PP
References KStdAccel::cut(), and QObject::name().
.SS "KSelectAction::KSelectAction (const \fBQString\fP & text, const KShortcut & cut, const \fBQObject\fP * receiver, const char * slot, \fBQObject\fP * parent, const char * name = 0)"
.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
Definition at line 1475 of file kaction.cpp.
.PP
References KStdAccel::cut(), and KStdAccel::name().
.SS "KSelectAction::KSelectAction (const \fBQString\fP & text, const \fBQIconSet\fP & pix, const KShortcut & cut = KShortcut(), \fBQObject\fP * parent = 0, const char * name = 0)"
.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
Definition at line 1483 of file kaction.cpp.
.PP
References KStdAccel::cut(), and KStdAccel::name().
.SS "KSelectAction::KSelectAction (const \fBQString\fP & text, const \fBQString\fP & pix, const KShortcut & cut = KShortcut(), \fBQObject\fP * parent = 0, const char * name = 0)"
.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
Definition at line 1491 of file kaction.cpp.
.PP
References KStdAccel::cut(), and KStdAccel::name().
.SS "KSelectAction::KSelectAction (const \fBQString\fP & text, const \fBQIconSet\fP & pix, const KShortcut & cut, const \fBQObject\fP * receiver, const char * slot, \fBQObject\fP * parent, const char * name = 0)"
.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
Definition at line 1499 of file kaction.cpp.
.PP
References KStdAccel::cut(), and KStdAccel::name().
.SS "KSelectAction::KSelectAction (const \fBQString\fP & text, const \fBQString\fP & pix, const KShortcut & cut, const \fBQObject\fP * receiver, const char * slot, \fBQObject\fP * parent, const char * name = 0)"
.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
Definition at line 1509 of file kaction.cpp.
.PP
References KStdAccel::cut(), and KStdAccel::name().
.SS "KSelectAction::KSelectAction (\fBQObject\fP * parent = 0, const char * name = 0)"
.PP
\fBParameters:\fP
.RS 4
\fIparent\fP This action's parent. 
.br
\fIname\fP An internal name for this action. 
.RE
.PP
Definition at line 1519 of file kaction.cpp.
.PP
References KStdAccel::name().
.SS "KSelectAction::~\fBKSelectAction\fP ()\fC [virtual]\fP"
.PP
Destructor. Definition at line 1525 of file kaction.cpp.
.SH "Member Function Documentation"
.PP 
.SS "int KSelectAction::plug (\fBQWidget\fP * widget, int index = -1)\fC [virtual]\fP"
.PP
'Plug' or insert this action into a given widget. 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
Reimplemented from \fBKAction\fP.
.PP
Definition at line 1728 of file kaction.cpp.
.PP
References comboItems(), QObject::connect(), QObject::destroyed(), KToolBar::getCombo(), KAction::iconSet(), KToolBar::insertCombo(), QPopupMenu::insertItem(), isEditable(), QString::isEmpty(), KAction::isEnabled(), QObject::name(), QComboBox::setInsertionPolicy(), QPopupMenu::setItemEnabled(), QPopupMenu::setWhatsThis(), KAction::text(), KAction::toolTip(), and KAction::whatsThis().
.SS "bool KSelectAction::isEditable () const\fC [virtual]\fP"
.PP
When this action is plugged into a toolbar, it creates a combobox. \fBReturns:\fP
.RS 4
true if the combo editable. 
.RE
.PP
Definition at line 1879 of file kaction.cpp.
.PP
Referenced by plug().
.SS "\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
Definition at line 1656 of file kaction.cpp.
.PP
Referenced by KRecentFilesAction::addURL(), KRecentFilesAction::removeURL(), KRecentFilesAction::saveEntries(), and KRecentFilesAction::setMaxItems().
.SS "int KSelectAction::comboWidth () const\fC [virtual]\fP"
.PP
When this action is plugged into a toolbar, it creates a combobox. This returns the maximum width set by setComboWidth Definition at line 1689 of file kaction.cpp.
.SS "void KSelectAction::setRemoveAmpersandsInCombo (bool b)"
.PP
Deprecated. See \fBsetMenuAccelsEnabled\fP . 
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP
Definition at line 1884 of file kaction.cpp.
.PP
References setMenuAccelsEnabled().
.SS "bool KSelectAction::removeAmpersandsInCombo () const"
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP
Definition at line 1889 of file kaction.cpp.
.PP
References menuAccelsEnabled().
.SS "void KSelectAction::setMenuAccelsEnabled (bool b)"
.PP
Sets whether any occurence of the ampersand character ( & ) in items should be interpreted as keyboard accelerator for items displayed in a menu or not. \fBSince:\fP
.RS 4
3.1 
.RE
.PP
Definition at line 1894 of file kaction.cpp.
.PP
Referenced by setRemoveAmpersandsInCombo().
.SS "bool KSelectAction::menuAccelsEnabled () const"
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP
Definition at line 1899 of file kaction.cpp.
.PP
Referenced by removeAmpersandsInCombo().
.SS "void KSelectAction::setCurrentItem (int index)\fC [virtual, slot]\fP"
.PP
Sets the currently checked item. \fBParameters:\fP
.RS 4
\fIindex\fP Index of the item (remember the first item is zero). 
.RE
.PP
Reimplemented in \fBKListAction\fP.
.PP
Definition at line 1532 of file kaction.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. Definition at line 1629 of file kaction.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. Definition at line 1811 of file kaction.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. This makes the combo editable or read-only. Definition at line 1874 of file kaction.cpp.
.SS "void KSelectAction::setComboWidth (int width)\fC [virtual, slot]\fP"
.PP
When this action is plugged into a toolbar, it creates a combobox. This gives a _maximum_ size to the combobox. The minimum size is automatically given by the contents (the items). Definition at line 1559 of file kaction.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. \fBSince:\fP
.RS 4
3.1 
.RE
.PP
Definition at line 1792 of file kaction.cpp.
.PP
References QString::find(), and QString::remove().
.PP
Referenced by plug().

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