wGui::CScrollBar Class Reference

A scroll bar. More...

#include <wg_scrollbar.h>

Inheritance diagram for wGui::CScrollBar:

wGui::CRangeControl< int > wGui::CWindow wGui::CMessageClient

Public Types

Public Member Functions

Protected Member Functions

Protected Attributes


Detailed Description

A scroll bar.

Definition at line 38 of file wg_scrollbar.h.


Member Enumeration Documentation

enum wGui::CScrollBar::EScrollBarType

The types of scrollbars possible.

Enumerator:
VERTICAL  A standard vertical scrollbar.
HORIZONTAL  A standard horizontal scrollbar.

Definition at line 42 of file wg_scrollbar.h.


Constructor & Destructor Documentation

wGui::CScrollBar::CScrollBar ( const CRect WindowRect,
CWindow pParent,
EScrollBarType  ScrollBarType 
)

Constructs a scroll bar, initilizes the limits to 0, and 100 with the position at 0

Parameters:
WindowRect A CRect that defines the outer limits of the control
pParent A pointer to the parent window
ScrollBarType Indicates if this is to be a vertical or horizontal scrollbar

Definition at line 37 of file wg_scrollbar.cpp.

References wGui::CMessage::CTRL_SINGLELCLICK, Draw(), wGui::CApplication::GetDefaultForegroundColor(), wGui::CRect::Height(), HORIZONTAL, wGui::CMessageServer::Instance(), wGui::CApplication::Instance(), wGui::CWindow::m_BackgroundColor, wGui::CWindow::m_ClientRect, m_pBtnDownRight, m_pBtnUpLeft, m_ScrollBarType, m_ThumbRect, wGui::CWindow::m_WindowRect, wGui::CMessage::MOUSE_BUTTONUP, wGui::CMessage::MOUSE_MOVE, wGui::CMessageServer::RegisterMessageClient(), RepositionThumb(), VERTICAL, and wGui::CRect::Width().


Member Function Documentation

virtual void wGui::CScrollBar::SetJumpAmount ( int  iJumpAmount  )  [inline, virtual]

Set the amount to jump by when the area below or above the thumb is clicked (this is 5 by default)

Parameters:
iJumpAmount The amount to step by

Definition at line 59 of file wg_scrollbar.h.

References m_iJumpAmount.

virtual int wGui::CScrollBar::GetJumpAmount ( void   )  const [inline, virtual]

Get the amount that the scrollbar will jump by when the arrow buttons are clicked

Returns:
The amount the scrollbar jumps by when clicked above or below the thumb

Definition at line 63 of file wg_scrollbar.h.

References m_iJumpAmount.

void wGui::CScrollBar::SetValue ( int  iValue,
bool  bRedraw = true 
) [virtual]

Set the current value.

Parameters:
iValue The new value for the control
bRedraw indicates if the control should be redrawn (defaults to true)

Reimplemented from wGui::CRangeControl< int >.

Definition at line 81 of file wg_scrollbar.cpp.

References Draw(), and RepositionThumb().

Referenced by wGui::CTextBox::Draw(), wGui::CListBox::HandleMessage(), wGui::CTextBox::OnMouseButtonDown(), OnMouseButtonDown(), SetWindowRect(), and wGui::CTextBox::UpdateScrollBars().

void wGui::CScrollBar::SetWindowRect ( const CRect WindowRect  )  [virtual]

Giving a control a new WindowRect will move and resize the control

Parameters:
WindowRect A CRect that defines the outer limits of the control

Reimplemented from wGui::CWindow.

Definition at line 112 of file wg_scrollbar.cpp.

References wGui::CRect::Height(), HORIZONTAL, wGui::CWindow::m_ClientRect, m_pBtnDownRight, m_pBtnUpLeft, m_ScrollBarType, wGui::CRangeControl< int >::m_Value, wGui::CWindow::m_WindowRect, SetValue(), wGui::CWindow::SetWindowRect(), VERTICAL, and wGui::CRect::Width().

Referenced by wGui::CListBox::SetWindowRect(), and wGui::CTextBox::UpdateScrollBars().

void wGui::CScrollBar::MoveWindow ( const CPoint MoveDistance  )  [virtual]

Move the window and any child windows

Parameters:
MoveDistance The relative distance to move the window

Reimplemented from wGui::CWindow.

Definition at line 140 of file wg_scrollbar.cpp.

References m_ThumbRect, and wGui::CWindow::MoveWindow().

bool wGui::CScrollBar::OnMouseButtonDown ( CPoint  Point,
unsigned int  Button 
) [virtual]

This is called whenever the scrollbar is clicked on by the mouse Only the topmost window that bounds the point will be called by the system

Parameters:
Point The point where the mouse clicked
Button A bitfield indicating which button the window was clicked with
Returns:
True if it's in the bounds of the scrollbar

Reimplemented from wGui::CWindow.

Definition at line 147 of file wg_scrollbar.cpp.

References wGui::CRangeControl< int >::Decrement(), wGui::CRect::HitTest(), wGui::CRangeControl< int >::Increment(), wGui::CMouseMessage::LEFT, m_bDragging, wGui::CWindow::m_bVisible, wGui::CWindow::m_ClientRect, m_iJumpAmount, m_ThumbRect, wGui::CRangeControl< int >::m_Value, wGui::CWindow::OnMouseButtonDown(), wGui::CRect::RELPOS_ABOVE, wGui::CRect::RELPOS_BELOW, wGui::CRect::RELPOS_INSIDE, wGui::CRect::RELPOS_LEFT, wGui::CRect::RELPOS_RIGHT, SetValue(), wGui::CWindow::ViewToWindow(), wGui::CMouseMessage::WHEELDOWN, and wGui::CMouseMessage::WHEELUP.

bool wGui::CScrollBar::HandleMessage ( CMessage pMessage  )  [virtual]

CScrollBars handle MOUSE_BUTTONDOWN and MOUSE_BUTTONUP messages

Parameters:
pMessage A pointer to the message

Reimplemented from wGui::CWindow.

Definition at line 187 of file wg_scrollbar.cpp.

References wGui::CRangeControl< int >::ConstrainValue(), wGui::CMessage::CTRL_SINGLELCLICK, wGui::CMessage::CTRL_VALUECHANGE, wGui::CMessage::CTRL_VALUECHANGING, wGui::CRangeControl< int >::Decrement(), wGui::CMessage::Destination(), Draw(), wGui::CWindow::HandleMessage(), wGui::CRect::Height(), HORIZONTAL, wGui::CRangeControl< int >::Increment(), wGui::CMessageServer::Instance(), wGui::CRect::Left(), wGui::CMouseMessage::LEFT, m_bDragging, wGui::CWindow::m_ClientRect, wGui::CRangeControl< int >::m_MaxLimit, wGui::CRangeControl< int >::m_MinLimit, m_pBtnDownRight, m_pBtnUpLeft, wGui::CWindow::m_pParentWindow, m_ScrollBarType, m_ThumbRect, wGui::CRangeControl< int >::m_Value, wGui::CMessage::MessageType(), wGui::CMessage::MOUSE_BUTTONUP, wGui::CMessage::MOUSE_MOVE, wGui::CMouseMessage::Point, wGui::CMessageServer::QueueMessage(), RepositionThumb(), wGui::CMessage::Source(), wGui::CRect::Top(), VERTICAL, wGui::CWindow::ViewToWindow(), and wGui::CRect::Width().


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