Hot Door CORE  0.7.0
Adobe® Illustrator® Plug-in Library
Public Member Functions | Static Public Attributes | List of all members
hdi::core::ControlBar Class Reference

Used to add a control bar to Illustrator's UI and contain various UI widgets. More...

#include <hdicoreControlBar.h>

Inheritance diagram for hdi::core::ControlBar:
Inheritance graph
[legend]
Collaboration diagram for hdi::core::ControlBar:
Collaboration graph
[legend]

Public Member Functions

 ControlBar ()
 Constructs an empty ControlBar object. More...
 
 ControlBar (const ControlBar &cb_)
 Constructs a new ControlBar object from an existing ControlBar object (copy constructor) More...
 
 ControlBar (const Rect &frame_, const double minWidth_, const double maxWidth_)
 Constructs a new ControlBar object. More...
 
virtual ~ControlBar ()
 Destructs a ControlBar object. More...
 
virtual ControlBaroperator= (const ControlBar &rhs_)
 Allows one ControlBar object to be assigned from another. More...
 
virtual ControlBarclone () const
 Convenience method to clone a ControlBar object on the heap. More...
 
virtual void destroy ()
 Destroys the UI control bar, converting the target object to an empty ControlBar object (see the default constructor for more info on empty ControlBar objects) More...
 
virtual PlatformControlBarPtr platformControlBar () const
 Gets the platform-specific control bar, around which the target object is wrapped. More...
 
virtual void show ()
 Shows the control bar. More...
 
virtual void hide ()
 Hides the control bar. More...
 
virtual bool visible () const
 Gets whether the control bar is visible. More...
 
virtual void setVisible (const bool visible_)
 Sets control bar visibility. More...
 
virtual double width () const
 Gets the current width of the control bar. More...
 
virtual void setWidth (const double w_)
 Sets the width of the control bar. More...
 
virtual void move (const Point &loc_)
 Moves the control bar. More...
 
virtual bool addWidget (const Widget &widget_)
 Adds a widget (label, button, text field, etc.) to the control bar. More...
 
virtual bool removeWidget (const Widget &widget_)
 Removes a widget (label, button, text field, etc.) from the control bar. More...
 
virtual Callback *const showCallback () const
 Gets the registered callback for the control bar showing, or NULL if none. More...
 
virtual void setShowCallback (const Callback &cb_)
 Sets/updates the callback for the control bar showing. More...
 
virtual Callback *const hideCallback () const
 Gets the registered callback for the control bar hiding, or NULL if none. More...
 
virtual void setHideCallback (const Callback &cb_)
 Sets/updates the callback for the control bar hiding. More...
 
virtual Callback *const resizeCallback () const
 Gets the callback set for the control bar resize, or NULL if none. More...
 
virtual void setResizeCallback (const Callback &cb_)
 Sets/updates the callback for the control bar resize. More...
 
virtual void update () const
 Forces the widgets in the control bar to update/redraw. More...
 
- Public Member Functions inherited from hdi::core::Window
virtual ~Window ()
 Destructs a Window object. More...
 
virtual bool isEmpty () const
 Gets whether the target Window object is empty (constructed with the default ctor) More...
 
virtual WindowType windowType ()
 Gets the type of window. More...
 
virtual bool operator== (const Window &rhs_) const
 Tests whether a given Window object is the same as another. More...
 
virtual bool operator!= (const Window &rhs_) const
 Tests whether a given Window object is not the same as another. More...
 
virtual const WidgetVector widgets () const
 Gets a list of all widgets contained by the target window. More...
 
virtual bool addWidgetGroup (const WidgetGroup &wg_)
 Adds a widget group to the window. More...
 
virtual bool removeWidgetGroup (const WidgetGroup &wg_)
 Removes a widget group from the window. More...
 
virtual TabOrder *const tabOrder () const
 Gets the tab order object for the window. More...
 

Static Public Attributes

static const double typicalHeight
 Most Illustrator control bars are this height.
 

Additional Inherited Members

- Public Types inherited from hdi::core::Window
typedef std::vector< Widget * > WidgetVector
 
- Protected Member Functions inherited from hdi::core::Window
 Window ()
 Constructs an empty Window object. More...
 
 Window (const Window &w_)
 Constructs a new Window object from an existing Window object (copy constructor) More...
 
 Window (const WindowType type_)
 Constructs a Window object. More...
 
virtual Windowoperator= (const Window &)
 Internal use only. More...
 
- Protected Attributes inherited from hdi::core::Window
void * _data
 Private implementation data.
 

Detailed Description

Used to add a control bar to Illustrator's UI and contain various UI widgets.

Constructor & Destructor Documentation

hdi::core::ControlBar::ControlBar ( )

Constructs an empty ControlBar object.

Author
GW
Date
10/2013
Note
To test if a ControlBar object is empty, call isEmpty() on it
Empty ControlBar objects do not relate to any actual UI control bar; they are designed to be "receivers" of some other ControlBar object via the overloaded assignment operator. Empty ControlBar objects are useless until such time (though it is safe to call any of their methods).
hdi::core::ControlBar::ControlBar ( const ControlBar cb_)

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

Author
GW
Date
10/2013
Parameters
cb_Existing ControlBar object
hdi::core::ControlBar::ControlBar ( const Rect frame_,
const double  minWidth_,
const double  maxWidth_ 
)

Constructs a new ControlBar object.

Author
GW
Date
09/2013
Parameters
frame_Location and size (width and height) of the control bar
minWidth_Minimum width of the control bar
maxWidth_Maximum width of the control bar
Note
Once the size is set by the constructor, only the width can be changed thereafter
virtual hdi::core::ControlBar::~ControlBar ( )
virtual

Destructs a ControlBar object.

Author
GW
Date
09/2013

Member Function Documentation

virtual bool hdi::core::ControlBar::addWidget ( const Widget widget_)
virtual

Adds a widget (label, button, text field, etc.) to the control bar.

Author
GW
Date
09/2013
Parameters
widget_Widget to place in the control bar
Returns
true if the widget was added successfully

Reimplemented from hdi::core::Window.

virtual ControlBar* hdi::core::ControlBar::clone ( ) const
virtual

Convenience method to clone a ControlBar object on the heap.

Author
GW
Date
10/2013
Returns
A pointer to the new ControlBar object
Note
If you subclass ControlBar, you MUST overload this method yourself! If you don't and/or your clone() method does not return an instance of your ControlBar subclass, you will experience "object slicing" when e.g. adding the control bar to a window collection.
Warning
The caller must manage the memory for the returned ControlBar object.

Implements hdi::core::Window.

virtual void hdi::core::ControlBar::destroy ( )
virtual

Destroys the UI control bar, converting the target object to an empty ControlBar object (see the default constructor for more info on empty ControlBar objects)

Author
GW
Date
10/2013
Note
This method must be called for any existing control bars by the time the plugin is shutting down. If you no longer retain any of your own references to a control bar then the lib will call this method for you as it is shutting down.
virtual void hdi::core::ControlBar::hide ( )
virtual

Hides the control bar.

Author
GW
Date
09/2013
virtual Callback* const hdi::core::ControlBar::hideCallback ( ) const
virtual

Gets the registered callback for the control bar hiding, or NULL if none.

Author
GW
Date
12/2015
Returns
A pointer to the currently registered "control bar hide" callback
virtual void hdi::core::ControlBar::move ( const Point loc_)
virtual

Moves the control bar.

Author
GW
Date
09/2013
Parameters
loc_New top-left position for the control bar
virtual ControlBar& hdi::core::ControlBar::operator= ( const ControlBar rhs_)
virtual

Allows one ControlBar object to be assigned from another.

Author
GW
Date
10/2013
Parameters
rhs_Righthand side of the = operator; the object to copy values from
Returns
The target ControlBar object, but with its value updated to match that of rhs_
virtual PlatformControlBarPtr hdi::core::ControlBar::platformControlBar ( ) const
virtual

Gets the platform-specific control bar, around which the target object is wrapped.

Author
GW
Date
11/2013
Returns
Pointer to platform-specific control bar. See PlatformControlBarPtr typedef.
Note
Generally, you shouldn't need to call this method. Only use it if you know what you're doing. If a specific piece of UI functionality is not handled by this class (or related classes), then it should probably be added to the hdi_core library.
virtual bool hdi::core::ControlBar::removeWidget ( const Widget widget_)
virtual

Removes a widget (label, button, text field, etc.) from the control bar.

Author
GW
Date
09/2013
Parameters
widget_Widget to remove from the control bar
Returns
true if the widget was removed successfully

Reimplemented from hdi::core::Window.

virtual Callback* const hdi::core::ControlBar::resizeCallback ( ) const
virtual

Gets the callback set for the control bar resize, or NULL if none.

Author
GW
Date
12/2015
Returns
A pointer to the currently registered "control bar resize" callback
virtual void hdi::core::ControlBar::setHideCallback ( const Callback cb_)
virtual

Sets/updates the callback for the control bar hiding.

Author
GW
Date
12/2015
Parameters
cb_New callback for a user hiding the control bar
virtual void hdi::core::ControlBar::setResizeCallback ( const Callback cb_)
virtual

Sets/updates the callback for the control bar resize.

Author
GW
Date
12/2015
Parameters
cb_New callback for a user resizing the control bar
virtual void hdi::core::ControlBar::setShowCallback ( const Callback cb_)
virtual

Sets/updates the callback for the control bar showing.

Author
GW
Date
12/2015
Parameters
cb_New callback for a user showing the control bar
virtual void hdi::core::ControlBar::setVisible ( const bool  visible_)
virtual

Sets control bar visibility.

Author
GW
Date
09/2013
Parameters
visible_true to show the control bar, false to hide
Note
This method simply calls show() or hide() as appropriate
virtual void hdi::core::ControlBar::setWidth ( const double  w_)
virtual

Sets the width of the control bar.

Author
GW
Date
09/2013
Parameters
w_New width in pixels
virtual void hdi::core::ControlBar::show ( )
virtual

Shows the control bar.

Author
GW
Date
09/2013

Implements hdi::core::Window.

virtual Callback* const hdi::core::ControlBar::showCallback ( ) const
virtual

Gets the registered callback for the control bar showing, or NULL if none.

Author
GW
Date
12/2015
Returns
A pointer to the currently registered "control bar show" callback
virtual void hdi::core::ControlBar::update ( ) const
virtual

Forces the widgets in the control bar to update/redraw.

Author
GW
Date
09/2013

Implements hdi::core::Window.

virtual bool hdi::core::ControlBar::visible ( ) const
virtual

Gets whether the control bar is visible.

Author
GW
Date
09/2013
Returns
true if the control bar is visible, false otherwise

Implements hdi::core::Window.

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

Gets the current width of the control bar.

Author
GW
Date
09/2013
Returns
The current width of the target control bar