Hot Door CORE  0.7.0
Adobe® Illustrator® Plug-in Library
hdicoreTextField.h
Go to the documentation of this file.
1 
7 #ifndef __HDI_CORE_TEXTFIELD__
8 #define __HDI_CORE_TEXTFIELD__
9 
10 #include "hdicoreWidget.h"
11 
12 namespace hdi
13 {
14  namespace core
15  {
16  class Callback;
17  class Label;
18 
22  class TextField : public Widget
23  {
24  public:
25  friend class Label;
26 
30  enum Alignment
31  {
32  UnknownAlignment = 0,
33  LeftAlignment = 10,
34  CenterAlignment = 20,
35  RightAlignment = 30
36  };
37 
49  TextField();
50 
58  TextField(const TextField& field_);
59 
69  TextField(const Point& loc_, const std::string& text_, const double width_);
70 
76  virtual ~TextField();
77 
86  virtual TextField& operator=(const TextField& rhs_);
87 
101  virtual TextField* clone() const;
102 
113  virtual TextField* duplicate() const;
114 
122  virtual Alignment alignment() const;
123 
131  virtual void setAlignment(const Alignment alignment_);
132 
140  virtual bool bold() const;
141 
149  virtual void setBold(const bool bold_);
150 
158  virtual bool italic() const;
159 
167  virtual void setItalic(const bool italic_);
168 
176  virtual std::auto_ptr<Label> label() const;
177 
187  virtual void setLabel(Label& label_);
188 
194  virtual void removeLabel();
195 
208  virtual bool selectionRange(uint32_t& pos__, uint32_t& len__) const;
209 
221  virtual void setSelectionRange(const uint32_t pos_, const uint32_t len_);
222 
234  virtual std::string lastCharTyped() const;
235 
241  virtual void valueChanging();
242 
250  virtual Callback* const valueChangingCallback() const;
251 
259  virtual void setValueChangingCallback(const Callback& callback_);
260 
266  virtual void valueChanged();
267 
275  virtual Callback* const valueChangedCallback() const;
276 
284  virtual void setValueChangedCallback(const Callback& callback_);
285  };
286 
287  typedef std::auto_ptr<TextField> TextFieldAP;
288  }
289 }
290 
291 #endif
292 // __HDI_CORE_TEXTFIELD__
Text field widget, which allows the user to enter arbitrary text values.
Definition: hdicoreTextField.h:22
virtual void setSelectionRange(const uint32_t pos_, const uint32_t len_)
Sets the selection range of the text in the field (and focuses it)
Base class for all interface widgets; handles many common needs, e.g. text, position, size, etc.
Definition: hdicoreWidget.h:39
Label widget, for simply displaying text or images inside a window.
Definition: hdicoreLabel.h:24
Describes a point in the 2-dimensional (x,y) coordinate system, typically in an Illustrator document ...
Definition: hdicorePoint.h:26
Alignment
Text alignment options.
Definition: hdicoreTextField.h:30
virtual void removeLabel()
Removes the label that, when clicked, would have focused the target text field.
virtual std::auto_ptr< Label > label() const
If the target text field has been associated with a label, this gets said label.
virtual ~TextField()
TextField destructor.
TextField()
Constructs an empty TextField object.
virtual Alignment alignment() const
Gets the current alignment of the text field.
virtual void setValueChangedCallback(const Callback &callback_)
Sets the value changed callback.
Base class for templated __Callback class.
Definition: hdicoreCallback.h:67
virtual void setBold(const bool bold_)
Sets the font weight.
virtual bool bold() const
Gets whether the text is bold.
virtual TextField * duplicate() const
Convenience method to duplicate a TextField object, creating a new and identical UI element to the ta...
virtual void setValueChangingCallback(const Callback &callback_)
Sets the value changing callback.
virtual Callback *const valueChangedCallback() const
Gets the value changed callback for the text field.
virtual Callback *const valueChangingCallback() const
Gets the value changing callback for the text field.
Definition: hdicoreaiArray.h:12
virtual void setAlignment(const Alignment alignment_)
Sets the current alignment of the text field.
Header file for Illustrator user interface widgets.
virtual TextField * clone() const
Convenience method to clone a TextField object on the heap.
virtual void valueChanging()
Simulates the value of the text field changing.
virtual void setItalic(const bool italic_)
Sets the font style.
virtual std::string lastCharTyped() const
Gets the last character typed into the field.
virtual bool italic() const
Gets whether the text is italicized.
virtual bool selectionRange(uint32_t &pos__, uint32_t &len__) const
Gets the selection range of the text in the field, if any.
virtual TextField & operator=(const TextField &rhs_)
Allows one TextField object to be assigned from another.
virtual void valueChanged()
Simulates the text field having its value changed.
virtual void setLabel(Label &label_)
Sets the label that, when clicked, will focus the target text field.