Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages | Examples

PG_ScrollWidget Class Reference

Inheritance diagram for PG_ScrollWidget:

Inheritance graph
[legend]
Collaboration diagram for PG_ScrollWidget:

Collaboration graph
[legend]
List of all members.

Detailed Description

Encapsulation of the PG_ScrollArea widget providing scrollbars.

Author:
Alexander Pipelka

Generally used to make a large 'pane' of widgets that can be scrolled through in a smaller 'portal' with scrollbars.


Public Types

enum  { IDWIDGETLIST_SCROLL = PG_WIDGETID_INTERNAL + 10 }

Public Member Functions

 PG_ScrollWidget (PG_Widget *parent, const PG_Rect &r=PG_Rect::null, const char *style="ScrollWidget")
 Constructor of the PG_Widget class.

 ~PG_ScrollWidget ()
 Destructor of the PG_Widget class.

void LoadThemeStyle (const char *widgettype)
 Load a specific themestyle.

void EnableScrollBar (bool enable, PG_ScrollBar::ScrollDirection direction=PG_ScrollBar::VERTICAL)
 Enable / disable the Scrollbar (override automatic display).

void ScrollTo (Uint16 x, Uint16 y)
 scroll to a give X/Y-Coordinate within the client area.

void ScrollToWidget (PG_Widget *widget, bool bVertical=true)
 Scroll to a widget.

Uint16 GetListHeight ()
Uint16 GetListWidth ()
Uint16 GetWidgetCount ()
PG_WidgetGetFirstInList ()
virtual void DeleteAll ()
virtual void RemoveAll ()
void AddChild (PG_Widget *child)
 Add a clientwidget (which will be embedded into this widget).


Protected Member Functions

void eventSizeWidget (Uint16 w, Uint16 h)
 Callback for the SizeWidget event.

bool handleScrollPos (PG_ScrollBar *widget, long data)
bool handleScrollTrack (PG_ScrollBar *widget, long data)
bool handleAreaChangedHeight (PG_ScrollArea *area, Uint16 h)
bool handleAreaChangedWidth (PG_ScrollArea *area, Uint16 w)
void CheckScrollBars ()

Protected Attributes

PG_ScrollBarmy_objVerticalScrollbar
PG_ScrollBarmy_objHorizontalScrollbar
PG_ScrollAreamy_scrollarea
PG_Rect my_rectVerticalScrollbar
PG_Rect my_rectHorizontalScrollbar
PG_Rect my_rectList
int my_widthScrollbar
int my_heightHorizontalScrollbar
bool my_enableVerticalScrollbar
bool my_enableHorizontalScrollbar


Member Enumeration Documentation

anonymous enum
 

Enumeration values:
IDWIDGETLIST_SCROLL 


Constructor & Destructor Documentation

PG_ScrollWidget::PG_ScrollWidget PG_Widget parent,
const PG_Rect r = PG_Rect::null,
const char *  style = "ScrollWidget"
 

Constructor of the PG_Widget class.

PG_ScrollWidget::~PG_ScrollWidget  ) 
 

Destructor of the PG_Widget class.


Member Function Documentation

void PG_ScrollWidget::AddChild PG_Widget child  )  [virtual]
 

Add a clientwidget (which will be embedded into this widget).

Parameters:
child the widget to add

Reimplemented from PG_Widget.

Reimplemented in PG_ListBox, PG_RichEdit, and PG_WidgetList.

void PG_ScrollWidget::CheckScrollBars  )  [protected]
 

virtual void PG_ScrollWidget::DeleteAll  )  [virtual]
 

Reimplemented in PG_ListBox.

void PG_ScrollWidget::EnableScrollBar bool  enable,
PG_ScrollBar::ScrollDirection  direction = PG_ScrollBar::VERTICAL
 

Enable / disable the Scrollbar (override automatic display).

Parameters:
enable true - enable scrollbar / false - disable scrollbar
direction modified scrollbar (PG_ScrollBar::VERTICAL | PG_ScrollBar::HORIZONTAL)

void PG_ScrollWidget::eventSizeWidget Uint16  w,
Uint16  h
[protected, virtual]
 

Callback for the SizeWidget event.

Parameters:
w new width
h new height This virtual function can be used to implement custom behavior for SizeWidget events.

Reimplemented from PG_ThemeWidget.

PG_Widget* PG_ScrollWidget::GetFirstInList  ) 
 

Uint16 PG_ScrollWidget::GetListHeight  ) 
 

Uint16 PG_ScrollWidget::GetListWidth  ) 
 

Uint16 PG_ScrollWidget::GetWidgetCount  ) 
 

bool PG_ScrollWidget::handleAreaChangedHeight PG_ScrollArea area,
Uint16  h
[protected]
 

bool PG_ScrollWidget::handleAreaChangedWidth PG_ScrollArea area,
Uint16  w
[protected]
 

bool PG_ScrollWidget::handleScrollPos PG_ScrollBar widget,
long  data
[protected]
 

bool PG_ScrollWidget::handleScrollTrack PG_ScrollBar widget,
long  data
[protected]
 

void PG_ScrollWidget::LoadThemeStyle const char *  widgettype  ) 
 

Load a specific themestyle.

Parameters:
widgettype name of widget type to load

Reimplemented from PG_ThemeWidget.

virtual void PG_ScrollWidget::RemoveAll  )  [virtual]
 

Reimplemented in PG_ListBox.

void PG_ScrollWidget::ScrollTo Uint16  x,
Uint16  y
 

scroll to a give X/Y-Coordinate within the client area.

Parameters:
x X-Position
y Y-Position

void PG_ScrollWidget::ScrollToWidget PG_Widget widget,
bool  bVertical = true
 

Scroll to a widget.

Parameters:
widget the target widget
bVertical scroll direction


Member Data Documentation

bool PG_ScrollWidget::my_enableHorizontalScrollbar [protected]
 

bool PG_ScrollWidget::my_enableVerticalScrollbar [protected]
 

int PG_ScrollWidget::my_heightHorizontalScrollbar [protected]
 

PG_ScrollBar* PG_ScrollWidget::my_objHorizontalScrollbar [protected]
 

PG_ScrollBar* PG_ScrollWidget::my_objVerticalScrollbar [protected]
 

PG_Rect PG_ScrollWidget::my_rectHorizontalScrollbar [protected]
 

PG_Rect PG_ScrollWidget::my_rectList [protected]
 

PG_Rect PG_ScrollWidget::my_rectVerticalScrollbar [protected]
 

PG_ScrollArea* PG_ScrollWidget::my_scrollarea [protected]
 

int PG_ScrollWidget::my_widthScrollbar [protected]
 



The ParaGUI Project - Alexander Pipelka