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 | |
| ScrollBar * | m_pHScrollBar |
| ScrollBar * | m_pVScrollBar |
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.
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); }
| ScrollView::ScrollView | ( | Window * | pParent, | |
| const Rect & | rFrame, | |||
| unsigned int | nWindowLayoutFlags, | |||
| unsigned int | uiFlags = 0 | |||
| ) |
| ScrollView::~ScrollView | ( | ) |
| void ScrollView::Paint | ( | const Rect & | rDirty | ) | [virtual] |
Paint window content
| rDirty | - Dirty rectangular region which has to be redrawn. Prior entering this function the painters clip region is automatically set to this dirty region. |
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 | ( | ) |
| bool ScrollView::HasHorizontalScrollBar | ( | ) |
| bool ScrollView::HasVerticalScrollBar | ( | ) |
| void ScrollView::RemoveHorizontalScrollBar | ( | ) |
| void ScrollView::RemoveVerticalScrollBar | ( | ) |
| 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.
ScrollBar* SkyGI::ScrollView::m_pHScrollBar [protected] |
ScrollBar* SkyGI::ScrollView::m_pVScrollBar [protected] |
1.5.1-p1