7#ifndef __HDI_CORE_COMBO_BOX__
8#define __HDI_CORE_COMBO_BOX__
27 typedef std::vector<PopupEntry> EntryVector;
84 const EntryVector& entries_,
85 const int32_t initialIndex_
103 const EntryVector& entries_,
104 const std::string& initialID_
122 const EntryVector& entries_,
123 const std::string& value_
318 virtual const std::vector< std::shared_ptr<PopupEntry> >*
const entries()
const;
328 virtual bool hasEntry(
const std::string& id_)
const;
338 virtual std::shared_ptr<PopupEntry>
entryWithID(
const std::string& id_)
const;
578 typedef std::unique_ptr<ComboBox> ComboBoxUP;
579 typedef std::shared_ptr<ComboBox> ComboBoxSP;
580 typedef std::weak_ptr<ComboBox> ComboBoxWP;
Base class for templated __Callback class.
Definition: hdicoreCallback.h:68
Combo box widget, which consists of a text-field for custom input and a popup menu for preset values.
Definition: hdicoreComboBox.h:25
virtual Callback *const valueChangingCallback() const
Gets the value changing callback for the combo box.
virtual std::string currentValue() const
Gets the string value of the currently selected entry (or the custom value, if the user has entered o...
virtual void setSelectionRange(const uint32_t pos_, const uint32_t len_)
Sets the selection range of the text in the field, in UTF-8 (and focuses it)
virtual void setExpanded(const bool exp_)
Sets the expansion state of the combo box's popup menu.
ComboBox(const Point &loc_, const double width_)
Constructs a combo box.
virtual void valueChanged()
Simulates the combo box having its value changed.
virtual void setItalic(const bool italic_)
Sets the font style.
virtual bool bold() const
Gets whether the text is bold.
ComboBox()
Constructs an empty ComboBox object.
Alignment
Text alignment options.
Definition: hdicoreComboBox.h:33
static ComboBox ComboBoxWithID(const Point &loc_, const double width_, const EntryVector &entries_, const std::string &initialID_)
Named constructor for a combo box with an initial ID selected.
virtual bool setCurrentID(const std::string &id_)
Sets the currently selected entry by ID.
virtual bool expanded() const
Gets the expansion state of the combo box's popup menu.
ComboBox(const ComboBox &combobox_)
Constructs a new ComboBox object from an existing ComboBox object (copy constructor)
virtual void setSelectionRangeUTF32(const uint32_t pos_, const uint32_t len_)
Sets the selection range of the text in the field, in UTF-32 (and focuses it)
virtual bool selectionRangeUTF32(uint32_t &pos__, uint32_t &len__) const
Gets the selection range of the text in the field, if any, in UTF-32.
virtual void setAlignment(const Alignment alignment_)
Sets the current alignment of the text field.
virtual ComboBox * duplicate() const
Convenience method to duplicate a ComboBox object, creating a new and identical UI element to the tar...
virtual void valueChanging()
Simulates the value of the combo box changing.
virtual int32_t currentIndex() const
Gets the index of the currently selected entry.
virtual bool removeEntry(const std::string &id_, PopupEntry &entry__)
Removes a specific entry from the list of entries.
virtual bool popEntry(PopupEntry &entry__)
Pops an entry off the list (i.e. from the end)
virtual bool setCurrentIndex(const int32_t index_)
Sets the currently selected entry by index.
virtual ~ComboBox()
ComboBox destructor.
virtual bool currentUserData(void *&data__) const
Gets the user data for the current entry.
virtual void setBold(const bool bold_)
Sets the font weight.
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 void setValueChangedCallback(const Callback &callback_)
Sets the value changed callback.
virtual bool pushEntry(const PopupEntry &entry_)
Pushes an entry onto the list (i.e. at the end)
virtual void setValueChangingCallback(const Callback &callback_)
Sets the value changing callback.
virtual std::unique_ptr< PopupEntry > currentEntry() const
Gets the current entry object.
ComboBox(const Point &loc_, const double width_, const EntryVector &entries_, const int32_t initialIndex_)
Constructs a combo box.
virtual void setEntries(const EntryVector &entries_)
Allows the entries in an combo box to be changed out entirely.
virtual std::string currentID() const
Gets the ID of the currently selected entry.
virtual bool hasEntry(const std::string &id_) const
Gets whether the entries vector already contains an entry, based on its ID.
virtual ModifierKey lastModifierKeys() const
Gets the last set of modifier keys used when typing into the field.
virtual ComboBox & operator=(const ComboBox &rhs_)
Allows one ComboBox object to be assigned from another.
virtual bool insertEntry(const std::string &id_, const PopupEntry &entry_)
Inserts an entry into the list of entries at a given position.
virtual Callback *const valueChangedCallback() const
Gets the value changed callback for the combo box.
virtual void clearEntries()
Clears all entries contained by the widget.
virtual bool selectionRange(uint32_t &pos__, uint32_t &len__) const
Gets the selection range of the text in the field, if any, in UTF-8.
virtual Alignment alignment() const
Gets the current alignment of the text field.
virtual bool italic() const
Gets whether the text is italicized.
virtual ComboBox * clone() const
Convenience method to clone a ComboBox object on the heap.
virtual void update()
Force the combo box to update its entries.
virtual std::string lastCharTyped() const
Gets the last character typed into the field.
virtual bool setCurrentValue(const std::string &value_)
Sets the currently selected entry by string value.
virtual const std::vector< std::shared_ptr< PopupEntry > > *const entries() const
Gets the entries vector.
static ComboBox ComboBoxWithValue(const Point &loc_, const double width_, const EntryVector &entries_, const std::string &value_)
Named constructor for a combo box with an initial string value (whether it's in the entries_ argument...
Describes a point in the 2-dimensional (x,y) coordinate system, typically in an Illustrator document ...
Definition: hdicorePoint.h:38
ModifierKey
Describes various modifier keys.
Definition: hdicoreTypes.h:898