Wt  3.3.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator
Public Member Functions
Wt::WPointF Class Reference

A value class that defines a 2D point. More...

#include <Wt/WPointF>

Inheritance diagram for Wt::WPointF:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 WPointF ()
 Creates point (0, 0).
 WPointF (double x, double y)
 Creates a point (x, y).
 WPointF (const WPointF &other)
 Copy constructor.
 WPointF (const WMouseEvent::Coordinates &other)
 Creates a point from mouse coordinates.
void setX (double x)
 Sets the X coordinate.
void setY (double y)
 Sets the Y coordinate.
double x () const
 Returns the X coordinate.
double y () const
 Returns the Y coordinate.
bool operator== (const WPointF &other) const
 Comparison operator.
bool operator!= (const WPointF &other) const
 Comparison operator.
virtual std::string jsValue () const WT_CXX11ONLY(override)
 Returns a JavaScript representation of the value of this object.

Detailed Description

A value class that defines a 2D point.

JavaScript exposability

A WPointF is JavaScript exposable. If a WPointF is JavaScript bound, it can be accessed in your custom JavaScript code through its handle's jsRef(). A point is represented in JavaScript as an array of two elements, e.g. a point WPointF(10,20) will be represented in JavaScript as:

 [10, 20]
Warning:
A WPointF that is JavaScript exposed should be modified only through its handle. Any attempt at modifying it will cause an exception to be thrown.
See also:
WPaintedWidget::createJSPoint()

Member Function Documentation

std::string Wt::WPointF::jsValue ( ) const [override, virtual]

Returns a JavaScript representation of the value of this object.

Note:
The value returned will reflect the current server side value of the object. If this object is JavaScript bound, this value may not reflect the actual client side value. If you need access to the client side value, use jsRef() intead.

Implements Wt::WJavaScriptExposableObject.

void Wt::WPointF::setX ( double  x)

Sets the X coordinate.

Exceptions:
WExceptionif the point is JavaScript bound
void Wt::WPointF::setY ( double  y)

Sets the Y coordinate.

Exceptions:
WExceptionif the point is JavaScript bound
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator

Generated on Tue Mar 22 2016 for the C++ Web Toolkit (Wt) by doxygen 1.7.6.1