wxPoint Class Reference
[Data Structures]

#include <wx/gdicmn.h>


Detailed Description

A wxPoint is a useful data structure for graphics operations.

It contains integer x and y members. See wxRealPoint for a floating point version.

Note that the width and height stored inside a wxPoint object may be negative and that wxPoint functions do not perform any check against negative values (this is used to e.g. store the special -1 value in wxDefaultPosition instance).

Library:  wxCore
Category:  Data Structures

Predefined objects/pointers: wxDefaultPosition

See also:
wxRealPoint

Public Member Functions

 wxPoint ()
 Constructs a point.
 wxPoint (int x, int y)
 Initializes the point object with the given x and y coordinates.
 wxPoint (const wxRealPoint &pt)
 Converts the given wxRealPoint (with floating point coordinates) to a wxPoint instance.
Miscellaneous operators

Note that these operators are documented as class members (to make them easier to find) but, as their prototype shows, they are implemented as global operators; note that this is transparent to the user but it helps to understand why the following functions are documented to take the wxPoint they operate on as an explicit argument.

wxPoint & operator= (const wxPoint &pt)
bool operator== (const wxPoint &p1, const wxPoint &p2)
bool operator!= (const wxPoint &p1, const wxPoint &p2)
wxPoint operator+ (const wxPoint &p1, const wxPoint &p2)
wxPoint operator- (const wxPoint &p1, const wxPoint &p2)
wxPoint & operator+= (const wxPoint &pt)
wxPoint & operator-= (const wxPoint &pt)
wxPoint operator+ (const wxPoint &pt, const wxSize &sz)
wxPoint operator- (const wxPoint &pt, const wxSize &sz)
wxPoint operator+ (const wxSize &sz, const wxPoint &pt)
wxPoint operator- (const wxSize &sz, const wxPoint &pt)
wxPoint & operator+= (const wxSize &sz)
wxPoint & operator-= (const wxSize &sz)
wxSize operator/ (const wxPoint &sz, int factor)
wxSize operator* (const wxPoint &sz, int factor)
wxSize operator* (int factor, const wxSize &sz)
wxSize & operator/= (int factor)
wxSize & operator*= (int factor)

Public Attributes

int x
 x member.
int y
 y member.

List of all members.


Constructor & Destructor Documentation

wxPoint::wxPoint (  ) 

Constructs a point.

Initializes the internal x and y coordinates to zero.

wxPoint::wxPoint ( int  x,
int  y 
)

Initializes the point object with the given x and y coordinates.

wxPoint::wxPoint ( const wxRealPoint &  pt  ) 

Converts the given wxRealPoint (with floating point coordinates) to a wxPoint instance.


Member Function Documentation

bool wxPoint::operator!= ( const wxPoint &  p1,
const wxPoint &  p2 
)
wxSize wxPoint::operator* ( int  factor,
const wxSize &  sz 
)
wxSize wxPoint::operator* ( const wxPoint &  sz,
int  factor 
)
wxSize& wxPoint::operator*= ( int  factor  ) 
wxPoint wxPoint::operator+ ( const wxSize &  sz,
const wxPoint &  pt 
)
wxPoint wxPoint::operator+ ( const wxPoint &  pt,
const wxSize &  sz 
)
wxPoint wxPoint::operator+ ( const wxPoint &  p1,
const wxPoint &  p2 
)
wxPoint& wxPoint::operator+= ( const wxSize &  sz  ) 
wxPoint& wxPoint::operator+= ( const wxPoint &  pt  ) 
wxPoint wxPoint::operator- ( const wxSize &  sz,
const wxPoint &  pt 
)
wxPoint wxPoint::operator- ( const wxPoint &  pt,
const wxSize &  sz 
)
wxPoint wxPoint::operator- ( const wxPoint &  p1,
const wxPoint &  p2 
)
wxPoint& wxPoint::operator-= ( const wxSize &  sz  ) 
wxPoint& wxPoint::operator-= ( const wxPoint &  pt  ) 
wxSize wxPoint::operator/ ( const wxPoint &  sz,
int  factor 
)
wxSize& wxPoint::operator/= ( int  factor  ) 
wxPoint& wxPoint::operator= ( const wxPoint &  pt  ) 
bool wxPoint::operator== ( const wxPoint &  p1,
const wxPoint &  p2 
)

Member Data Documentation

x member.

y member.

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines



wxWidgets logo

[ top ]