OpenWalnut  1.5.0dev
Public Types | Public Member Functions | Protected Member Functions | List of all members
WUITabbedWidget Class Referenceabstract

Widget which is a container for others. More...

#include <WUITabbedWidget.h>

+ Inheritance diagram for WUITabbedWidget:
+ Collaboration diagram for WUITabbedWidget:

Public Types

enum  TabPosition { North = 0 , South , West , East }
 Tab positions. More...
 
typedef std::shared_ptr< WUITabbedWidgetSPtr
 Convenience typedef for a std::shared_ptr< WUITabbedWidget >. More...
 
typedef std::shared_ptr< const WUITabbedWidgetConstSPtr
 Convenience typedef for a std::shared_ptr< const WUITabbedWidget >. More...
 
- Public Types inherited from WUIWidgetBase
typedef std::shared_ptr< WUIWidgetBaseSPtr
 Convenience typedef for a std::shared_ptr< WUIWidgetBase >. More...
 
typedef std::shared_ptr< const WUIWidgetBaseConstSPtr
 Convenience typedef for a std::shared_ptr< const WUIWidgetBase >. More...
 

Public Member Functions

virtual ~WUITabbedWidget ()
 Destructor. More...
 
virtual bool allowNesting () const
 Tell the user whether this kind of widget can be used as parent. More...
 
virtual void setTabText (int index, const std::string &label)=0
 Set label of the tab with given index. More...
 
virtual void setActiveTab (int index)=0
 Set the given tab active. More...
 
virtual int getActiveTab () const =0
 Get the index of the currently active tab. More...
 
virtual int getNumTabs () const =0
 Query the number of tabs. More...
 
virtual void setTabToolTip (int index, const std::string &tip)=0
 Write some tool tip for a given tab. More...
 
virtual void setTabEnabled (int index, bool enable)=0
 Allows en/disabling a tab. More...
 
virtual void setTabPosition (TabPosition position)=0
 Specify where to place the tabs. More...
 
virtual int addTab (WUIWidgetBase::SPtr widget, const std::string &label)
 Place the given widget in this tab widget in a new tab with a given label. More...
 
- Public Member Functions inherited from WUIWidgetBase
virtual ~WUIWidgetBase ()
 Destructor. More...
 
virtual std::string getTitle () const
 Get the title of the widget. More...
 
virtual void show ()=0
 Show this widget if not yet visible. More...
 
virtual void setVisible (bool visible=true)=0
 Hide/show this widget. More...
 
virtual bool isVisible () const =0
 Check if the widget is hidden or not. More...
 
void close ()
 Close the widget. More...
 
bool isClosed () const
 Checks whether the widget was closed already. More...
 
WCondition::SPtr getCloseCondition () const
 Return the condition that fires when the widgets closes. More...
 
virtual WUIWidgetBase::SPtr getParent () const
 Get the parent widget of this widget if any. More...
 
virtual void addAction (WPropGroup group, WGEImage::SPtr icon=WGEImage::SPtr())=0
 Define a property as action. More...
 
virtual void addAction (WPropTrigger trigger, WGEImage::SPtr icon=WGEImage::SPtr())=0
 Define a property as action. More...
 
virtual void addAction (WPropBool toggle, WGEImage::SPtr icon=WGEImage::SPtr())=0
 Define a property as action. More...
 

Protected Member Functions

 WUITabbedWidget (std::string title)
 Default constructor. More...
 
virtual int addTabImpl (WUIWidgetBase::SPtr widget, std::string label)=0
 Place the given widget in this tab widget in a new tab with a given label. More...
 
- Protected Member Functions inherited from WUIWidgetBase
 WUIWidgetBase (std::string title)
 Default constructor. More...
 
virtual void closeImpl ()=0
 Close the widget. More...
 
virtual void setParent (WUIWidgetBase::SPtr parent)
 Set the parent of this WUI widget. More...
 
virtual void registerChild (WUIWidgetBase::SPtr child)
 Register widget as child. More...
 
ChildContainergetChildren ()
 Return the list of children. More...
 
const ChildContainergetChildren () const
 Return the list of children. More...
 
void closeChildren ()
 Comfortable function to recurse a close call. More...
 

Additional Inherited Members

- Protected Types inherited from WUIWidgetBase
typedef WSharedSequenceContainer< std::vector< WUIWidgetBase::SPtr > > ChildContainer
 Keep track of our child widgets. More...
 

Detailed Description

Widget which is a container for others.

The child widgets can be arranged in tabs. The WUITabbedWidget itself is a widget, which means you can embed tabs in other container widgets (like grids).

Note
Please read documentation of WUIWidgetFactory for limitations, requirements and creation of these widgets.

Definition at line 40 of file WUITabbedWidget.h.

Member Typedef Documentation

◆ ConstSPtr

typedef std::shared_ptr< const WUITabbedWidget > WUITabbedWidget::ConstSPtr

Convenience typedef for a std::shared_ptr< const WUITabbedWidget >.

Definition at line 51 of file WUITabbedWidget.h.

◆ SPtr

typedef std::shared_ptr< WUITabbedWidget > WUITabbedWidget::SPtr

Convenience typedef for a std::shared_ptr< WUITabbedWidget >.

Definition at line 46 of file WUITabbedWidget.h.

Member Enumeration Documentation

◆ TabPosition

Tab positions.

Enumerator
North 

The tabs are drawn above the pages.

South 

The tabs are drawn below the pages.

West 

The tabs are drawn to the left of the pages.

East 

The tabs are drawn to the right of the pages.

Definition at line 113 of file WUITabbedWidget.h.

Constructor & Destructor Documentation

◆ ~WUITabbedWidget()

WUITabbedWidget::~WUITabbedWidget ( )
virtual

Destructor.

Definition at line 37 of file WUITabbedWidget.cpp.

◆ WUITabbedWidget()

WUITabbedWidget::WUITabbedWidget ( std::string  title)
explicitprotected

Default constructor.

Create an empty grid widget.

Parameters
titlethe widget title

Definition at line 31 of file WUITabbedWidget.cpp.

Member Function Documentation

◆ addTab()

int WUITabbedWidget::addTab ( WUIWidgetBase::SPtr  widget,
const std::string &  label 
)
virtual

Place the given widget in this tab widget in a new tab with a given label.

The widget to be placed must be created with this tab widget as parent or an exception will be thrown.

Parameters
widgetthe widget
labelthe label of the tab
Returns
the index of the new tab, or -1 if error.

Definition at line 42 of file WUITabbedWidget.cpp.

References addTabImpl().

+ Here is the call graph for this function:

◆ addTabImpl()

virtual int WUITabbedWidget::addTabImpl ( WUIWidgetBase::SPtr  widget,
std::string  label 
)
protectedpure virtual

Place the given widget in this tab widget in a new tab with a given label.

The widget to be placed must be created with this tab widget as parent or an exception will be thrown.

Parameters
widgetthe widget
labelthe label of the tab
Returns
the index of the new tab

Implemented in WUIQtTabbedWidget.

Referenced by addTab().

+ Here is the caller graph for this function:

◆ allowNesting()

bool WUITabbedWidget::allowNesting ( ) const
virtual

Tell the user whether this kind of widget can be used as parent.

In other word, whether it is allowed to nest other widgets into this one.

Returns
true if nesting other widgets INTO this one is allowed

Reimplemented from WUIWidgetBase.

Definition at line 51 of file WUITabbedWidget.cpp.

◆ getActiveTab()

virtual int WUITabbedWidget::getActiveTab ( ) const
pure virtual

Get the index of the currently active tab.

Returns
the index, or -1 if error

Implemented in WUIQtTabbedWidget.

◆ getNumTabs()

virtual int WUITabbedWidget::getNumTabs ( ) const
pure virtual

Query the number of tabs.

Returns
the number of tabs, or -1 if error.

Implemented in WUIQtTabbedWidget.

◆ setActiveTab()

virtual void WUITabbedWidget::setActiveTab ( int  index)
pure virtual

Set the given tab active.

If it not exists, the current tab stays active.

Parameters
indexthe index of the tab

Implemented in WUIQtTabbedWidget.

◆ setTabEnabled()

virtual void WUITabbedWidget::setTabEnabled ( int  index,
bool  enable 
)
pure virtual

Allows en/disabling a tab.

If the index is invalid, nothing happens.

Parameters
indexthe index.
enabletrue to enable

Implemented in WUIQtTabbedWidget.

◆ setTabPosition()

virtual void WUITabbedWidget::setTabPosition ( TabPosition  position)
pure virtual

Specify where to place the tabs.

Parameters
positionthe position

Implemented in WUIQtTabbedWidget.

◆ setTabText()

virtual void WUITabbedWidget::setTabText ( int  index,
const std::string &  label 
)
pure virtual

Set label of the tab with given index.

If the tab does not exist, nothing happens.

Parameters
indexthe index of the tab
labelthe label of the tab

Implemented in WUIQtTabbedWidget.

◆ setTabToolTip()

virtual void WUITabbedWidget::setTabToolTip ( int  index,
const std::string &  tip 
)
pure virtual

Write some tool tip for a given tab.

If the index is invalid, nothing happens.

Parameters
indexthe tab index
tipthe tooltip text

Implemented in WUIQtTabbedWidget.


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