SkyGI::ScrollView Class Reference

Inheritance diagram for SkyGI::ScrollView:
[legend]
Collaboration diagram for SkyGI::ScrollView:
[legend]
List of all members.

Public Member Functions

 ScrollView (Window *pParent, const Rect &rFrame, unsigned int nWindowLayoutFlags, unsigned int uiFlags=0)
 ~ScrollView ()
void Paint (const Rect &rDirty)
void AddHorizontalScrollBar ()
void AddVerticalScrollBar ()
bool HasHorizontalScrollBar ()
bool HasVerticalScrollBar ()
void RemoveHorizontalScrollBar ()
void RemoveVerticalScrollBar ()
virtual void OnHorizontalScroll (int iValue, int iOldValue)
virtual void OnVerticalScroll (int iValue, int iOldValue)

Protected Attributes

ScrollBarm_pHScrollBar
ScrollBarm_pVScrollBar

Detailed Description

ScrollView

Derive from this class if you need ScrollBars.
With AddHorizontalScrollBar and AddVerticalScrollBar you can add ScrollBars to this window. The margin of the window will be ajusted automatically (meaning that the left or bottom margin gets bigger when a ScrollBar is added).
The virtual OnHoriztontalScroll and OnVerticalScroll functions get called whenever a scroll action occured.
To access the ScrollBar in your class simply use the m_pHScrollBar and m_pVScrollBar members.

Example:
                MyView::MyView(Window *pParent, const Rect& rRect) : ScrollView(pParent, rRect, WINDOW_LAYOUT_NOTHING)
                {
                        AddVerticalScrollBar();
                        m_pVScrollBar->SetMinMax(0, 100);
                        m_pVScrollBar->SetStep(1, 5);
                        m_pVScrollBar->SetValue(0);
                }


Constructor & Destructor Documentation

ScrollView::ScrollView ( Window pParent,
const Rect rFrame,
unsigned int  nWindowLayoutFlags,
unsigned int  uiFlags = 0 
)

ScrollView::~ScrollView (  ) 


Member Function Documentation

void ScrollView::Paint ( const Rect rDirty  )  [virtual]

Paint window content

Description:
This function gets called whenever an area of the window has to be redrawn. Usually you should only draw from inside the Paint function. If you need to redraw a window (when lets say some content must be updated), simply call Invalidate() which will then (asynchronly) call this paint function.

Usually you should draw the background using Window::DrawBackground(rDirty) and the border with DrawBorder(rRect). This way the user has full control over the appearance of your window, meaning he can change the background and border style.
The window content area itself is defined by the border margin and the window margin. Every window may define a margin. If you draw content into this window always make sure to not draw into the margin area. Additionally, the border has a margin too. As the user has full control to select any border for your window make sure to user the current borders margin when drawing window content. the dra Window::Paint() just redraws the background using DrawBackground. Overload this member function to add custom dawing code
Overload this member function to add custom dawing code
Parameters:
rDirty - Dirty rectangular region which has to be redrawn. Prior entering this function the painters clip region is automatically set to this dirty region.
See also:
DrawBorder, DrawBackground, Border, GetBorder, GetBorder::Margin, GetMargin

Reimplemented from SkyGI::Window.

Reimplemented in SkyGI::TextView.

void ScrollView::AddHorizontalScrollBar (  ) 

Add horizontal ScrollBar

Adds a horizontal ScrollBar at the bottom side of the View and automatically adjusts the Window margin by the height of the ScrollBar. Use m_pHScrollBar to access the scrollbar.
Note: Only one horizontal ScrollBar is possible. Calling this function multiple times has no effect

void ScrollView::AddVerticalScrollBar (  ) 

Add vertical ScrollBar

Adds a vertical ScrollBar at the right side of the View and automatically adjusts the Window margin by the width of the ScrollBar. Use m_pVScrollBar to access the scrollbar.
Note: Only one vertical ScrollBar is possible. Calling this function multiple times has no effect

bool ScrollView::HasHorizontalScrollBar (  ) 

bool ScrollView::HasVerticalScrollBar (  ) 

void ScrollView::RemoveHorizontalScrollBar (  ) 

Remove horizontal ScrollBar

Removes the horizontal ScrollBar and automatically adjusts the Window margin

void ScrollView::RemoveVerticalScrollBar (  ) 

Remove vertical ScrollBar

Removes the vertical ScrollBar and automatically adjusts the Window margin

void ScrollView::OnHorizontalScroll ( int  iValue,
int  iOldValue 
) [virtual]

Gets called when a ScrollBar action occured

Overload this method to react on ScrollBar events. Optionally you can directly connect to a method to the ScrollBar::Changed signal.

void ScrollView::OnVerticalScroll ( int  iValue,
int  iOldValue 
) [virtual]

Gets called when a ScrollBar action occured

Overload this method to react on ScrollBar events. Optionally you can directly connect to a method to the ScrollBar::Changed signal.

Reimplemented in SkyGI::TextView.


Member Data Documentation

ScrollBar* SkyGI::ScrollView::m_pHScrollBar [protected]

ScrollBar* SkyGI::ScrollView::m_pVScrollBar [protected]


Generated on Thu Dec 13 18:14:42 2007 for SkyGI by  doxygen 1.5.1-p1