Hot Door CORE  0.7.0
Adobe® Illustrator® Plug-in Library
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< Widget * > WidgetVector
 

Public Member Functions

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

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

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

Constructs a new widget group.

Author
GW
Date
02/2015
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
virtual hdi::core::WidgetGroup::~WidgetGroup ( )
virtual

WidgetGroup destructor.

Author
GW
Date
02/2015

Member Function Documentation

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.
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.
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
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
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
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_
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
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
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.
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
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
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