#include <wg_rect.h>
Definition at line 39 of file wg_rect.h.
Used to idicate the relative position of a point to the rect.
RELPOS_INVALID | This usually indicates some form of error. |
RELPOS_ABOVE | The point is above the top of the CRect. |
RELPOS_BELOW | The point is below the bottom of the CRect. |
RELPOS_LEFT | The point is to the left of the CRect. |
RELPOS_RIGHT | The point is to the right of the CRect. |
RELPOS_INSIDE | The point lies within the bounds of the CRect. |
wGui::CRect::CRect | ( | const int | left, | |
const int | top, | |||
const int | right, | |||
const int | bottom | |||
) | [inline] |
wGui::CRect::CRect | ( | const CRect & | r | ) | [inline] |
void wGui::CRect::SetTop | ( | const int | top | ) | [inline] |
Set the Top poisition
top | The new Top coordinate |
Definition at line 68 of file wg_rect.h.
References m_Top.
Referenced by wGui::CView::AttachMenu(), wGui::CFrame::AttachMenu(), wGui::CGroupBox::CGroupBox(), wGui::CEditBox::Draw(), wGui::CScrollBar::RepositionThumb(), and wGui::CGroupBox::SetWindowRect().
void wGui::CRect::SetLeft | ( | const int | left | ) | [inline] |
Set the Left poisition
left | The new Left coordinate |
Definition at line 72 of file wg_rect.h.
References m_Left.
Referenced by wGui::CTextBox::Draw(), wGui::CPopupMenu::Draw(), wGui::CEditBox::Draw(), and wGui::CScrollBar::RepositionThumb().
void wGui::CRect::SetRight | ( | const int | right | ) | [inline] |
Set the Right poisition
right | The new Right coordinate |
Definition at line 76 of file wg_rect.h.
References m_Right.
Referenced by wGui::CTextBox::Draw(), wGui::CFrame::Draw(), wGui::CEditBox::Draw(), wGui::CScrollBar::RepositionThumb(), and wGui::CTextBox::UpdateScrollBars().
void wGui::CRect::SetBottom | ( | const int | bottom | ) | [inline] |
Set the Bottom poisition
bottom | The new Bottom coordinate |
Definition at line 80 of file wg_rect.h.
References m_Bottom.
Referenced by wGui::CEditBox::Draw(), wGui::CScrollBar::RepositionThumb(), and wGui::CTextBox::UpdateScrollBars().
int wGui::CRect::Top | ( | void | ) | const [inline] |
Gets the top of the rectangle
Definition at line 84 of file wg_rect.h.
References m_Top.
Referenced by wGui::CTextBox::Draw(), wGui::CScrollBar::Draw(), wGui::CPopupMenu::Draw(), wGui::CMenu::Draw(), wGui::CListBox::Draw(), wGui::CPainter::DrawRect(), wGui::CView::HandleMessage(), wGui::CTextBox::HandleMessage(), wGui::CScrollBar::HandleMessage(), wGui::CFrame::HandleMessage(), wGui::CTextBox::OnMouseButtonDown(), wGui::CListBox::OnMouseButtonDown(), wGui::CListBox::OnMouseButtonUp(), operator=(), wGui::CScrollBar::RepositionThumb(), wGui::CWindow::SetWindowRect(), and wGui::CTextBox::UpdateScrollBars().
int wGui::CRect::Left | ( | void | ) | const [inline] |
Gets the left of the rectangle
Definition at line 88 of file wg_rect.h.
References m_Left.
Referenced by wGui::CTextBox::Draw(), wGui::CScrollBar::Draw(), wGui::CPopupMenu::Draw(), wGui::CMenu::Draw(), wGui::CListBox::Draw(), wGui::CPainter::DrawRect(), wGui::CView::HandleMessage(), wGui::CTextBox::HandleMessage(), wGui::CScrollBar::HandleMessage(), wGui::CFrame::HandleMessage(), wGui::CTextBox::OnMouseButtonDown(), operator=(), wGui::CScrollBar::RepositionThumb(), wGui::CWindow::SetWindowRect(), wGui::CMenu::ShowActivePopup(), and wGui::CTextBox::UpdateScrollBars().
int wGui::CRect::Right | ( | void | ) | const [inline] |
Gets the right of the rectangle
Definition at line 92 of file wg_rect.h.
References m_Right.
Referenced by wGui::CTextBox::Draw(), wGui::CScrollBar::Draw(), wGui::CPopupMenu::Draw(), wGui::CMenu::Draw(), wGui::CListBox::Draw(), wGui::CFrame::Draw(), wGui::CPainter::DrawRect(), wGui::CFrame::HandleMessage(), operator=(), wGui::CWindow::SetWindowRect(), and wGui::CMenu::ShowActivePopup().
int wGui::CRect::Bottom | ( | void | ) | const [inline] |
Gets the bottom of the rectangle
Definition at line 96 of file wg_rect.h.
References m_Bottom.
Referenced by wGui::CTextBox::Draw(), wGui::CScrollBar::Draw(), wGui::CPopupMenu::Draw(), wGui::CMenu::Draw(), wGui::CPainter::DrawRect(), wGui::CFrame::HandleMessage(), operator=(), wGui::CWindow::SetWindowRect(), and wGui::CPopupMenu::Show().
CPoint wGui::CRect::TopLeft | ( | void | ) | const [inline] |
Gets the top-left corner of the rectangle
Definition at line 100 of file wg_rect.h.
Referenced by wGui::CWindow::ClientToView(), wGui::CTextBox::CTextBox(), wGui::CTextBox::Draw(), wGui::CPopupMenu::Draw(), wGui::CFrame::Draw(), wGui::CPainter::DrawHLine(), wGui::CPainter::DrawPoint(), wGui::CPainter::DrawRect(), wGui::CPainter::DrawVLine(), wGui::CMessageBox::FitToText(), wGui::CView::HandleMessage(), wGui::CWindow::PaintToSurface(), wGui::CToolTip::PaintToSurface(), wGui::CPopupMenu::PaintToSurface(), wGui::CListBox::PaintToSurface(), wGui::CFrame::PaintToSurface(), wGui::CPainter::ReadPoint(), wGui::CPopupMenu::ShowActivePopup(), wGui::CWindow::ViewToClient(), and wGui::CWindow::ViewToWindow().
CPoint wGui::CRect::TopRight | ( | void | ) | const [inline] |
CPoint wGui::CRect::BottomLeft | ( | void | ) | const [inline] |
Gets the bottom left corner of the rectangle
Definition at line 108 of file wg_rect.h.
References m_Bottom, and m_Left.
Referenced by wGui::CLabel::Draw(), and wGui::CMenu::ShowActivePopup().
CPoint wGui::CRect::BottomRight | ( | void | ) | const [inline] |
CPoint wGui::CRect::Center | ( | void | ) | const [inline] |
Gets the center of the rectangle
Definition at line 116 of file wg_rect.h.
References m_Bottom, m_Left, m_Right, and m_Top.
Referenced by wGui::CTextBox::Draw(), wGui::CEditBox::Draw(), and wGui::CButton::Draw().
CPoint wGui::CRect::CenterLeft | ( | void | ) | const [inline] |
CPoint wGui::CRect::CenterTop | ( | void | ) | const [inline] |
CPoint wGui::CRect::CenterBottom | ( | void | ) | const [inline] |
CPoint wGui::CRect::CenterRight | ( | void | ) | const [inline] |
SDL_Rect wGui::CRect::SDLRect | ( | void | ) | const |
Converts the CRect into a SDL style rect
Definition at line 36 of file wg_rect.cpp.
References Height(), m_Bottom, m_Left, m_Right, m_Top, and Width().
Referenced by wGui::CPicture::Draw(), and wGui::CPainter::DrawRect().
int wGui::CRect::Width | ( | void | ) | const [inline] |
Gets the width of the rectangle
Definition at line 141 of file wg_rect.h.
References m_Left, and m_Right.
Referenced by wGui::CView::AttachMenu(), wGui::CFrame::AttachMenu(), wGui::CDropDown::CDropDown(), wGui::CListBox::CListBox(), wGui::CScrollBar::CScrollBar(), wGui::CTextBox::CTextBox(), wGui::CPopupMenu::Draw(), wGui::CGroupBox::Draw(), wGui::CMessageBox::FitToText(), wGui::CView::HandleMessage(), wGui::CScrollBar::HandleMessage(), wGui::CToolBar::RepositionButtons(), wGui::CScrollBar::RepositionThumb(), SDLRect(), wGui::CDropDown::SetListboxHeight(), wGui::CWindow::SetWindowRect(), wGui::CView::SetWindowRect(), wGui::CScrollBar::SetWindowRect(), wGui::CListBox::SetWindowRect(), wGui::CFrame::SetWindowRect(), wGui::CDropDown::SetWindowRect(), wGui::CPopupMenu::Show(), wGui::CPopupMenu::ShowActivePopup(), wGui::CMenu::ShowActivePopup(), and wGui::CTextBox::UpdateScrollBars().
int wGui::CRect::Height | ( | void | ) | const [inline] |
Gets the height of the rectangle
Definition at line 145 of file wg_rect.h.
References m_Bottom, and m_Top.
Referenced by wGui::CListBox::AddItem(), wGui::CView::AttachMenu(), wGui::CFrame::AttachMenu(), wGui::CDropDown::CDropDown(), wGui::CListBox::CListBox(), wGui::CScrollBar::CScrollBar(), wGui::CTextBox::CTextBox(), wGui::CTextBox::Draw(), wGui::CPopupMenu::Draw(), wGui::CGroupBox::Draw(), wGui::CMessageBox::FitToText(), wGui::CView::HandleMessage(), wGui::CScrollBar::HandleMessage(), wGui::CListBox::HandleMessage(), wGui::CListBox::RemoveItem(), wGui::CScrollBar::RepositionThumb(), SDLRect(), wGui::CDropDown::SetListboxHeight(), wGui::CWindow::SetWindowRect(), wGui::CView::SetWindowRect(), wGui::CScrollBar::SetWindowRect(), wGui::CListBox::SetWindowRect(), wGui::CFrame::SetWindowRect(), wGui::CDropDown::SetWindowRect(), wGui::CPopupMenu::Show(), and wGui::CTextBox::UpdateScrollBars().
CRect wGui::CRect::SizeRect | ( | void | ) | const [inline] |
Creates a CRect that has the same width and height of the rect, but has 0, 0 as it's top left coordinate
Definition at line 149 of file wg_rect.h.
References CRect(), m_Bottom, m_Left, m_Right, and m_Top.
Referenced by wGui::CView::AttachMenu(), wGui::CFrame::AttachMenu(), wGui::CListBox::CListBox(), wGui::CWindow::Draw(), wGui::CToolTip::Draw(), wGui::CTextBox::Draw(), wGui::CRadioButton::Draw(), wGui::CProgress::Draw(), wGui::CPicture::Draw(), wGui::CPopupMenu::Draw(), wGui::CListBox::Draw(), wGui::CLabel::Draw(), wGui::CGroupBox::Draw(), wGui::CFrame::Draw(), wGui::CEditBox::Draw(), wGui::CCheckBox::Draw(), wGui::CPictureButton::Draw(), wGui::CButton::Draw(), wGui::CView::HandleMessage(), wGui::CToolTip::HandleMessage(), wGui::CPopupMenu::HandleMessage(), wGui::CMenu::HandleMessage(), wGui::CMenuBase::HandleMessage(), wGui::CFrame::HandleMessage(), wGui::CDropDown::HandleMessage(), wGui::CWindow::HitTest(), wGui::CPopupMenu::IsInsideChild(), wGui::CWindow::OnMouseButtonDown(), wGui::CPopupMenu::OnMouseButtonDown(), wGui::CMenu::OnMouseButtonDown(), wGui::CListBox::OnMouseButtonDown(), wGui::CFrame::OnMouseButtonDown(), wGui::CWindow::OnMouseButtonUp(), wGui::CWindow::PaintToSurface(), wGui::CToolTip::PaintToSurface(), wGui::CPopupMenu::PaintToSurface(), wGui::CListBox::PaintToSurface(), wGui::CFrame::PaintToSurface(), wGui::CToolBar::SetWindowRect(), wGui::CTextBox::SetWindowRect(), wGui::CPicture::SetWindowRect(), wGui::CListBox::SetWindowRect(), wGui::CGroupBox::SetWindowRect(), wGui::CPopupMenu::UpdateCachedRects(), and wGui::CMenu::UpdateCachedRects().
Addition operator to add a CPoint, will offset the CRect
p | A point to offset the CRect by |
Definition at line 61 of file wg_rect.cpp.
References m_Bottom, m_Left, m_Right, m_Top, wGui::CPoint::XPos(), and wGui::CPoint::YPos().
Subtraction operator to subtract a CPoint, will offset the CRect
p | A point to offset the CRect by |
Definition at line 69 of file wg_rect.cpp.
References m_Bottom, m_Left, m_Right, m_Top, wGui::CPoint::XPos(), and wGui::CPoint::YPos().
bool wGui::CRect::operator== | ( | const CRect & | r | ) | const [inline] |
bool wGui::CRect::operator!= | ( | const CRect & | r | ) | const [inline] |
CRect & wGui::CRect::Grow | ( | int | iGrowAmount | ) |
Grow will increase (or decrease) all of the dimensions by the given amount. This means that for a rect 20 wide by 10 tall, Grow(1) will increase the size to 22 wide, 12 tall. (each side is moved out by 1)
iGrowAmount | The amount to grow the CRect's dimensions by, negative values can be used to shrink the rect |
Definition at line 77 of file wg_rect.cpp.
References m_Bottom, m_Left, m_Right, and m_Top.
Referenced by wGui::CEditBox::CEditBox(), wGui::CGroupBox::CGroupBox(), wGui::CPicture::CPicture(), wGui::CTextBox::CTextBox(), wGui::CScrollBar::Draw(), wGui::CPopupMenu::Draw(), wGui::CMenu::Draw(), wGui::CFrame::Draw(), wGui::CPainter::DrawRect(), wGui::CEditBox::HandleMessage(), wGui::CDropDown::HandleMessage(), wGui::CTextBox::SetWindowRect(), wGui::CPicture::SetWindowRect(), wGui::CListBox::SetWindowRect(), and wGui::CGroupBox::SetWindowRect().
CRect & wGui::CRect::Move | ( | int | iOffsetX, | |
int | iOffsetY | |||
) |
Move will move the rect by a offset specified
iOffsetX | how many pixel to move on X axis ( + or - ) | |
iOffsetY | how many pixel to move on Y axis ( + or - ) |
Definition at line 88 of file wg_rect.cpp.
References m_Bottom, m_Left, m_Right, and m_Top.
Referenced by wGui::CFrame::HandleMessage().
bool wGui::CRect::Overlaps | ( | const CRect & | r | ) | const |
Clips the CRect to fit in another CRect
r | The CRect to clip to |
Definition at line 112 of file wg_rect.cpp.
References m_Bottom, m_Left, m_Right, m_Top, and Overlaps().
Referenced by wGui::CView::AttachMenu(), wGui::CFrame::AttachMenu(), wGui::CTextBox::Draw(), wGui::CEditBox::Draw(), wGui::CPainter::DrawRect(), and wGui::CView::HandleMessage().
unsigned int wGui::CRect::HitTest | ( | const CPoint & | p | ) | const |
The HitTest will test to see where a point is in relation to the rect
p | The point to test against the CRect |
Definition at line 146 of file wg_rect.cpp.
References m_Bottom, m_Left, m_Right, m_Top, RELPOS_ABOVE, RELPOS_BELOW, RELPOS_INSIDE, RELPOS_LEFT, RELPOS_RIGHT, wGui::CPoint::XPos(), and wGui::CPoint::YPos().
Referenced by wGui::CRenderedString::Draw(), wGui::CView::HandleMessage(), wGui::CToolTip::HandleMessage(), wGui::CTextBox::HandleMessage(), wGui::CRadioButton::HandleMessage(), wGui::CPopupMenu::HandleMessage(), wGui::CMenu::HandleMessage(), wGui::CMenuBase::HandleMessage(), wGui::CEditBox::HandleMessage(), wGui::CDropDown::HandleMessage(), wGui::CCheckBox::HandleMessage(), wGui::CWindow::HitTest(), wGui::CPopupMenu::IsInsideChild(), wGui::CWindow::OnMouseButtonDown(), wGui::CTextBox::OnMouseButtonDown(), wGui::CScrollBar::OnMouseButtonDown(), wGui::CRadioButton::OnMouseButtonDown(), wGui::CPopupMenu::OnMouseButtonDown(), wGui::CMenu::OnMouseButtonDown(), wGui::CListBox::OnMouseButtonDown(), wGui::CFrame::OnMouseButtonDown(), wGui::CEditBox::OnMouseButtonDown(), wGui::CCheckBox::OnMouseButtonDown(), wGui::CButton::OnMouseButtonDown(), wGui::CWindow::OnMouseButtonUp(), wGui::CRadioButton::OnMouseButtonUp(), wGui::CListBox::OnMouseButtonUp(), wGui::CCheckBox::OnMouseButtonUp(), wGui::CButton::OnMouseButtonUp(), wGui::CPopupMenu::ShowActivePopup(), and wGui::CMenu::ShowActivePopup().
std::wstring wGui::CRect::ToString | ( | void | ) | const [inline] |