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

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

#include <hdicorePanel.h>

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

Public Member Functions

 Panel ()
 Constructs an empty Panel object. More...
 
 Panel (const Panel &p_)
 Constructs a new Panel object from an existing Panel object (copy constructor) More...
 
 Panel (const std::string &name_, const Size &size_, const bool resizableW_, const bool resizableH_, const int16_t lightIconID_=noImageID, const int16_t darkIconID_=noImageID)
 Constructs a new Panel object. More...
 
virtual ~Panel ()
 Destructs a Panel object. More...
 
virtual Paneloperator= (const Panel &rhs_)
 Allows one Panel object to be assigned from another. More...
 
virtual Panelclone () const
 Convenience method to clone a Panel object on the heap. More...
 
virtual void destroy ()
 Destroys the UI panel, converting the target object to an empty Panel object (see the default constructor for more info on empty Panel objects) More...
 
virtual PlatformPanelPtr platformPanel () const
 Gets the platform-specific panel, around which the target object is wrapped. More...
 
virtual void show ()
 Shows the panel. More...
 
virtual void hide ()
 Hides the panel. More...
 
virtual bool visible () const
 Gets whether the panel is visible. More...
 
virtual void setVisible (const bool visible_)
 Sets panel visibility. More...
 
virtual Rect frame () const
 Gets the panel's frame. More...
 
virtual void setFrame (const Rect &frame_)
 Sets the panel's frame (location and size) More...
 
virtual void setSize (const Size &s_)
 Sets the panel's dimensions. More...
 
virtual void setHeight (const double height_)
 Sets the panel's height (keeping the location and width the same) More...
 
virtual bool addWidget (const Widget &widget_)
 Adds a widget (label, button, text field, etc.) to the panel. More...
 
virtual bool removeWidget (const Widget &widget_)
 Removes a widget (label, button, text field, etc.) from the panel. More...
 
std::string title () const
 Gets the current panel title. More...
 
void setTitle (const std::string &title_)
 Sets the current panel title. More...
 
virtual Flyout *const flyoutMenu () const
 Gets the current flyout menu for the panel, or NULL if none. More...
 
virtual void setFlyoutMenu (const Flyout &flyout_)
 Sets/updates the flyout menu for the panel. More...
 
virtual Callback *const showCallback () const
 Gets the registered callback for the panel showing, or NULL if none. More...
 
virtual void setShowCallback (const Callback &cb_)
 Sets/updates the callback for the panel showing. More...
 
virtual Callback *const hideCallback () const
 Gets the registered callback for the panel hiding, or NULL if none. More...
 
virtual void setHideCallback (const Callback &cb_)
 Sets/updates the callback for the panel hiding. More...
 
virtual Callback *const resizeCallback () const
 Gets the callback set for the panel resize, or NULL if none. More...
 
virtual void setResizeCallback (const Callback &cb_)
 Sets/updates the callback for the panel resize. More...
 
virtual void update () const
 Forces the widgets in the panel to update/redraw (including the flyout, if any) 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 int16_t noImageID = 0
 Default panel image ID to indicate that it has no images. More...
 
static const double typicalWidth
 Most Illustrator panels are this width.
 

Friends

class Flyout
 
plugin::Panel * __accessImpl (const Panel &)
 
Panel __accessCtor (plugin::Panel *const)
 

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 panel to Illustrator's UI and contain various UI widgets.

Constructor & Destructor Documentation

hdi::core::Panel::Panel ( )

Constructs an empty Panel object.

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

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

Author
GW
Date
10/2013
Parameters
p_Existing Panel object
hdi::core::Panel::Panel ( const std::string &  name_,
const Size size_,
const bool  resizableW_,
const bool  resizableH_,
const int16_t  lightIconID_ = noImageID,
const int16_t  darkIconID_ = noImageID 
)

Constructs a new Panel object.

Author
GW
Date
09/2013
Parameters
name_Name/title of the panel (must be unique), as UTF-8
size_Size (width and height) of the panel
resizableW_Whether the panel width can be resized
resizableH_Whether the panel height can be resized
lightIconID_PNGI resource ID for the light interface icon
darkIconID_PNGI resource ID for the dark interface icon
Note
If resizable_ is true, then the provided width will be the minimum and maximum width, and the provided height will be the minimum height (no maximum height is set).
virtual hdi::core::Panel::~Panel ( )
virtual

Destructs a Panel object.

Author
GW
Date
09/2013

Member Function Documentation

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

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

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

Reimplemented from hdi::core::Window.

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

Convenience method to clone a Panel object on the heap.

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

Implements hdi::core::Window.

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

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

Author
GW
Date
10/2013
Note
This method must be called for any existing panels by the time the plugin is shutting down. If you no longer retain any of your own references to a panel then the lib will call this method for you as it is shutting down.
virtual Flyout* const hdi::core::Panel::flyoutMenu ( ) const
virtual

Gets the current flyout menu for the panel, or NULL if none.

Author
GW
Date
09/2013
Returns
A Flyout object pointer, or NULL if none
Note
The Panel object is not aware of any changes made to the returned Flyout object; you must call update() to "register" changes
virtual Rect hdi::core::Panel::frame ( ) const
virtual

Gets the panel's frame.

Author
GW
Date
09/2013
Returns
A Rect object representing the panel's location and dimensions
virtual void hdi::core::Panel::hide ( )
virtual

Hides the panel.

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

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

Author
GW
Date
09/2013
Returns
A pointer to the currently registered "panel hide" callback
virtual Panel& hdi::core::Panel::operator= ( const Panel rhs_)
virtual

Allows one Panel 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 Panel object, but with its value updated to match that of rhs_
virtual PlatformPanelPtr hdi::core::Panel::platformPanel ( ) const
virtual

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

Author
GW
Date
11/2013
Returns
Pointer to platform-specific panel. See PlatformPanelPtr 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::Panel::removeWidget ( const Widget widget_)
virtual

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

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

Reimplemented from hdi::core::Window.

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

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

Author
GW
Date
09/2013
Returns
A pointer to the currently registered "panel resize" callback
virtual void hdi::core::Panel::setFlyoutMenu ( const Flyout flyout_)
virtual

Sets/updates the flyout menu for the panel.

Author
GW
Date
09/2013
Parameters
flyout_New flyout menu
virtual void hdi::core::Panel::setFrame ( const Rect frame_)
virtual

Sets the panel's frame (location and size)

Author
GW
Date
09/2013
Parameters
frame_New panel frame
virtual void hdi::core::Panel::setHeight ( const double  height_)
virtual

Sets the panel's height (keeping the location and width the same)

Author
GW
Date
09/2013
Parameters
height_New panel height
virtual void hdi::core::Panel::setHideCallback ( const Callback cb_)
virtual

Sets/updates the callback for the panel hiding.

Author
GW
Date
09/2013
Parameters
cb_New callback for a user hiding the panel
virtual void hdi::core::Panel::setResizeCallback ( const Callback cb_)
virtual

Sets/updates the callback for the panel resize.

Author
GW
Date
09/2013
Parameters
cb_New callback for a user resizing the panel
virtual void hdi::core::Panel::setShowCallback ( const Callback cb_)
virtual

Sets/updates the callback for the panel showing.

Author
GW
Date
09/2013
Parameters
cb_New callback for a user showing the panel
virtual void hdi::core::Panel::setSize ( const Size s_)
virtual

Sets the panel's dimensions.

Author
GW
Date
09/2015
Parameters
s_New panel size
void hdi::core::Panel::setTitle ( const std::string &  title_)

Sets the current panel title.

Author
GW
Date
12/2015
Parameters
title_New string value for the panel title, as UTF-8
virtual void hdi::core::Panel::setVisible ( const bool  visible_)
virtual

Sets panel visibility.

Author
GW
Date
09/2013
Parameters
visible_true to show the panel, false to hide
Note
This method simply calls show() or hide() as appropriate
virtual void hdi::core::Panel::show ( )
virtual

Shows the panel.

Author
GW
Date
09/2013

Implements hdi::core::Window.

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

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

Author
GW
Date
09/2013
Returns
A pointer to the currently registered "panel show" callback
std::string hdi::core::Panel::title ( ) const

Gets the current panel title.

Author
GW
Date
12/2015
Returns
String value for the panel title, as UTF-8
virtual void hdi::core::Panel::update ( ) const
virtual

Forces the widgets in the panel to update/redraw (including the flyout, if any)

Author
GW
Date
09/2013

Implements hdi::core::Window.

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

Gets whether the panel is visible.

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

Implements hdi::core::Window.

Member Data Documentation

const int16_t hdi::core::Panel::noImageID = 0
static

Default panel image ID to indicate that it has no images.

Note
Do not use 0 as your own PNGI image ID!