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

PG_WidgetList Class Reference

A group of widgets arranged in a list. More...

#include <pgwidgetlist.h>

Inheritance diagram for PG_WidgetList:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 PG_WidgetList (PG_Widget *parent, const PG_Rect &r=PG_Rect::null, const std::string &style="WidgetList")
 Constructor of the PG_Widget class.
 ~PG_WidgetList ()
 Destructor of the PG_Widget class.
PG_WidgetFindWidget (int index)
 Find a widget by a given index.
int FindIndex (PG_Widget *widget)
 Find the index of a given widget.
void ScrollTo (Uint16 ypos)
 Scroll to the specified Y-Position.
void PageUp ()
 Scroll one page up.
void PageDown ()
 Scroll one page down.
void AddChild (PG_Widget *child)
 Add a clientwidget (which will be embedded into this widget).

Protected Member Functions

PG_WidgetGetWidgetFromPos (Sint32 y)
 Search for a widget at a given y-position.

Detailed Description

A group of widgets arranged in a list.

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

Definition at line 46 of file pgwidgetlist.h.


Constructor & Destructor Documentation

PG_WidgetList::PG_WidgetList PG_Widget parent,
const PG_Rect r = PG_Rect::null,
const std::string &  style = "WidgetList"
 

Constructor of the PG_Widget class.

Definition at line 35 of file pgwidgetlist.cpp.

References PG_ScrollWidget::LoadThemeStyle(), PG_ScrollWidget::my_scrollarea, and PG_ScrollArea::SetShiftOnRemove().

PG_WidgetList::~PG_WidgetList  ) 
 

Destructor of the PG_Widget class.

Definition at line 44 of file pgwidgetlist.cpp.


Member Function Documentation

void PG_WidgetList::AddChild PG_Widget child  )  [virtual]
 

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

Parameters:
child the widget to add

Reimplemented from PG_ScrollWidget.

Reimplemented in PG_ListBox.

Definition at line 46 of file pgwidgetlist.cpp.

References PG_ScrollArea::AddChild(), PG_Widget::AddChild(), PG_ScrollArea::GetAreaHeight(), PG_Widget::MoveRect(), PG_ScrollWidget::my_objHorizontalScrollbar, PG_ScrollWidget::my_objVerticalScrollbar, PG_ScrollWidget::my_scrollarea, and PG_Rect::my_ypos.

Referenced by PG_ListBox::AddChild().

int PG_WidgetList::FindIndex PG_Widget widget  ) 
 

Find the index of a given widget.

Parameters:
widget pointer to the widget
Returns:
index of the widget

Definition at line 97 of file pgwidgetlist.cpp.

References PG_Widget::GetChildList(), PG_Rect::index, and PG_Rect::next().

PG_Widget * PG_WidgetList::FindWidget int  index  ) 
 

Find a widget by a given index.

Parameters:
index index of the widget to find
Returns:
pointer to the widget

Definition at line 79 of file pgwidgetlist.cpp.

References PG_Widget::GetChildList(), PG_ScrollWidget::GetWidgetCount(), PG_ScrollWidget::my_scrollarea, and PG_Rect::next().

Referenced by MultiListBox::all(), MultiListBox::none(), PG_ListBox::SelectFirstItem(), PG_ListBox::SelectNextItem(), and PG_ListBox::SelectPrevItem().

PG_Widget * PG_WidgetList::GetWidgetFromPos Sint32  y  )  [protected]
 

Search for a widget at a given y-position.

Parameters:
y the position
Returns:
pointer to the widget or NULL

Definition at line 60 of file pgwidgetlist.cpp.

References PG_Widget::GetChildList(), PG_Rect::my_ypos, and PG_Rect::next().

void PG_WidgetList::PageDown  ) 
 

Scroll one page down.

Definition at line 121 of file pgwidgetlist.cpp.

References PG_ScrollWidget::CheckScrollBars(), PG_ScrollArea::GetScrollPosX(), PG_ScrollArea::GetScrollPosY(), PG_Rect::my_height, PG_ScrollWidget::my_scrollarea, and PG_ScrollArea::ScrollTo().

void PG_WidgetList::PageUp  ) 
 

Scroll one page up.

Definition at line 116 of file pgwidgetlist.cpp.

References PG_ScrollWidget::CheckScrollBars(), PG_ScrollArea::GetScrollPosX(), PG_ScrollArea::GetScrollPosY(), PG_Rect::my_height, PG_ScrollWidget::my_scrollarea, and PG_ScrollArea::ScrollTo().

void PG_WidgetList::ScrollTo Uint16  ypos  ) 
 

Scroll to the specified Y-Position.

Parameters:
ypos new Y-Position Will scroll to the new position and update the scrollbars.

Definition at line 111 of file pgwidgetlist.cpp.

References PG_ScrollWidget::CheckScrollBars(), PG_ScrollArea::GetScrollPosX(), PG_ScrollWidget::my_scrollarea, and PG_ScrollArea::ScrollTo().


The documentation for this class was generated from the following files:
Generated on Tue Jun 24 02:19:44 2008 for Advanced Strategic Command by  doxygen 1.4.2