Hot Door CORE  0.7.0
Adobe® Illustrator® Plug-in Library
4 #include "hdicoreCustomWidget.h"
6 namespace hdi
7 {
8  namespace core
9  {
14  class DraggableDivider : public CustomWidget
15  {
16  public:
20  enum Direction
21  {
22  UnknownDirection = 0,
23  Horizontal = 10,
24  Vertical = 20
25  };
48  DraggableDivider(const DraggableDivider& widget_);
58  DraggableDivider(const Point& loc_, const Direction dir_);
65  virtual ~DraggableDivider();
75  virtual DraggableDivider& operator=(const DraggableDivider& rhs_);
90  virtual DraggableDivider* clone() const;
102  virtual DraggableDivider* duplicate() const;
111  virtual Direction direction() const;
120  virtual std::string text() const;
127  virtual void setText(const std::string&);
136  virtual bool enabled();
145  virtual void setEnabled(const bool enable_);
154  virtual Callback* const movedCallback() const;
164  virtual void setMovedCallback(const Callback& cb_);
167  private:
168  // All of these are made private because they are unnecessary for this subclass
169  void redraw();
170  ModifierKey getClickDragModifiers() const;
171  bool getClickDragLocations(Point& start__, Point& end__) const;
172  bool isMouseOver() const;
173  Callback* const mouseOverCallback() const;
174  void setMouseOverCallback(const Callback& cb_);
175  Callback* const mouseMoveCallback() const;
176  void setMouseMoveCallback(const Callback& cb_);
177  Callback* const mouseOutCallback() const;
178  void setMouseOutCallback(const Callback& cb_);
179  Callback* const mouseDownCallback() const;
180  void setMouseDownCallback(const Callback& cb_);
181  Callback* const mouseDragCallback() const;
182  void setMouseDragCallback(const Callback& cb_);
183  Callback* const mouseUpCallback() const;
184  void setMouseUpCallback(const Callback& cb_);
185  Callback* const drawCallback() const;
186  void setDrawCallback(const Callback& cb_);
187  bool clearsOnRedraw() const;
188  void setClearsOnRedraw(const bool clear_);
189  void setDrawColor(const Color& color_);
190  void drawLine(const Point& from_, const Point& to_);
191  void drawRect(const Rect& rect_, const bool fill_ = false);
192  void drawPolygon(const PointVector& points_, const bool fill_ = false);
193  };
195  typedef std::auto_ptr<DraggableDivider> DraggableDividerAP;
196  }
197 }
199 #endif
virtual ~DraggableDivider()
DraggableDivider destructor.
virtual DraggableDivider * clone() const
Convenience method to clone a DraggableDivider object on the heap.
virtual bool enabled()
Returns true, because dividers are always enabled.
Describes a point in the 2-dimensional (x,y) coordinate system, typically in an Illustrator document ...
Definition: hdicorePoint.h:26
Describes an RGB color, with opacity, typically for UI purposes.
Definition: hdicoreColor.h:24
Describes the direction of the line in a DraggableDivider object.
Definition: hdicoreDraggableDivider.h:20
virtual std::string text() const
Always gets "", as dividers cannot have text.
Contains Point and Size objects to describe a rectangle that exists at a specific point of given dime...
Definition: hdicoreRect.h:26
Base class for templated __Callback class.
Definition: hdicoreCallback.h:67
virtual void setText(const std::string &)
Prevents setting the text, as dividers cannot have text.
virtual Callback *const movedCallback() const
Gets the callback for the widget being moved during a mouse drag event.
virtual DraggableDivider * duplicate() const
Convenience method to duplicate a DraggableDivider object, creating a new and identical UI element to...
virtual DraggableDivider & operator=(const DraggableDivider &rhs_)
Allows one DraggableDivider object to be assigned from another.
virtual Direction direction() const
Gets the direction that the line is going.
Class for draggable divider lines, which are of a standard length, and used for resizing e...
Definition: hdicoreDraggableDivider.h:14
Definition: hdicoreaiArray.h:12
Constructs an empty DraggableDivider object.
virtual void setMovedCallback(const Callback &cb_)
Sets the callback for the widget being moved during a mouse drag event.
Header file for Illustrator user interface custom widgets.
virtual void setEnabled(const bool enable_)
Overrides setEnabled (hdi::core::Widget) because dividers are always enabled.