Hot Door CORE 0.8.2
Adobe® Illustrator® Plug-in Library
Loading...
Searching...
No Matches
hdicoreCheckbox.h
Go to the documentation of this file.
1
7#ifndef __HDI_CORE_CHECKBOX__
8#define __HDI_CORE_CHECKBOX__
9
10#include "hdicoreWidget.h"
11
12namespace hdi
13{
14 namespace core
15 {
16 class Callback;
17
21 class Checkbox : public Widget
22 {
23 public:
28 {
29 StateMixed = -1,
30 StateOff = 0,
31 StateOn = 1
32 };
33
45
53 Checkbox(const Checkbox& checkbox_);
54
70 explicit Checkbox(
71 const Point& loc_,
72 const std::string& label_,
73 const WindowType containerType_,
74 const StateType state_ = StateOff
75 );
76
87 explicit Checkbox(
88 const Point& loc_,
89 const std::string& label_,
90 const double width_,
91 const StateType state_ = StateOff
92 );
93
99 virtual ~Checkbox();
100
109 virtual Checkbox& operator=(const Checkbox& rhs_);
110
124 virtual Checkbox* clone() const;
125
136 virtual Checkbox* duplicate() const;
137
145 virtual StateType state() const;
146
154 virtual void setState(const StateType state_);
155
165 virtual void setChecked(const bool checked_);
166
172 virtual void click();
173
181 virtual Callback* const clickCallback() const;
182
190 virtual void setClickCallback(const Callback& callback_);
191
202 static double idealWidth(const std::string& text_, const double height_, const WindowType containerType_);
203 };
204
205 typedef std::unique_ptr<Checkbox> CheckboxUP;
206 typedef std::shared_ptr<Checkbox> CheckboxSP;
207 typedef std::weak_ptr<Checkbox> CheckboxWP;
208 }
209}
210
211#endif
212// __HDI_CORE_CHECKBOX__
Base class for templated __Callback class.
Definition: hdicoreCallback.h:68
Checkbox widget, which has both a checkbox "button" and a text label to its right.
Definition: hdicoreCheckbox.h:22
virtual Checkbox * clone() const
Convenience method to clone a Checkbox object on the heap.
virtual void setChecked(const bool checked_)
Alternate setter for the checkbox state.
static double idealWidth(const std::string &text_, const double height_, const WindowType containerType_)
Gets the ideal width for a checkbox, given its label and a known height.
virtual Callback *const clickCallback() const
Gets the current click callback for the checkbox.
virtual void setClickCallback(const Callback &callback_)
Sets the click callback for the checkbox.
virtual StateType state() const
Gets the checkbox state.
virtual Checkbox & operator=(const Checkbox &rhs_)
Allows one Checkbox object to be assigned from another.
virtual ~Checkbox()
Checkbox destructor.
Checkbox(const Point &loc_, const std::string &label_, const WindowType containerType_, const StateType state_=StateOff)
Constructs a checkbox (using a StateType) and a window container type.
virtual void click()
Simulates a click on the checkbox.
virtual void setState(const StateType state_)
Sets the checkbox state.
StateType
Describes the state of a checkbox.
Definition: hdicoreCheckbox.h:28
Checkbox(const Point &loc_, const std::string &label_, const double width_, const StateType state_=StateOff)
Constructs a checkbox (using a StateType)
Checkbox()
Constructs an empty Checkbox object.
virtual Checkbox * duplicate() const
Convenience method to duplicate a Checkbox object, creating a new and identical UI element to the tar...
Checkbox(const Checkbox &checkbox_)
Constructs a new Checkbox object from an existing Checkbox object (copy constructor)
Describes a point in the 2-dimensional (x,y) coordinate system, typically in an Illustrator document ...
Definition: hdicorePoint.h:38
Base class for all interface widgets; handles many common needs, e.g. text, position,...
Definition: hdicoreWidget.h:30
WindowType
Describes the type of a Window object, allowing for proper casting to its subclass.
Definition: hdicoreTypes.h:822
Header file for plugin user interface widgets.