lib Library API Documentation

KoSelectAction Class Reference

An action that provides a menu with items that can be selected. More...

#include <koselectaction.h>

Inheritance diagram for KoSelectAction:

Inheritance graph
[legend]
List of all members.

Public Slots

virtual void setCurrentSelection (int index)

Signals

void selectionChanged (int)

Public Member Functions

 KoSelectAction (const QString &text, const QString &icon, QObject *parent=0, const char *name=0)
 KoSelectAction (const QString &text, const QString &icon, const QObject *receiver, const char *slot, QObject *parent, const char *name=0)
KPopupMenu * popupMenu () const
void popup (const QPoint &global)
virtual int plug (QWidget *widget, int index=-1)
virtual int currentSelection ()

Protected Slots

virtual void execute (int index)

Detailed Description

An action that provides a menu with items that can be selected.

The main difference between this action and a KSelectAction is that it is plugged into a toolbar as a dropdown menu and not as a combobox.

Definition at line 31 of file koselectaction.h.


Constructor & Destructor Documentation

KoSelectAction::KoSelectAction const QString text,
const QString icon,
QObject parent = 0,
const char *  name = 0
 

Constructs a KoSelectAction with a text and an icon.

Parameters:
text The text that will be displayed.
icon The dynamically loaded icon that goes with this action.
parent This action's parent.
name An internal name for this action.

Definition at line 54 of file koselectaction.cpp.

References execute(), and popupMenu().

KoSelectAction::KoSelectAction const QString text,
const QString icon,
const QObject receiver,
const char *  slot,
QObject parent,
const char *  name = 0
 

Same as above, but it also connects a slot to the selectionChanged(int) signal.

Parameters:
text The text that will be displayed.
icon The dynamically loaded icon that goes with this action.
receiver The SLOT's parent.
slot The SLOT to invoke when a selectionChanged(int) signal is emited.
parent This action's parent.
name An internal name for this action.

Definition at line 62 of file koselectaction.cpp.

References execute(), popupMenu(), and selectionChanged().


Member Function Documentation

KPopupMenu * KoSelectAction::popupMenu  )  const
 

Returns a pointer to the popup menu.

Definition at line 76 of file koselectaction.cpp.

Referenced by KoLineWidthAction::createMenu(), KoLineStyleAction::createMenu(), KoSelectAction(), popup(), and setCurrentSelection().

void KoSelectAction::popup const QPoint global  ) 
 

Shows the popup menu.

Parameters:
global Position at which the popup menu is shown.

Definition at line 81 of file koselectaction.cpp.

References popupMenu().

Referenced by KoLineWidthAction::createMenu(), and KoLineStyleAction::createMenu().

int KoSelectAction::currentSelection  )  [virtual]
 

Returns the index of the currently selected item.

Definition at line 172 of file koselectaction.cpp.

void KoSelectAction::selectionChanged int   )  [signal]
 

Emited when the selection changed.

Referenced by execute(), and KoSelectAction().

void KoSelectAction::setCurrentSelection int  index  )  [virtual, slot]
 

Set which item that should be selected.

Parameters:
index Index of item that should be selected

Definition at line 177 of file koselectaction.cpp.

References popupMenu().

Referenced by execute(), KoLineWidthAction::execute(), and KoLineWidthAction::setCurrentWidth().

void KoSelectAction::execute int  index  )  [protected, virtual, slot]
 

Execute an item.

By default it sets the item as selected and emits the selectionChanged signal.

Parameters:
index Index of the item that should be executed.

Reimplemented in KoLineWidthAction.

Definition at line 166 of file koselectaction.cpp.

References selectionChanged(), and setCurrentSelection().

Referenced by KoSelectAction().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for lib Library Version 1.4.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Mon Feb 13 09:41:19 2006 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003