Hot Door CORE  0.7.1
Adobe® Illustrator® Plug-in Library
hdicoreRadioButton.h
Go to the documentation of this file.
1 
7 #ifndef __HDI_CORE_RADIOBUTTON__
8 #define __HDI_CORE_RADIOBUTTON__
9 
10 #include "hdicoreWidget.h"
11 
12 namespace hdi
13 {
14  namespace core
15  {
16  class Callback;
17  class RadioButtonGroup;
18 
23  class RadioButton : public Widget
24  {
25  public:
29  enum StateType
30  {
31  StateMixed = -1,
32  StateOff = 0,
33  StateOn = 1
34  };
35 
47  RadioButton();
48 
56  RadioButton(const RadioButton& radio_);
57 
73  explicit RadioButton(
74  const Point& loc_,
75  const std::string& title_,
76  const WindowType containerType_,
77  const StateType state_ = StateOff
78  );
79 
90  explicit RadioButton(
91  const Point& loc_,
92  const std::string& title_,
93  const double width_,
94  const StateType state_ = StateOff
95  );
96 
107  explicit RadioButton(
108  const Rect& frame_,
109  const ImageWithRolloverIDs& imageIDs_,
110  const bool hasBorders_,
111  const bool chosen_ = false
112  );
113 
119  virtual ~RadioButton();
120 
129  virtual RadioButton& operator=(const RadioButton& rhs_);
130 
144  virtual RadioButton* clone() const;
145 
156  virtual RadioButton* duplicate() const;
157 
165  virtual StateType state() const;
166 
174  virtual void setState(const StateType state_);
175 
185  virtual void setChosen(const bool chosen_);
186 
196  virtual std::string text() const;
197 
207  virtual void setText(const std::string& text_);
208 
216  virtual bool hasBorders() const;
217 
225  virtual RadioButtonGroup* const group() const;
226 
232  virtual void click();
233 
241  virtual Callback* const clickCallback() const;
242 
250  virtual void setClickCallback(const Callback& callback_);
251 
259  virtual ImageWithRolloverIDs imageIDs() const;
260 
268  virtual void setImageIDs(const ImageWithRolloverIDs& ids_);
269 
277  virtual bool backgroundRollover() const;
278 
286  virtual void setBackgroundRollover(const bool ro_);
287 
298  static double idealWidth(const std::string& text_, const double height_, const WindowType containerType_);
299 
300 
301  private:
302  friend class RadioButtonGroup;
303  };
304 
305  typedef std::auto_ptr<RadioButton> RadioButtonAP;
306  }
307 }
308 
309 #endif
310 // __HDI_CORE_RADIOBUTTON__
Base class for all interface widgets; handles many common needs, e.g. text, position, size, etc.
Definition: hdicoreWidget.h:39
virtual void setChosen(const bool chosen_)
Alternate setter for the radio button state.
virtual RadioButton & operator=(const RadioButton &rhs_)
Allows one RadioButton object to be assigned from another.
Describes a point in the 2-dimensional (x,y) coordinate system, typically in an Illustrator document ...
Definition: hdicorePoint.h:26
virtual bool backgroundRollover() const
Gets whether the background of the button should change in appearance upon mouse-over.
virtual void setText(const std::string &text_)
Sets the current text value of the radio button.
virtual bool hasBorders() const
Gets whether an image radio button has borders.
virtual RadioButton * duplicate() const
Convenience method to duplicate a RadioButton object, creating a new and identical UI element to the ...
static double idealWidth(const std::string &text_, const double height_, const WindowType containerType_)
Gets the ideal width for a radio button, given its label and a known height.
virtual void setImageIDs(const ImageWithRolloverIDs &ids_)
Sets the PNGI resource IDs of the widget.
StateType
Describes the state of a radio button.
Definition: hdicoreRadioButton.h:29
virtual void click()
Simulates a click on the button.
virtual ImageWithRolloverIDs imageIDs() const
Gets the PNGI resource IDs of the widget.
Contains Point and Size objects to describe a rectangle that exists at a specific point of given dime...
Definition: hdicoreRect.h:26
virtual ~RadioButton()
Radio button destructor.
virtual void setState(const StateType state_)
Sets the radio button state.
Base class for templated __Callback class.
Definition: hdicoreCallback.h:67
virtual StateType state() const
Gets the radio button state.
WindowType
Describes the type of a Window object, allowing for proper casting to its subclass.
Definition: hdicoreTypes.h:344
Radio button widget, which has both a radio button and label to its right. After instantiation, a RadioButton object can be added to a RadioButtonGroup.
Definition: hdicoreRadioButton.h:23
virtual Callback *const clickCallback() const
Gets the current click callback for the button.
virtual void setBackgroundRollover(const bool ro_)
Sets whether the background of the button should change in appearance upon mouse-over.
virtual RadioButtonGroup *const group() const
Gets the radio button group that the target RadioButton belongs to.
Definition: hdicoreaiArray.h:12
virtual void setClickCallback(const Callback &callback_)
Sets the click callback for the button.
Header file for Illustrator user interface widgets.
Allows for logically grouping radio buttons together, such that one can be chosen and others automati...
Definition: hdicoreRadioButtonGroup.h:23
RadioButton()
Constructs an empty RadioButton object.
Allows for image rollover support.
Definition: hdicoreImageIDs.h:164
virtual std::string text() const
Gets the current text value of the radio button.
virtual RadioButton * clone() const
Convenience method to clone a RadioButton object on the heap.