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

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

#include <WUIGridWidget.h>

+ Inheritance diagram for WUIGridWidget:
+ Collaboration diagram for WUIGridWidget:

Public Types

typedef std::shared_ptr< WUIGridWidgetSPtr
 Convenience typedef for a std::shared_ptr< WUIGridWidget >. More...
 
typedef std::shared_ptr< const WUIGridWidgetConstSPtr
 Convenience typedef for a std::shared_ptr< const WUIGridWidget >. 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 ~WUIGridWidget ()
 Destructor. More...
 
virtual bool allowNesting () const
 Tell the user whether this kind of widget can be used as parent. More...
 
virtual void placeWidget (WUIWidgetBase::SPtr widget, int x, int y)
 Place the given widget in this grid at the given coordinates. More...
 
virtual void setRowStretch (int row, int stretch)=0
 Sets the stretch factor of a row to stretch. More...
 
virtual void setColumnStretch (int column, int stretch)=0
 Sets the stretch factor of a column to stretch. 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

 WUIGridWidget (std::string title)
 Default constructor. More...
 
virtual void placeWidgetImpl (WUIWidgetBase::SPtr widget, int x, int y)=0
 Place the given widget in this grid at the given coordinates. 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 a grid. The WUIGridWidget itself is a widget, which means you can embed grids in grid cells.

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

Definition at line 40 of file WUIGridWidget.h.

Member Typedef Documentation

◆ ConstSPtr

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

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

Definition at line 51 of file WUIGridWidget.h.

◆ SPtr

typedef std::shared_ptr< WUIGridWidget > WUIGridWidget::SPtr

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

Definition at line 46 of file WUIGridWidget.h.

Constructor & Destructor Documentation

◆ ~WUIGridWidget()

WUIGridWidget::~WUIGridWidget ( )
virtual

Destructor.

Definition at line 37 of file WUIGridWidget.cpp.

◆ WUIGridWidget()

WUIGridWidget::WUIGridWidget ( std::string  title)
explicitprotected

Default constructor.

Create an empty grid widget.

Parameters
titlethe widget title

Definition at line 31 of file WUIGridWidget.cpp.

Member Function Documentation

◆ allowNesting()

bool WUIGridWidget::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 WUIGridWidget.cpp.

◆ placeWidget()

void WUIGridWidget::placeWidget ( WUIWidgetBase::SPtr  widget,
int  x,
int  y 
)
virtual

Place the given widget in this grid at the given coordinates.

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

Parameters
widgetthe widget
xx coord ( 0 is left )
yy coord ( 0 is top )

Definition at line 42 of file WUIGridWidget.cpp.

References placeWidgetImpl().

+ Here is the call graph for this function:

◆ placeWidgetImpl()

virtual void WUIGridWidget::placeWidgetImpl ( WUIWidgetBase::SPtr  widget,
int  x,
int  y 
)
protectedpure virtual

Place the given widget in this grid at the given coordinates.

The widget to be placed must be created with this grid as parent.

Parameters
widgetthe widget
xx coord ( 0 is left )
yy coord ( 0 is top )

Implemented in WUIQtGridWidget.

Referenced by placeWidget().

+ Here is the caller graph for this function:

◆ setColumnStretch()

virtual void WUIGridWidget::setColumnStretch ( int  column,
int  stretch 
)
pure virtual

Sets the stretch factor of a column to stretch.

The first column is number 0. The stretch factor is relative to the other columns in this grid. Columns with a higher stretch factor take more of the available space. The default stretch factor is 0. If the stretch factor is 0 and no other column in this table can grow at all, the column may still grow.

Parameters
columnthe column to set this value for
stretchthe stretch

Implemented in WUIQtGridWidget.

◆ setRowStretch()

virtual void WUIGridWidget::setRowStretch ( int  row,
int  stretch 
)
pure virtual

Sets the stretch factor of a row to stretch.

The first row is number 0. The stretch factor is relative to the other rows in this grid. Rows with a higher stretch factor take more of the available space. The default stretch factor is 0. If the stretch factor is 0 and no other row in this table can grow at all, the row may still grow.

Parameters
rowthe row to set this value for
stretchthe stretch

Implemented in WUIQtGridWidget.


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