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

PG_ScrollArea Class Reference

Inheritance diagram for PG_ScrollArea:

Inheritance graph
[legend]
Collaboration diagram for PG_ScrollArea:

Collaboration graph
[legend]
List of all members.

Detailed Description

A widget containing other widgets which can be paned. With this widget you can create larger scrollable areas. This could be one larger client-widget or any number of widgets "spanning" the scrollable area. This widget doesn't provide scrollbars you can only move to a position by using the PG_ScrollArea::ScrollTo method.

Author:
Alexander Pipelka


Public Member Functions

 PG_ScrollArea (PG_Widget *parent, const PG_Rect &r=PG_Rect::null)
 Create a scrollarea widget.

 ~PG_ScrollArea ()
void SetShiftOnRemove (bool shiftx, bool shifty)
 Shift widgets on removal.

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.

void SetAreaWidth (Uint16 w)
 Set the width of the scrollable area manually.

void SetAreaHeight (Uint16 h)
 Set the height of the scrollable area manually.

Uint16 GetAreaWidth ()
 Get the width of the scrollable area.

Uint16 GetAreaHeight ()
 Get the height of the scrollable area.

void RemoveAll ()
 Remove all widgets from the list (without deletion).

void DeleteAll ()
 Delete (destroy) all widgets in the list.

Uint16 GetWidgetCount ()
 Get the number of widgets in the list.

Uint16 GetScrollPosX ()
Uint16 GetScrollPosY ()
void AddChild (PG_Widget *child)
 Add a clientwidget (which will be embedded into this widget).

bool RemoveChild (PG_Widget *child)
PG_WidgetGetFirstInList ()

Public Attributes

SignalAreaChangedHeight sigAreaChangedHeight
SignalAreaChangedWidth sigAreaChangedWidth

Protected Attributes

PG_Rect my_area
bool my_shiftx
bool my_shifty


Constructor & Destructor Documentation

PG_ScrollArea::PG_ScrollArea PG_Widget parent,
const PG_Rect r = PG_Rect::null
 

Create a scrollarea widget.

Parameters:
parent parent widget if the scrollarea should be within the client context of an other widget, or NULL if this widget has no parent.
r position and dimensions of the widget

PG_ScrollArea::~PG_ScrollArea  ) 
 


Member Function Documentation

void PG_ScrollArea::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.

void PG_ScrollArea::DeleteAll  ) 
 

Delete (destroy) all widgets in the list.

Uint16 PG_ScrollArea::GetAreaHeight  )  [inline]
 

Get the height of the scrollable area.

Returns:
width (in pixels) of the scrollable area

Uint16 PG_ScrollArea::GetAreaWidth  )  [inline]
 

Get the width of the scrollable area.

Returns:
width (in pixels) of the scrollable area

PG_Widget* PG_ScrollArea::GetFirstInList  ) 
 

Uint16 PG_ScrollArea::GetScrollPosX  ) 
 

Uint16 PG_ScrollArea::GetScrollPosY  ) 
 

Uint16 PG_ScrollArea::GetWidgetCount  ) 
 

Get the number of widgets in the list.

void PG_ScrollArea::RemoveAll  ) 
 

Remove all widgets from the list (without deletion).

bool PG_ScrollArea::RemoveChild PG_Widget child  )  [virtual]
 

Reimplemented from PG_Widget.

void PG_ScrollArea::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_ScrollArea::ScrollToWidget PG_Widget widget,
bool  bVertical = true
 

Scroll to a widget.

Parameters:
widget the target widget
bVertical scroll direction

void PG_ScrollArea::SetAreaHeight Uint16  h  ) 
 

Set the height of the scrollable area manually.

Parameters:
h new height of the scrollable area. This method overrides the automatically computed height of the scrollable area.

void PG_ScrollArea::SetAreaWidth Uint16  w  ) 
 

Set the width of the scrollable area manually.

Parameters:
w new width of the scrollable area. This method overrides the automatically computed width of the scrollable area.

void PG_ScrollArea::SetShiftOnRemove bool  shiftx,
bool  shifty
 

Shift widgets on removal.

Parameters:
shiftx shift all widgets to the right of the removed widgets.
shift shift all widgets beneath the removed one. This method controls the behaviour if a widget will be removed from the client context.


Member Data Documentation

PG_Rect PG_ScrollArea::my_area [protected]
 

bool PG_ScrollArea::my_shiftx [protected]
 

bool PG_ScrollArea::my_shifty [protected]
 

SignalAreaChangedHeight PG_ScrollArea::sigAreaChangedHeight
 

SignalAreaChangedWidth PG_ScrollArea::sigAreaChangedWidth
 



The ParaGUI Project - Alexander Pipelka