Hot Door CORE 0.8.2
Adobe® Illustrator® Plug-in Library
|
Popup menu widget, allowing for a single preset entry to be chosen at a time. More...
#include <hdicorePopupMenu.h>
Public Types | |
typedef std::vector< PopupEntry > | EntryVector |
Public Types inherited from hdi::core::Widget | |
enum | Type { UnknownType = 0 , BoxType = 10 , ButtonType = 20 , CheckboxType = 30 , ColumnViewType = 40 , ComboBoxType = 50 , ColorWellType = 60 , CustomType = 70 , DividerType = 80 , HierarchicalColumnViewType = 85 , HierarchicalViewType = 90 , LabelType = 100 , ListViewType = 110 , PopupMenuType = 120 , RadioButtonType = 130 , SliderType = 140 , StepperType = 150 , TextFieldType = 160 , TextViewType = 170 , WebViewType = 180 } |
Supported widget types. | |
Public Member Functions | |
PopupMenu () | |
Constructs an empty PopupMenu object. | |
PopupMenu (const PopupMenu &popup_) | |
Constructs a new PopupMenu object from an existing PopupMenu object (copy constructor) | |
PopupMenu (const Point &loc_, const double width_) | |
Constructs an empty PopupMenu widget at a given location of a given width. | |
PopupMenu (const Point &loc_, const double width_, const EntryVector &entries_, const int32_t initialIndex_) | |
Constructs a PopupMenu widget with a list of entries and an initial index selection. | |
PopupMenu (const Point &loc_, const double width_, const EntryVector &entries_, const std::string &initialID_) | |
Constructs a PopupMenu widget with a list of entries and an initial ID selection. | |
virtual | ~PopupMenu () |
PopupMenu destructor. | |
virtual PopupMenu & | operator= (const PopupMenu &rhs_) |
Allows one PopupMenu object to be assigned from another. | |
virtual PopupMenu * | clone () const |
Convenience method to clone a PopupMenu object on the heap. | |
virtual PopupMenu * | duplicate () const |
Convenience method to duplicate a PopupMenu object, creating a new and identical UI element to the target (but not belonging to the same containing window) | |
virtual void | selectUnknownEntry () |
In the case of a mixed popup state, this will create and select a blank entry. | |
virtual void | deselectUnknownEntry () |
In the case of a (prior) mixed popup state, this will deselect and destroy the blank entry. | |
virtual int32_t | currentIndex () const |
Gets the index of the currently selected entry. | |
virtual bool | setCurrentIndex (const int32_t index_) |
Sets the currently selected entry by index. | |
virtual std::string | currentID () const |
Gets the ID of the currently selected entry. | |
virtual bool | setCurrentID (const std::string &id_) |
Sets the currently selected entry by ID. | |
virtual std::string | currentValue () const |
Gets the string value of the currently selected entry. | |
virtual bool | setCurrentValue (const std::string &value_) |
Sets the currently selected entry by string value. | |
virtual std::unique_ptr< PopupEntry > | currentEntry () const |
Gets the current entry object. | |
virtual bool | currentUserData (void *&data__) const |
Gets the user data for the current entry. | |
virtual const std::vector< std::shared_ptr< PopupEntry > > *const | entries () const |
Gets the entries vector. | |
virtual void | setEntries (const EntryVector &entries_) |
Allows the entries in an popup menu to be changed out entirely. | |
virtual bool | hasEntry (const std::string &id_) const |
Gets whether the entries vector already contains an entry, based on its ID. | |
virtual std::shared_ptr< PopupEntry > | entryWithID (const std::string &id_) const |
Gets the entry with the given ID, provided it exists within the widget. | |
virtual bool | pushEntry (const PopupEntry &entry_) |
Pushes an entry onto the list (i.e. at the end) | |
virtual bool | popEntry (PopupEntry &entry__) |
Pops an entry off the list (i.e. from the end) | |
virtual bool | insertEntry (const std::string &id_, const PopupEntry &entry_) |
Inserts an entry into the list of entries at a given position. | |
virtual bool | removeEntry (const std::string &id_, PopupEntry &entry__) |
Removes a specific entry from the list of entries. | |
virtual void | clearEntries () |
Clears all entries contained by the widget. | |
virtual void | valueChanged () |
Simulates the popup menu having its value changed. | |
virtual Callback *const | valueChangedCallback () const |
Gets the value changed callback for the popup menu. | |
virtual void | setValueChangedCallback (const Callback &callback_) |
Sets the value changed callback. | |
virtual void | update () |
Force the popup menu to update its entries. | |
Public Member Functions inherited from hdi::core::Widget | |
virtual | ~Widget () |
Destructs a Widget. | |
virtual Widget * | clone () const =0 |
Convenience method to clone a Widget object in memory, taking its subclass type into account. | |
virtual Widget * | duplicate () const =0 |
Convenience method to duplicate a Widget object, creating a new and identical UI element to the target (but not belonging to the same containing window) | |
virtual PlatformWidgetPtr | platformWidget () const |
Gets the platform-specific widget, around which the target object is wrapped. | |
virtual bool | isEmpty () const |
Gets whether the target Widget object is empty (constructed with the default ctor) | |
virtual bool | operator== (const Widget &rhs_) const |
Tests whether a given Widget object is the same as another. | |
virtual bool | operator!= (const Widget &rhs_) const |
Tests whether a given Widget object is not the same as another. | |
virtual Type | type () const |
Gets the type of the widget. | |
virtual Window *const | window () const |
Gets the parent window of the widget. | |
virtual Rect | frame () const |
Gets the widget frame. | |
virtual void | setFrame (const Rect &frame_) |
Sets the widget frame. | |
virtual void | offset (const double x_, const double y_) |
Offsets the widget from its current location by the given amounts, in 1x resolution coordinates. | |
virtual std::string | text () const |
Gets the current text value of the widget. | |
virtual void | setText (const std::string &text_) |
Sets the current text value of the widget. | |
virtual bool | enabled () |
Gets whether the widget is enabled. | |
virtual void | setEnabled (const bool enable_) |
Enables or disables the widget. | |
virtual bool | visible () |
Gets whether the widget is visible. | |
virtual void | setVisible (const bool visible_) |
Shows or hides the widget. | |
virtual void | setOrigin (const Point &p_) |
Convenience method to set just the origin of the target widget's frame. | |
virtual void | setSize (const Size &s_) |
Convenience method to set just the size of the target widget's frame. | |
virtual void | setWidth (const double w_) |
Convenience method to set just the width of the target widget's frame. | |
virtual void | setHeight (const double h_) |
Convenience method to set just the height of the target widget's frame. | |
virtual bool | hasFocus () const |
Gets whether the widget currently has focus. | |
virtual void | focus () const |
Forces the widget to have focus, taking it from any other focused widget of the same window. | |
virtual Callback *const | focusCallback () const |
Gets the current focus callback for the widget. | |
virtual void | setFocusCallback (const Callback &callback_) |
Sets the focus callback for the widget. | |
virtual void | blur () const |
Removes focus from the widget. | |
virtual Callback *const | blurCallback () const |
Gets the current blur callback for the widget. | |
virtual void | setBlurCallback (const Callback &callback_) |
Sets the blur callback for the widget. | |
virtual std::string | tooltip () const |
Gets the tool tip string for the widget. | |
virtual void | setTooltip (const std::string &tip_) |
Sets the tool tip string for the widget. | |
virtual void | update () |
Force the widget to update (i.e. cause it to redraw) | |
Static Public Member Functions | |
static PopupMenu | FontMenu (const Point &loc_, const double width_, const Font &font_) |
Static named constructor for creating a font menu with a preselected font object. | |
Static Public Member Functions inherited from hdi::core::Widget | |
static bool | isCoreWidget (const PlatformWidgetPtr widget_) |
Gets whether the given platform widget is a hdi_core widget. | |
static std::unique_ptr< Widget > | lastClickedWidget () |
Gets the last widget that received a click event (either by the user or programmatically) | |
static std::unique_ptr< Widget > | lastValueChangingWidget () |
Gets the last widget that received a value changing event (either by the user or programmatically) | |
static std::unique_ptr< Widget > | lastValueChangedWidget () |
Gets the last widget that received a value changed event (either by the user or programmatically) | |
static std::unique_ptr< Widget > | lastDropWidget () |
Gets the last widget that received a drag-and-drop drop event (either by the user or programmatically) | |
static std::unique_ptr< Widget > | lastPotentialReorderWidget () |
Gets the last widget that received a potential-reorder event. | |
static std::unique_ptr< Widget > | lastReorderWidget () |
Gets the last widget that received a reorder event. | |
Additional Inherited Members | |
Protected Member Functions inherited from hdi::core::Widget | |
void * | _impl () const |
Internal use only. | |
Widget () | |
Constructs an empty Widget object. | |
Widget (const Widget &w_) | |
Constructs a new Widget object from an existing Widget object (copy constructor) | |
Widget (pui::Widget *&) | |
Internal use only. | |
virtual Widget & | operator= (const Widget &) |
Internal use only. | |
Protected Attributes inherited from hdi::core::Widget | |
void * | _data |
Private implementation data. | |
Popup menu widget, allowing for a single preset entry to be chosen at a time.
hdi::core::PopupMenu::PopupMenu | ( | ) |
Constructs an empty PopupMenu object.
hdi::core::PopupMenu::PopupMenu | ( | const PopupMenu & | popup_ | ) |
hdi::core::PopupMenu::PopupMenu | ( | const Point & | loc_, |
const double | width_ | ||
) |
Constructs an empty PopupMenu widget at a given location of a given width.
loc_ | Position of the popup, in 1x resolution coordinates |
width_ | Width of the popup, at 1x resolution |
hdi::core::PopupMenu::PopupMenu | ( | const Point & | loc_, |
const double | width_, | ||
const EntryVector & | entries_, | ||
const int32_t | initialIndex_ | ||
) |
Constructs a PopupMenu widget with a list of entries and an initial index selection.
loc_ | Position of the popup, in 1x resolution coordinates |
width_ | Width of the popup, at 1x resolution |
entries_ | Vector of string entries, whose order in the popup will match the vector |
initialIndex_ | Initial index to select (must exist in entries_, and must not be a separator) |
hdi::core::PopupMenu::PopupMenu | ( | const Point & | loc_, |
const double | width_, | ||
const EntryVector & | entries_, | ||
const std::string & | initialID_ | ||
) |
Constructs a PopupMenu widget with a list of entries and an initial ID selection.
loc_ | Position of the popup, in 1x resolution coordinates |
width_ | Width of the popup, at 1x resolution |
entries_ | Vector of string entries, whose order in the popup will match that in the vector |
initialID_ | Initial ID to select, as UTF-8 (must exist in entries_, and must not be a separator) |
|
virtual |
PopupMenu destructor.
|
virtual |
Clears all entries contained by the widget.
|
virtual |
Convenience method to clone a PopupMenu object on the heap.
Implements hdi::core::Widget.
|
virtual |
Gets the current entry object.
|
virtual |
Gets the ID of the currently selected entry.
|
virtual |
Gets the index of the currently selected entry.
|
virtual |
Gets the user data for the current entry.
data__ | Return-by-reference for the current user data; ignore if false is returned |
|
virtual |
Gets the string value of the currently selected entry.
|
virtual |
In the case of a (prior) mixed popup state, this will deselect and destroy the blank entry.
|
virtual |
Convenience method to duplicate a PopupMenu object, creating a new and identical UI element to the target (but not belonging to the same containing window)
Implements hdi::core::Widget.
|
virtual |
Gets the entries vector.
|
virtual |
Gets the entry with the given ID, provided it exists within the widget.
id_ | ID of the entry to search for |
|
static |
Static named constructor for creating a font menu with a preselected font object.
loc_ | Position of the popup, in 1x resolution coordinates |
width_ | Width of the popup, at 1x resolution |
font_ | Font face to select by default |
|
virtual |
Gets whether the entries vector already contains an entry, based on its ID.
id_ | ID of the entry to search for, as UTF-8 |
|
virtual |
Inserts an entry into the list of entries at a given position.
id_ | Existing entry immediately before the position at which the new entry will be inserted, as UTF-8 |
entry_ | New entry object to insert into the list of entries |
|
virtual |
Pops an entry off the list (i.e. from the end)
entry__ | Return-by-reference for the popped entry, so the caller can inspect which one was removed |
|
virtual |
Pushes an entry onto the list (i.e. at the end)
entry_ | New entry object to insert into the list of entries |
|
virtual |
Removes a specific entry from the list of entries.
id_ | ID of the entry to be removed, as UTF-8 |
entry__ | Return-by-reference for the removed entry, so the caller can inspect which one was removed |
|
virtual |
In the case of a mixed popup state, this will create and select a blank entry.
|
virtual |
Sets the currently selected entry by ID.
id_ | ID of new value to select in the popup menu, as UTF-8 |
|
virtual |
Sets the currently selected entry by index.
index_ | New index to select |
|
virtual |
Sets the currently selected entry by string value.
value_ | New value to set for the popup menu (if it exists as an entry), as UTF-8 |
|
virtual |
Allows the entries in an popup menu to be changed out entirely.
entries_ | New set of entries that the widget will contain |
|
virtual |
Sets the value changed callback.
callback_ | New callback for when the popup menu's value has changed |
|
virtual |
|
virtual |
Simulates the popup menu having its value changed.
|
virtual |
Gets the value changed callback for the popup menu.