wGui::CPoint Class Reference

CPoint defines a point in cartestian (X, Y) space. More...

#include <wg_point.h>

Public Member Functions

Protected Attributes


Detailed Description

CPoint defines a point in cartestian (X, Y) space.

Screen coordinates are assumed, where the origin is in the top left corner of the screen and Y increases in the downward direction

Definition at line 38 of file wg_point.h.


Constructor & Destructor Documentation

wGui::CPoint::CPoint ( const int  x,
const int  y 
) [inline]

Initialize the point to (x, y)

Parameters:
x X coordinate
y Y coordinate

Definition at line 47 of file wg_point.h.


Member Function Documentation

void wGui::CPoint::SetX ( const int  x  )  [inline]

Set the X coordinate

Parameters:
x X coordinate

Definition at line 57 of file wg_point.h.

References m_XPos.

Referenced by wGui::CEditBox::GetIndexFromPoint(), wGui::CRenderedString::GetMetrics(), operator+(), operator-(), and wGui::CPopupMenu::Show().

void wGui::CPoint::SetY ( const int  y  )  [inline]

Set the Y coordinate

Parameters:
y Y coordinate

Definition at line 61 of file wg_point.h.

References m_YPos.

Referenced by wGui::CTextBox::Draw(), wGui::CRenderedString::GetMetrics(), operator+(), operator-(), and wGui::CPopupMenu::Show().

int wGui::CPoint::XPos ( void   )  const [inline]

Gets the X coordinate

Returns:
X coordinate

Definition at line 65 of file wg_point.h.

References m_XPos.

Referenced by wGui::CTextBox::Draw(), wGui::CEditBox::Draw(), wGui::CPainter::DrawHLine(), wGui::CPainter::DrawLine(), wGui::CPainter::DrawPoint(), wGui::CPainter::DrawVLine(), wGui::CMessageBox::FitToText(), wGui::CEditBox::GetIndexFromPoint(), wGui::CTextBox::HandleMessage(), wGui::CRect::HitTest(), wGui::CTextBox::OnMouseButtonDown(), wGui::CRect::operator+(), operator+(), wGui::CRect::operator-(), operator-(), operator=(), wGui::CTextBox::PrepareWindowText(), wGui::CPainter::ReadPoint(), wGui::CApplication::SetMousePosition(), wGui::CPopupMenu::Show(), and wGui::CMenu::UpdateCachedRects().

int wGui::CPoint::YPos ( void   )  const [inline]

Gets the Y coordinate

Returns:
Y coordinate

Definition at line 69 of file wg_point.h.

References m_YPos.

Referenced by wGui::CTextBox::Draw(), wGui::CPainter::DrawHLine(), wGui::CPainter::DrawLine(), wGui::CPainter::DrawPoint(), wGui::CPainter::DrawVLine(), wGui::CMessageBox::FitToText(), wGui::CTextBox::HandleMessage(), wGui::CRect::HitTest(), wGui::CTextBox::OnMouseButtonDown(), wGui::CListBox::OnMouseButtonDown(), wGui::CListBox::OnMouseButtonUp(), wGui::CRect::operator+(), operator+(), wGui::CRect::operator-(), operator-(), operator=(), wGui::CPainter::ReadPoint(), wGui::CApplication::SetMousePosition(), wGui::CPopupMenu::Show(), and wGui::CPopupMenu::UpdateCachedRects().

bool wGui::CPoint::leftof ( const CPoint p  )  const [inline]

Indicates if a point is to the left of the point

Returns:
true if the point is to the left of point p

Definition at line 88 of file wg_point.h.

References m_XPos.

bool wGui::CPoint::rightof ( const CPoint p  )  const [inline]

Indicates if a point is to the right of the point

Returns:
true if the point is to the right of point p

Definition at line 92 of file wg_point.h.

References m_XPos.

bool wGui::CPoint::above ( const CPoint p  )  const [inline]

Indicates if a point is above the point

Returns:
true if the point is above point p

Definition at line 96 of file wg_point.h.

References m_YPos.

bool wGui::CPoint::below ( const CPoint p  )  const [inline]

Indicates if a point is below the point

Returns:
true if the point is below point p

Definition at line 100 of file wg_point.h.

References m_YPos.

std::wstring wGui::CPoint::ToString ( void   )  const [inline]

Gives a string representation of the coordinates

Returns:
The coordinates in a string "<x>,<y>" i.e. "10,20"

Definition at line 104 of file wg_point.h.

References stdex::itoa(), m_XPos, and m_YPos.


The documentation for this class was generated from the following files:
Generated on Wed May 16 23:11:27 2007 for wGui by  doxygen 1.5.1