OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Signals | Public Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
CSVWidget::SceneToolToggle Class Reference

Multi-Toggle tool. More...

#include <scenetooltoggle.hpp>

Inheritance diagram for CSVWidget::SceneToolToggle:
Collaboration diagram for CSVWidget::SceneToolToggle:

Classes

struct  ButtonDesc
 

Signals

void selectionChanged ()
 

Public Member Functions

 SceneToolToggle (SceneToolbar *parent, const QString &toolTip, const std::string &emptyIcon)
 
virtual void showPanel (const QPoint &position)
 
void addButton (const std::string &icon, unsigned int mask, const std::string &smallIcon, const QString &name, const QString &tooltip="")
 
unsigned int getSelectionMask () const
 
void setSelectionMask (unsigned int selection)
 
- Public Member Functions inherited from CSVWidget::SceneTool
 SceneTool (SceneToolbar *parent, Type type=Type_TopMode)
 
virtual void activate ()
 
- Public Member Functions inherited from CSVWidget::PushButton
 PushButton (const QIcon &icon, Type type, const QString &tooltip="", QWidget *parent=0)
 
 PushButton (Type type, const QString &tooltip="", QWidget *parent=0)
 
bool hasKeepOpen () const
 
QString getBaseToolTip () const
 Return tooltip used at construction (without any button-specific modifications) More...
 
Type getType () const
 

Private Slots

void selected ()
 

Private Member Functions

void adjustToolTip ()
 
void adjustIcon ()
 
QRect getIconBox (int index) const
 

Private Attributes

std::string mEmptyIcon
 
QWidgetmPanel
 
QHBoxLayout * mLayout
 
std::map< PushButton
*, ButtonDesc
mButtons
 
int mButtonSize
 
int mIconSize
 
QString mToolTip
 
PushButtonmFirst
 

Additional Inherited Members

- Public Types inherited from CSVWidget::PushButton
enum  Type { Type_TopMode, Type_TopAction, Type_Mode, Type_Toggle }
 
- Protected Member Functions inherited from CSVWidget::SceneTool
void mouseReleaseEvent (QMouseEvent *event)
 
- Protected Member Functions inherited from CSVWidget::PushButton
virtual void keyPressEvent (QKeyEvent *event)
 
virtual void keyReleaseEvent (QKeyEvent *event)
 

Detailed Description

Multi-Toggle tool.

Constructor & Destructor Documentation

CSVWidget::SceneToolToggle::SceneToolToggle ( SceneToolbar parent,
const QString &  toolTip,
const std::string &  emptyIcon 
)

Member Function Documentation

void CSVWidget::SceneToolToggle::addButton ( const std::string &  icon,
unsigned int  mask,
const std::string &  smallIcon,
const QString &  name,
const QString &  tooltip = "" 
)
Attention
After the last button has been added, setSelection must be called at least once to finalise the layout.
Note
The layout algorithm can not handle more than 9 buttons. To prevent this An attempt to add more will result in an exception being thrown. The small icons will be sized at (x-4)/3 (where x is the main icon size).
void CSVWidget::SceneToolToggle::adjustIcon ( )
private
void CSVWidget::SceneToolToggle::adjustToolTip ( )
private
QRect CSVWidget::SceneToolToggle::getIconBox ( int  index) const
private
unsigned int CSVWidget::SceneToolToggle::getSelectionMask ( ) const
void CSVWidget::SceneToolToggle::selected ( )
privateslot
void CSVWidget::SceneToolToggle::selectionChanged ( )
signal
void CSVWidget::SceneToolToggle::setSelectionMask ( unsigned int  selection)
Parameters
or'edbutton masks. buttons that do not exist will be ignored.
void CSVWidget::SceneToolToggle::showPanel ( const QPoint &  position)
virtual

Implements CSVWidget::SceneTool.

Member Data Documentation

std::map<PushButton *, ButtonDesc> CSVWidget::SceneToolToggle::mButtons
private
int CSVWidget::SceneToolToggle::mButtonSize
private
std::string CSVWidget::SceneToolToggle::mEmptyIcon
private
PushButton* CSVWidget::SceneToolToggle::mFirst
private
int CSVWidget::SceneToolToggle::mIconSize
private
QHBoxLayout* CSVWidget::SceneToolToggle::mLayout
private
QWidget* CSVWidget::SceneToolToggle::mPanel
private
QString CSVWidget::SceneToolToggle::mToolTip
private

The documentation for this class was generated from the following files: