Hot Door CORE 0.8.2
Adobe® Illustrator® Plug-in Library
Loading...
Searching...
No Matches
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.
 
 ControlBar (const ControlBar &cb_)
 Constructs a new ControlBar object from an existing ControlBar object (copy constructor)
 
 ControlBar (const Rect &frame_, const double minWidth_, const double maxWidth_)
 Constructs a new ControlBar object.
 
virtual ~ControlBar ()
 Destructs a ControlBar object.
 
virtual ControlBaroperator= (const ControlBar &rhs_)
 Allows one ControlBar object to be assigned from another.
 
virtual ControlBarclone () const
 Convenience method to clone a ControlBar object on the heap.
 
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)
 
virtual PlatformControlBarPtr platformControlBar () const
 Gets the platform-specific control bar, around which the target object is wrapped.
 
virtual void show ()
 Shows the control bar.
 
virtual void hide ()
 Hides the control bar.
 
virtual bool visible () const
 Gets whether the control bar is visible.
 
virtual void setVisible (const bool visible_)
 Sets control bar visibility.
 
virtual double width () const
 Gets the current width of the control bar.
 
virtual void setWidth (const double w_)
 Sets the width of the control bar.
 
virtual void move (const Point &loc_)
 Moves the control bar.
 
virtual bool addWidget (const Widget &widget_)
 Adds a widget (label, button, text field, etc.) to the control bar.
 
virtual bool removeWidget (const Widget &widget_)
 Removes a widget (label, button, text field, etc.) from the control bar.
 
virtual Callback *const showCallback () const
 Gets the registered callback for the control bar showing, or NULL if none.
 
virtual void setShowCallback (const Callback &cb_)
 Sets/updates the callback for the control bar showing.
 
virtual Callback *const hideCallback () const
 Gets the registered callback for the control bar hiding, or NULL if none.
 
virtual void setHideCallback (const Callback &cb_)
 Sets/updates the callback for the control bar hiding.
 
virtual Callback *const resizeCallback () const
 Gets the callback set for the control bar resize, or NULL if none.
 
virtual void setResizeCallback (const Callback &cb_)
 Sets/updates the callback for the control bar resize.
 
virtual void update () const
 Forces the widgets in the control bar to update/redraw.
 
- Public Member Functions inherited from hdi::core::Window
virtual ~Window ()
 Destructs a Window object.
 
virtual Windowclone () const =0
 Convenience method to clone a Window object, taking its subclass type into account for proper memory management.
 
virtual bool isEmpty () const
 Gets whether the target Window object is empty (constructed with the default ctor)
 
virtual WindowType windowType ()
 Gets the type of window.
 
virtual bool operator== (const Window &rhs_) const
 Tests whether a given Window object is the same as another.
 
virtual bool operator!= (const Window &rhs_) const
 Tests whether a given Window object is not the same as another.
 
virtual bool visible () const =0
 Gets whether the window is visible.
 
virtual void show ()=0
 Shows the window.
 
virtual const WidgetVector widgets () const
 Gets a list of all widgets contained by the target window.
 
virtual bool addWidget (const Widget &widget_)
 Adds a widget (label, button, text field, etc.) to the window.
 
virtual bool removeWidget (const Widget &widget_)
 Removes a widget (label, button, text field, etc.) from the window.
 
virtual bool addWidgetGroup (const WidgetGroup &wg_)
 Adds a widget group to the window.
 
virtual bool removeWidgetGroup (const WidgetGroup &wg_)
 Removes a widget group from the window.
 
virtual TabOrder *const tabOrder () const
 Gets the tab order object for the window.
 
virtual void update () const =0
 Forces the widgets in the modal dialog to update/redraw.
 
virtual double scalingFactor () const
 Gets the factor by which the UI is scaled for the given window (i.e. for HiDPI support)
 

Static Public Attributes

static const double typicalHeight
 Most Illustrator control bars are this height, at 1x resolution.
 

Additional Inherited Members

- Public Types inherited from hdi::core::Window
typedef std::vector< std::shared_ptr< Widget > > WidgetVector
 
- Protected Member Functions inherited from hdi::core::Window
 Window ()
 Constructs an empty Window object.
 
 Window (const Window &w_)
 Constructs a new Window object from an existing Window object (copy constructor)
 
 Window (const WindowType type_)
 Constructs a Window object.
 
virtual Windowoperator= (const Window &)
 Internal use only.
 
- 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

◆ ControlBar() [1/3]

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

◆ ControlBar() [2/3]

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

◆ ControlBar() [3/3]

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, at 1x resolution
minWidth_Minimum width of the control bar, at 1x resolution
maxWidth_Maximum width of the control bar, at 1x resolution
Note
Once the size is set by the constructor, only the width can be changed thereafter

◆ ~ControlBar()

virtual hdi::core::ControlBar::~ControlBar ( )
virtual

Destructs a ControlBar object.

Author
GW
Date
09/2013

Member Function Documentation

◆ addWidget()

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.

◆ clone()

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.

◆ destroy()

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.

◆ hide()

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

Hides the control bar.

Author
GW
Date
09/2013

◆ hideCallback()

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

◆ move()

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, in 1x resolution coordinates

◆ operator=()

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_

◆ platformControlBar()

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.

◆ removeWidget()

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.

◆ resizeCallback()

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

◆ setHideCallback()

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

◆ setResizeCallback()

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

◆ setShowCallback()

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

◆ setVisible()

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

◆ setWidth()

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, at 1x resolution

◆ show()

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

Shows the control bar.

Author
GW
Date
09/2013

Implements hdi::core::Window.

◆ showCallback()

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

◆ update()

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.

◆ visible()

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.

◆ width()

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, at 1x resolution