Hot Door CORE 0.8.2
Adobe® Illustrator® Plug-in Library
Loading...
Searching...
No Matches
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.
 
 Panel (const Panel &p_)
 Constructs a new Panel object from an existing Panel object (copy constructor)
 
 Panel (const std::string &name_, const Size &size_, const bool resizableW_, const bool resizableH_, const ImageIDs &iconIDs_)
 Constructs a new Panel object.
 
 Panel (const std::string &name_, const Size &size_, const bool resizableW_, const bool resizableH_, const SVGIDs &iconIDs_)
 Constructs a new Panel object.
 
virtual ~Panel ()
 Destructs a Panel object.
 
virtual Paneloperator= (const Panel &rhs_)
 Allows one Panel object to be assigned from another.
 
virtual Panelclone () const
 Convenience method to clone a Panel object on the heap.
 
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)
 
virtual PlatformPanelPtr platformPanel () const
 Gets the platform-specific panel, around which the target object is wrapped.
 
virtual void show ()
 Shows the panel.
 
virtual void hide ()
 Hides the panel.
 
virtual bool visible () const
 Gets whether the panel is visible.
 
virtual void setVisible (const bool visible_)
 Sets panel visibility.
 
virtual Rect frame () const
 Gets the panel's frame.
 
virtual void setFrame (const Rect &frame_)
 Sets the panel's frame (location and size)
 
virtual void setSize (const Size &s_)
 Sets the panel's dimensions.
 
virtual void setHeight (const double height_)
 Sets the panel's height (keeping the location and width the same)
 
virtual Size minimumSize () const
 Gets the minimum panel size, if the panel is resizeable in any direction (otherwise, the minimum matches the current size)
 
virtual void setMinimumSize (const Size &min_)
 Sets the minimum panel size, if the panel is resizeable in any direction (otherwise, the minimum always matches the current size)
 
virtual Size maximumSize () const
 Gets the maximum panel size, if the panel is resizeable in any direction (otherwise, the maximum matches the current size)
 
virtual void setMaximumSize (const Size &max_)
 Sets the maximum panel size, if the panel is resizeable in any direction (otherwise, the maximum always matches the current size)
 
virtual bool addWidget (const Widget &widget_)
 Adds a widget (label, button, text field, etc.) to the panel.
 
virtual bool removeWidget (const Widget &widget_)
 Removes a widget (label, button, text field, etc.) from the panel.
 
std::string title () const
 Gets the current panel title.
 
void setTitle (const std::string &title_)
 Sets the current panel title.
 
virtual Flyout *const flyoutMenu () const
 Gets the current flyout menu for the panel, or NULL if none.
 
virtual void setFlyoutMenu (const Flyout &flyout_)
 Sets/updates the flyout menu for the panel.
 
virtual Callback *const showCallback () const
 Gets the registered callback for the panel showing, or NULL if none.
 
virtual void setShowCallback (const Callback &cb_)
 Sets/updates the callback for the panel showing.
 
virtual Callback *const hideCallback () const
 Gets the registered callback for the panel hiding, or NULL if none.
 
virtual void setHideCallback (const Callback &cb_)
 Sets/updates the callback for the panel hiding.
 
virtual Callback *const resizeCallback () const
 Gets the callback set for the panel resize, or NULL if none.
 
virtual void setResizeCallback (const Callback &cb_)
 Sets/updates the callback for the panel resize.
 
virtual void update () const
 Forces the widgets in the panel to update/redraw (including the flyout, if any)
 
- 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 typicalWidth
 Most Illustrator panels are this width.
 

Friends

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

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

Constructor & Destructor Documentation

◆ Panel() [1/4]

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

◆ Panel() [2/4]

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

◆ Panel() [3/4]

hdi::core::Panel::Panel ( const std::string &  name_,
const Size size_,
const bool  resizableW_,
const bool  resizableH_,
const ImageIDs iconIDs_ 
)

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, in 1x resolution coordinates
resizableW_Whether the panel width can be resized
resizableH_Whether the panel height can be resized
iconIDs_PNGI resource IDs for the dock 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).

◆ Panel() [4/4]

hdi::core::Panel::Panel ( const std::string &  name_,
const Size size_,
const bool  resizableW_,
const bool  resizableH_,
const SVGIDs iconIDs_ 
)

Constructs a new Panel object.

Author
GW
Date
10/2018
Parameters
name_Name/title of the panel (must be unique), as UTF-8
size_Size (width and height) of the panel, in 1x resolution coordinates
resizableW_Whether the panel width can be resized
resizableH_Whether the panel height can be resized
iconIDs_SVG resource IDs for the dock 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).

◆ ~Panel()

virtual hdi::core::Panel::~Panel ( )
virtual

Destructs a Panel object.

Author
GW
Date
09/2013

Member Function Documentation

◆ addWidget()

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.

◆ clone()

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.

◆ destroy()

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.

◆ flyoutMenu()

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

◆ frame()

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

◆ hide()

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

Hides the panel.

Author
GW
Date
09/2013

◆ hideCallback()

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

◆ maximumSize()

virtual Size hdi::core::Panel::maximumSize ( ) const
virtual

Gets the maximum panel size, if the panel is resizeable in any direction (otherwise, the maximum matches the current size)

Author
GW
Date
08/2018
Returns
The maximum panel dimensions, at 1x resolution

◆ minimumSize()

virtual Size hdi::core::Panel::minimumSize ( ) const
virtual

Gets the minimum panel size, if the panel is resizeable in any direction (otherwise, the minimum matches the current size)

Author
GW
Date
08/2018
Returns
The minimum panel dimensions, at 1x resolution

◆ operator=()

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_

◆ platformPanel()

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.

◆ removeWidget()

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.

◆ resizeCallback()

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

◆ setFlyoutMenu()

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

◆ setFrame()

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

◆ setHeight()

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

◆ setHideCallback()

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

◆ setMaximumSize()

virtual void hdi::core::Panel::setMaximumSize ( const Size max_)
virtual

Sets the maximum panel size, if the panel is resizeable in any direction (otherwise, the maximum always matches the current size)

Author
GW
Date
08/2018
Parameters
min_The new maximum panel dimensions, at 1x resolution; ignored if the panel is not resizeable

◆ setMinimumSize()

virtual void hdi::core::Panel::setMinimumSize ( const Size min_)
virtual

Sets the minimum panel size, if the panel is resizeable in any direction (otherwise, the minimum always matches the current size)

Author
GW
Date
08/2018
Parameters
min_The new minimum panel dimensions, at 1x resolution; ignored if the panel is not resizeable

◆ setResizeCallback()

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

◆ setShowCallback()

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

◆ setSize()

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

◆ setTitle()

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

◆ setVisible()

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

◆ show()

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

Shows the panel.

Author
GW
Date
09/2013

Implements hdi::core::Window.

◆ showCallback()

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

◆ title()

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

◆ update()

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.

◆ visible()

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.