Hot Door CORE 0.8.2
Adobe® Illustrator® Plug-in Library
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
hdi::core::WidgetGroup Class Reference

Allows for grouping widgets together, such that all can be added to a window in one call, removed from a window in one call, have their geometry adjusted collectively in one call, etc. More...

#include <hdicoreWidgetGroup.h>

Public Types

typedef std::vector< std::shared_ptr< Widget > > WidgetVector
 

Public Member Functions

 WidgetGroup ()
 Constructs a new widget group.
 
 WidgetGroup (const WidgetGroup &group_)
 Constructs a new WidgetGroup object from an existing WidgetGroup object (copy constructor)
 
virtual ~WidgetGroup ()
 WidgetGroup destructor.
 
virtual WidgetGroupoperator= (const WidgetGroup &rhs_)
 Allows one WidgetGroup object to be assigned from another.
 
virtual bool operator== (const WidgetGroup &rhs_) const
 Tests whether a given WidgetGroup object is the same as another.
 
virtual bool operator!= (const WidgetGroup &rhs_) const
 Tests whether a given WidgetGroup object is not the same as another.
 
virtual void add (const Widget &w_)
 Adds a widget to the group.
 
virtual void remove (const Widget &w_)
 Removes a widget from the group.
 
virtual void clear ()
 Removes all widgets currently contained by the group.
 
virtual bool hasWidget (const Widget &w_)
 Checks for the existence of a widget in the group.
 
virtual const WidgetVector widgets () const
 Gets a vector of the contained widgets.
 
virtual Point origin () const
 Gets the top-left-most point for the contained widgets.
 
virtual void setOrigin (const Point &pt_)
 Sets the top-left-most point for the contained widgets.
 
virtual double width () const
 Gets the total width of all the contained widgets.
 
virtual double height () const
 Gets the total height of all the contained widgets.
 
virtual void setEnabled (const bool enable_)
 Enables or disables all the contained widgets.
 
virtual void setVisible (const bool visible_)
 Shows or hides all the contained widgets.
 
virtual void update ()
 Force all the contained widgets to update (i.e. cause them to redraw)
 

Detailed Description

Allows for grouping widgets together, such that all can be added to a window in one call, removed from a window in one call, have their geometry adjusted collectively in one call, etc.

Constructor & Destructor Documentation

◆ WidgetGroup() [1/2]

hdi::core::WidgetGroup::WidgetGroup ( )

Constructs a new widget group.

Author
GW
Date
02/2015

◆ WidgetGroup() [2/2]

hdi::core::WidgetGroup::WidgetGroup ( const WidgetGroup group_)

Constructs a new WidgetGroup object from an existing WidgetGroup object (copy constructor)

Author
GW
Date
02/2015
Parameters
group_Existing WidgetGroup object

◆ ~WidgetGroup()

virtual hdi::core::WidgetGroup::~WidgetGroup ( )
virtual

WidgetGroup destructor.

Author
GW
Date
02/2015

Member Function Documentation

◆ add()

virtual void hdi::core::WidgetGroup::add ( const Widget w_)
virtual

Adds a widget to the group.

Author
GW
Date
02/2015
Parameters
w_Widget to add
Note
If the widget is already in a group, this method will bail early.
If the target WidgetGroup has already been added to a Window object, then the widget will automatically be added to the same Window object.

◆ clear()

virtual void hdi::core::WidgetGroup::clear ( )
virtual

Removes all widgets currently contained by the group.

Author
GW
Date
12/2015
Note
If the target WidgetGroup has already been added to a Window object, then the widgets will automatically be removed from the same Window object.

◆ hasWidget()

virtual bool hdi::core::WidgetGroup::hasWidget ( const Widget w_)
virtual

Checks for the existence of a widget in the group.

Author
GW
Date
02/2015
Parameters
w_Widget in question
Returns
true if the widget is contained in the group, false otherwise

◆ height()

virtual double hdi::core::WidgetGroup::height ( ) const
virtual

Gets the total height of all the contained widgets.

Author
GW
Date
02/2015
Returns
The height from the topmost widget to the bottommost widget

◆ operator!=()

virtual bool hdi::core::WidgetGroup::operator!= ( const WidgetGroup rhs_) const
virtual

Tests whether a given WidgetGroup object is not the same as another.

Author
GW
Date
02/2015
Parameters
rhs_WidgetGroup to compare against (righthand side of inequality operator)
Returns
true for the target and rhs_ being different UI widget groups, false otherwise

◆ operator=()

virtual WidgetGroup & hdi::core::WidgetGroup::operator= ( const WidgetGroup rhs_)
virtual

Allows one WidgetGroup object to be assigned from another.

Author
GW
Date
02/2015
Parameters
rhs_Righthand side of the = operator; the object to copy values from
Returns
The target WidgetGroup object, but with its value updated to match that of rhs_

◆ operator==()

virtual bool hdi::core::WidgetGroup::operator== ( const WidgetGroup rhs_) const
virtual

Tests whether a given WidgetGroup object is the same as another.

Author
GW
Date
02/2015
Parameters
rhs_WidgetGroup to compare against (righthand side of equality operator)
Returns
true for the target and rhs_ being the same UI widget group, false otherwise

◆ origin()

virtual Point hdi::core::WidgetGroup::origin ( ) const
virtual

Gets the top-left-most point for the contained widgets.

Author
GW
Date
02/2015
Returns
The top-left of all the contained widgets, or (0,0) if none are in the group

◆ remove()

virtual void hdi::core::WidgetGroup::remove ( const Widget w_)
virtual

Removes a widget from the group.

Author
GW
Date
02/2015
Parameters
w_Widget to remove
Note
If the widget isn't in the group, this method will bail early.
If the target WidgetGroup has already been added to a Window object, then the widget will automatically be removed from the same Window object.

◆ setEnabled()

virtual void hdi::core::WidgetGroup::setEnabled ( const bool  enable_)
virtual

Enables or disables all the contained widgets.

Author
GW
Date
05/2017
Parameters
enable_true to enable, false to disable

◆ setOrigin()

virtual void hdi::core::WidgetGroup::setOrigin ( const Point pt_)
virtual

Sets the top-left-most point for the contained widgets.

Author
GW
Date
02/2015
Parameters
pt_New top-left point for the top-left-most contained widgets; all other contained widgets will have their origins adjusted by the same delta

◆ setVisible()

virtual void hdi::core::WidgetGroup::setVisible ( const bool  visible_)
virtual

Shows or hides all the contained widgets.

Author
GW
Date
05/2017
Parameters
visible_true to show, false to hide

◆ update()

virtual void hdi::core::WidgetGroup::update ( )
virtual

Force all the contained widgets to update (i.e. cause them to redraw)

Author
GW
Date
05/2017

◆ widgets()

virtual const WidgetVector hdi::core::WidgetGroup::widgets ( ) const
virtual

Gets a vector of the contained widgets.

Author
GW
Date
02/2015
Returns
A vector containing all Widget objects in the target group

◆ width()

virtual double hdi::core::WidgetGroup::width ( ) const
virtual

Gets the total width of all the contained widgets.

Author
GW
Date
02/2015
Returns
The width from the leftmost widget to the rightmost widget