GG::ListBox Class Reference

a flexible control that can contain rows and columns of other controls, even other ListBoxes. More...

#include <ListBox.h>

Inheritance diagram for GG::ListBox:

GG::Control GG::Wnd List of all members.

Signal Types

typedef boost::signal< void()> ClearedSignalType
typedef boost::signal< void(const std::set< int > &)> SelChangedSignalType
typedef boost::signal< void(int, ListBox::Row *)> RowSignalType
typedef boost::signal< void(int, ListBox::Row *, const
Pt &)> 
RowClickSignalType
typedef RowSignalType InsertedSignalType
typedef RowSignalType DroppedSignalType
typedef RowClickSignalType LeftClickedSignalType
typedef RowClickSignalType RightClickedSignalType
typedef RowSignalType DoubleClickedSignalType
typedef RowSignalType ErasedSignalType
typedef boost::signal< void(int)> BrowsedSignalType

Slot Types

typedef ClearedSignalType::slot_type ClearedSlotType
typedef SelChangedSignalType::slot_type SelChangedSlotType
typedef InsertedSignalType::slot_type InsertedSlotType
typedef LeftClickedSignalType::slot_type LeftClickedSlotType
typedef RightClickedSignalType::slot_type RightClickedSlotType
typedef DoubleClickedSignalType::slot_type DoubleClickedSlotType
typedef ErasedSignalType::slot_type ErasedSlotType
typedef DroppedSignalType::slot_type DroppedSlotType
typedef BrowsedSignalType::slot_type BrowsedSlotType

Accessors

ClearedSignalType ClearedSignal
SelChangedSignalType SelChangedSignal
InsertedSignalType InsertedSignal
DroppedSignalType DroppedSignal
LeftClickedSignalType LeftClickedSignal
RightClickedSignalType RightClickedSignal
DoubleClickedSignalType DoubleClickedSignal
ErasedSignalType ErasedSignal
BrowsedSignalType BrowsedSignal
virtual Pt MinUsableSize () const
virtual Pt ClientUpperLeft () const
virtual Pt ClientLowerRight () const
bool Empty () const
const RowGetRow (int n) const
int Caret () const
const std::set< int > & Selections () const
bool Selected (int n) const
Clr InteriorColor () const
Clr HiliteColor () const
Flags< ListBoxStyle > Style () const
const RowColHeaders () const
int FirstRowShown () const
int FirstColShown () const
int LastVisibleRow () const
int LastVisibleCol () const
int NumRows () const
int NumCols () const
bool KeepColWidths () const
int SortCol () const
int ColWidth (int n) const
Alignment ColAlignment (int n) const
Alignment RowAlignment (int n) const
const std::set< std::string > & AllowedDropTypes () const
bool AutoScrollDuringDragDrops () const
int AutoScrollMargin () const
int AutoScrollInterval () const

Structors

 ListBox (int x, int y, int w, int h, Clr color, Clr interior=CLR_ZERO, Flags< WndFlag > flags=CLICKABLE)
virtual ~ListBox ()

Mutators

virtual void StartingChildDragDrop (const Wnd *wnd, const GG::Pt &offset)
virtual void AcceptDrops (std::list< Wnd * > &wnds, const Pt &pt)
virtual void ChildrenDraggedAway (const std::list< Wnd * > &wnds, const Wnd *destination)
virtual void Render ()
virtual void KeyPress (Key key, Flags< ModKey > mod_keys)
virtual void MouseWheel (const Pt &pt, int move, Flags< ModKey > mod_keys)
virtual void DragDropEnter (const Pt &pt, const std::map< Wnd *, Pt > &drag_drop_wnds, Flags< ModKey > mod_keys)
virtual void DragDropHere (const Pt &pt, const std::map< Wnd *, Pt > &drag_drop_wnds, Flags< ModKey > mod_keys)
virtual void DragDropLeave ()
virtual void TimerFiring (int ticks, Timer *timer)
virtual void SizeMove (const Pt &ul, const Pt &lr)
virtual void Disable (bool b=true)
virtual void SetColor (Clr c)
int Insert (Row *row, int at=-1)
RowErase (int idx)
void Clear ()
void SelectRow (int n)
void DeselectRow (int n)
void SelectAll ()
void DeselectAll ()
RowGetRow (int n)
void SetSelections (const std::set< int > &s)
void SetCaret (int idx)
void BringRowIntoView (int n)
void SetInteriorColor (Clr c)
void SetHiliteColor (Clr c)
void SetStyle (Flags< ListBoxStyle > s)
void SetColHeaders (Row *r)
void RemoveColHeaders ()
void SetColWidth (int n, int w)
void SetNumCols (int n)
void SetSortCol (int n)
void SetSortCmp (const boost::function< bool(const Row &, const Row &, int)> &sort_cmp)
void LockColWidths ()
void UnLockColWidths ()
void SetColAlignment (int n, Alignment align)
void SetRowAlignment (int n, Alignment align)
void AllowDropType (const std::string &str)
void DisallowDropType (const std::string &str)
void AutoScrollDuringDragDrops (bool auto_scroll)
void SetAutoScrollMargin (int margin)
void SetAutoScrollInterval (int interval)
virtual void DefineAttributes (WndEditor *editor)

Exceptions

 GG_ABSTRACT_EXCEPTION (Exception)
 GG_CONCRETE_EXCEPTION (DontAcceptDrop, GG::ListBox, Exception)

Structors

 ListBox ()

Accessors

int RightMargin () const
int BottomMargin () const
int CellMargin () const
int RowUnderPt (const Pt &pt) const
int OldSelRow () const
int OldRDownRow () const
int LClickRow () const
int RClickRow () const
bool AutoScrollingUp () const
bool AutoScrollingDown () const
bool AutoScrollingLeft () const
bool AutoScrollingRight () const
int VerticalScrollPadding (int client_height_without_horizontal_scroll)
int HorizontalScrollPadding (int client_width_without_vertical_scroll)

Mutators

virtual bool EventFilter (Wnd *w, const WndEvent &event)
int Insert (Row *row, int at, bool dropped)
RowErase (int idx, bool removing_duplicate)
void BringCaretIntoView ()
void RecreateScrolls ()
void ResetAutoScrollVars ()
void Resort ()

Static Public Attributes

static const int BORDER_THICK

Friends

class DropDownList

Classes

struct  DefaultRowCmp
 sorts two Rows of a ListBox using operator<() on the Row::SortKeyType provided by the rows' SortKey() methods. More...
struct  Row
 This is a single item in a listbox. More...

Detailed Description

a flexible control that can contain rows and columns of other controls, even other ListBoxes.

A ListBox consists of rows of controls, usually text or graphics. Each row represents one item; rows can be added or removed, but not columns or individual controls (though the individual controls can be removed from a row by accessing it directly). Each Row in a ListBox must have the same number of cells and the same cell widths as all the others. If you add a row that has fewer cells than the ListBox you are adding it to, it will be padded with empty cells; likewise, if it has too many cells to fit into the Listbox, it will have cells removed. ListBoxes are designed to be easy to use in common cases, and useful in uncommon cases with only a little work. Adding a row to an empty ListBox will cause the ListBox to take on the number of columns that the row has cells, and each column will have an equal portion of the ListBox's width (any remainder is placed in the last column). This allows you to just add rows to a ListBox without worrying about setting up the ListBox in any way ahead of time. Use LockColWidths() to prevent empty ListBoxes from taking on a new row's number of columns. To create a ListBox with user-defined widths, use the ctor designed for that, or call SetNumCols(), set individual widths with SetColWidth(), and lock the column widths with LockColWidths().
Note that Rows are stored by pointer. If you want to move a Row from one ListBox to another, use GetRow(int) and Insert(Row*, int).
Note that drag-and-drop support is a key part of ListBox's functionality. As such, special effort has been made to make its use as natural and flexible as possible. This includes allowing arbitrary reordering of ListBox rows when the LIST_NOSORT is in effect, and includes the use of the DontAcceptDrop exception. The DontAcceptDrop exception can be thrown by any client of the ListBox in response to its DroppedSignal. Such a throw will cause the drop to be cancelled, even though by the time a client responds to the DroppedSignal, the dropped row is already in place in the ListBox. The exception to this is that the dropped row may be altered with a call to NormalizeRow() before the drop can be reversed; this means that drag-and-drops between ListBoxes with different numbers of columns, or different column widths or alignments should be avoided, or caught and handled. Note that a DroppedSignal is emitted for each row dropped into the ListBox, so individual rows may be accepted or rejected from a single multi-row drop.
Also note that while a ListBox can contain arbitrary Control-derived controls, in order for such controls to be automatically serialized, any user-defined Control subclasses must be registered. See the boost serialization documentation for details.

Definition at line 93 of file ListBox.h.


Member Typedef Documentation

typedef boost::signal<void ()> GG::ListBox::ClearedSignalType

emitted when the list box is cleared

Definition at line 173 of file ListBox.h.

typedef boost::signal<void (const std::set<int>&)> GG::ListBox::SelChangedSignalType

emitted when one or more rows are selected or deselected

Definition at line 175 of file ListBox.h.

typedef boost::signal<void (int, ListBox::Row*)> GG::ListBox::RowSignalType

the signature of row-change-notification signals

Definition at line 177 of file ListBox.h.

typedef boost::signal<void (int, ListBox::Row*, const Pt&)> GG::ListBox::RowClickSignalType

the signature of row-click-notification signals

Definition at line 179 of file ListBox.h.

typedef RowSignalType GG::ListBox::InsertedSignalType

emitted when a row is inserted into the list box; provides the index of the insertion point and the Row inserted

Definition at line 180 of file ListBox.h.

typedef RowSignalType GG::ListBox::DroppedSignalType

emitted when a row is inserted into the list box via drag-and-drop; provides the index of the drop point and the Row dropped

Definition at line 181 of file ListBox.h.

typedef RowClickSignalType GG::ListBox::LeftClickedSignalType

emitted when a row in the listbox is left-clicked; provides the index of the row left-clicked and the Row contents left-clicked

Definition at line 182 of file ListBox.h.

typedef RowClickSignalType GG::ListBox::RightClickedSignalType

emitted when a row in the listbox is right-clicked; provides the index of the row right-clicked and the Row contents right-clicked

Definition at line 183 of file ListBox.h.

typedef RowSignalType GG::ListBox::DoubleClickedSignalType

emitted when a row in the listbox is left-double-clicked; provides the index of the row double-clicked and the Row contents double-clicked

Definition at line 184 of file ListBox.h.

typedef RowSignalType GG::ListBox::ErasedSignalType

emitted when a row in the listbox is erased; provides the index of the deletion point

Definition at line 185 of file ListBox.h.

typedef boost::signal<void (int)> GG::ListBox::BrowsedSignalType

emitted when a row in the listbox is "browsed" (rolled over) by the cursor; provides the index of the browsed row

Definition at line 186 of file ListBox.h.

typedef ClearedSignalType::slot_type GG::ListBox::ClearedSlotType

type of functor(s) invoked on a ClearedSignalType

Definition at line 190 of file ListBox.h.

typedef SelChangedSignalType::slot_type GG::ListBox::SelChangedSlotType

type of functor(s) invoked on a SelChangedSignalType

Definition at line 191 of file ListBox.h.

typedef InsertedSignalType::slot_type GG::ListBox::InsertedSlotType

type of functor(s) invoked on a InsertedSignalType

Definition at line 192 of file ListBox.h.

typedef LeftClickedSignalType::slot_type GG::ListBox::LeftClickedSlotType

type of functor(s) invoked on a LeftClickedSignalType

Definition at line 193 of file ListBox.h.

typedef RightClickedSignalType::slot_type GG::ListBox::RightClickedSlotType

type of functor(s) invoked on a RightClickedSignalType

Definition at line 194 of file ListBox.h.

typedef DoubleClickedSignalType::slot_type GG::ListBox::DoubleClickedSlotType

type of functor(s) invoked on a DoubleClickedSignalType

Definition at line 195 of file ListBox.h.

typedef ErasedSignalType::slot_type GG::ListBox::ErasedSlotType

type of functor(s) invoked on a ErasedSignalType

Definition at line 196 of file ListBox.h.

typedef DroppedSignalType::slot_type GG::ListBox::DroppedSlotType

type of functor(s) invoked on a DroppedSignalType

Definition at line 197 of file ListBox.h.

typedef BrowsedSignalType::slot_type GG::ListBox::BrowsedSlotType

type of functor(s) invoked on a BrowsedSignalType

Definition at line 198 of file ListBox.h.


Constructor & Destructor Documentation

GG::ListBox::ListBox ( int  x,
int  y,
int  w,
int  h,
Clr  color,
Clr  interior = CLR_ZERO,
Flags< WndFlag >  flags = CLICKABLE 
)

basic ctor

virtual GG::ListBox::~ListBox (  )  [virtual]

virtual dtor

GG::ListBox::ListBox (  )  [protected]

default ctor


Member Function Documentation

virtual Pt GG::ListBox::MinUsableSize (  )  const [virtual]

returns the size of the minimum bounding box that can enclose the Wnd and still show all of its elements, plus enough room for interaction with those elements (if applicable).

For example, a TextControl's MinUsableSize() is just the area of its text, and a Scroll's RenderableMinSize() is the combined sizes of its up-button, down-button, and tab (plus a bit of room in which to drag the tab).

Reimplemented from GG::Wnd.

virtual Pt GG::ListBox::ClientUpperLeft (  )  const [virtual]

returns upper-left corner of window's client area in screen coordinates (or of the entire area, if no client area is specified).

Virtual because different windows have different shapes (and so ways of calculating client area)

Reimplemented from GG::Wnd.

virtual Pt GG::ListBox::ClientLowerRight (  )  const [virtual]

returns (one pixel past) lower-right corner of window's client area in screen coordinates (or of the entire area, if no client area is specified).

Virtual because different windows have different shapes (and so ways of calculating client area)

Reimplemented from GG::Wnd.

bool GG::ListBox::Empty (  )  const

returns true when the ListBox is empty

const Row& GG::ListBox::GetRow ( int  n  )  const

returns a const reference to the row at index n; not range-checked

int GG::ListBox::Caret (  )  const

returns the index of the row that has the caret

const std::set<int>& GG::ListBox::Selections (  )  const

returns a const reference to the set row indexes that is currently selected

bool GG::ListBox::Selected ( int  n  )  const

returns true if row n is selected

Clr GG::ListBox::InteriorColor (  )  const

returns the color painted into the client area of the control

Clr GG::ListBox::HiliteColor (  )  const

returns the color behind selected line items

Flags<ListBoxStyle> GG::ListBox::Style (  )  const

returns the style flags of the listbox

See also:
GG::ListBoxStyle

const Row& GG::ListBox::ColHeaders (  )  const

returns the row containing the headings for the columns, if any. If undefined, the returned heading Row will have size() 0.

int GG::ListBox::FirstRowShown (  )  const

returns the index of the first row visible in the listbox

int GG::ListBox::FirstColShown (  )  const

returns the index of the first column visible in the listbox

int GG::ListBox::LastVisibleRow (  )  const

last row that could be drawn, taking into account the contents and the size of client area

int GG::ListBox::LastVisibleCol (  )  const

last column that could be drawn, taking into account the contents and the size of client area

int GG::ListBox::NumRows (  )  const

returns the total number of rows in the ListBox

int GG::ListBox::NumCols (  )  const

returns the total number of columns in the ListBox

bool GG::ListBox::KeepColWidths (  )  const

returns true iff column widths are fixed

See also:
LockColWidths()

int GG::ListBox::SortCol (  )  const

returns the index of the column used to sort rows, when sorting is enabled.

Note:
The sort column is not range checked when it is set by the user; it may be < 0 or >= NumCols().

int GG::ListBox::ColWidth ( int  n  )  const

returns the width of column n in pixels; not range-checked

Alignment GG::ListBox::ColAlignment ( int  n  )  const

returns the alignment of column n; must be ALIGN_LEFT, ALIGN_CENTER, or ALIGN_RIGHT; not range-checked

Alignment GG::ListBox::RowAlignment ( int  n  )  const

returns the alignment of row n; must be ALIGN_TOP, ALIGN_VCENTER, or ALIGN_BOTTOM; not range-checked

const std::set<std::string>& GG::ListBox::AllowedDropTypes (  )  const

returns the set of data types allowed to be dropped over this ListBox when drag-and-drop is enabled.

Note:
If this set contains "", all drop types are allowed.

bool GG::ListBox::AutoScrollDuringDragDrops (  )  const

whether the list should autoscroll when the user is attempting to drop an item into a location that is not currently visible.

int GG::ListBox::AutoScrollMargin (  )  const

the thickness of the area around the border of the client area that will provoke an auto-scroll, if AutoScrollDuringDragDrops() returns true.

int GG::ListBox::AutoScrollInterval (  )  const

the number of milliseconds that elapse between row/column scrolls when auto-scrolling.

virtual void GG::ListBox::StartingChildDragDrop ( const Wnd wnd,
const GG::Pt offset 
) [virtual]

indicates to the Wnd that a child Wnd wnd is being dragged in a drag-and-drop operation, which gives it the opportunity to add other associated drag-and-drop Wnds (see GUI::RegisterDragDropWnd()).

offset indicates the position of the mouse relative to wnd's UpperLeft().

Reimplemented from GG::Wnd.

virtual void GG::ListBox::AcceptDrops ( std::list< Wnd * > &  wnds,
const Pt pt 
) [virtual]

handles a drop of one or more drag-and-drop wnds into this Wnd; the accepted wnds remain in the list wnds; the rejected ones do not.

This function must not not alter the order of the elements in wnds. It may only remove elements.

Reimplemented from GG::Control.

virtual void GG::ListBox::ChildrenDraggedAway ( const std::list< Wnd * > &  wnds,
const Wnd destination 
) [virtual]

handles the removal of one or more child windows that have been dropped onto another window which has accepted them as drops.

The accepting window retains ownership, so this function must not delete the children. Note that CancellingChildDragDrop() and ChildrenDraggedAway() are always called in that order, and are always called at the end of any drag-and-drop sequence performed on a child of this Wnd, whether the drag-and-drop is successful or not.

Reimplemented from GG::Wnd.

virtual void GG::ListBox::Render (  )  [virtual]

draws this Wnd.

Note that Wnds being dragged for a drag-and-drop operation are rendered twice -- once in-place as normal, once in the location of the drag operation, attached to the cursor. Such Wnds may wish to render themselves differently in those two cases. To determine which render is being performed, they can call GUI::GetGUI()->RenderingDragDropWnds().

Implements GG::Control.

virtual void GG::ListBox::KeyPress ( Key  key,
Flags< ModKey >  mod_keys 
) [virtual]

respond to down-keystrokes (focus window only).

A window may receive KeyPress() messages passed up to it from its children. For instance, Control-derived classes pass KeyPress() messages to their Parent() windows by default.

Note:
Though mouse clicks consist of a press and a release, all Control classes by default respond immediately to KeyPress(), not KeyRelease(); in fact, by default no Wnd class does anything at all on a KeyRelease event.

Reimplemented from GG::Control.

virtual void GG::ListBox::MouseWheel ( const Pt pt,
int  move,
Flags< ModKey >  mod_keys 
) [virtual]

respond to movement of the mouse wheel (move > 0 indicates the wheel is rolled up, < 0 indicates down)

Reimplemented from GG::Control.

virtual void GG::ListBox::DragDropEnter ( const Pt pt,
const std::map< Wnd *, Pt > &  drag_drop_wnds,
Flags< ModKey >  mod_keys 
) [virtual]

respond to the cursor entering the Wnd's coords while dragging drag-and-drop Wnds.

The Pts in drag_drop_wnds are the Wnds' offsets from pt.

Reimplemented from GG::Wnd.

virtual void GG::ListBox::DragDropHere ( const Pt pt,
const std::map< Wnd *, Pt > &  drag_drop_wnds,
Flags< ModKey >  mod_keys 
) [virtual]

respond to cursor moving about within the Wnd, or to cursor lingering within the Wnd for a long period of time, while dragging drag-and-drop Wnds.

A DragDropHere() message will not be generated the first time the cursor enters the window's area. In that case, a DragDropEnter() message is generated The Pts in drag_drop_wnds are the Wnds' offsets from pt.

Reimplemented from GG::Wnd.

virtual void GG::ListBox::DragDropLeave (  )  [virtual]

respond to cursor leaving the Wnd's bounds while dragging drag-and-drop Wnds.

Reimplemented from GG::Wnd.

virtual void GG::ListBox::TimerFiring ( int  ticks,
Timer timer 
) [virtual]

respond to Timer timer firing at time ticks

Reimplemented from GG::Wnd.

virtual void GG::ListBox::SizeMove ( const Pt ul,
const Pt lr 
) [virtual]

resizes the control, then resizes the scrollbars as needed

Reimplemented from GG::Wnd.

virtual void GG::ListBox::Disable ( bool  b = true  )  [virtual]

disables/enables the control; disabled controls appear greyed

Reimplemented from GG::Control.

virtual void GG::ListBox::SetColor ( Clr  c  )  [virtual]

sets the color of the control

Reimplemented from GG::Control.

int GG::ListBox::Insert ( Row row,
int  at = -1 
)

insertion sorts row into the ListBox, or inserts into an unsorted ListBox before index at; returns index of insertion point. This Row becomes the property of the ListBox.

Row* GG::ListBox::Erase ( int  idx  ) 

removes and returns the row at index idx from the ListBox, or 0 if no such row exists

void GG::ListBox::Clear (  ) 

empties the ListBox

void GG::ListBox::SelectRow ( int  n  ) 

selects row n

void GG::ListBox::DeselectRow ( int  n  ) 

deselects row n

void GG::ListBox::SelectAll (  ) 

selects all rows

void GG::ListBox::DeselectAll (  ) 

deselects all rows

Row& GG::ListBox::GetRow ( int  n  ) 

returns a reference to the Row at row index n; not range-checked

void GG::ListBox::SetSelections ( const std::set< int > &  s  ) 

sets the set of selected rows to s

void GG::ListBox::SetCaret ( int  idx  ) 

sets the position of the caret to idx

void GG::ListBox::BringRowIntoView ( int  n  ) 

moves the scrollbars so that row n is visible

void GG::ListBox::SetInteriorColor ( Clr  c  ) 

sets the color painted into the client area of the control

void GG::ListBox::SetHiliteColor ( Clr  c  ) 

sets the color behind selected line items

void GG::ListBox::SetStyle ( Flags< ListBoxStyle >  s  ) 

sets the style flags for the ListBox to s.

See also:
GG::ListBoxStyle

void GG::ListBox::SetColHeaders ( Row r  ) 

sets the row used as headings for the columns; this Row becomes property of the ListBox.

void GG::ListBox::RemoveColHeaders (  ) 

removes any columns headings set

void GG::ListBox::SetColWidth ( int  n,
int  w 
)

sets the width of column
to w; not range-checked

void GG::ListBox::SetNumCols ( int  n  ) 

sets the number of columns in the ListBox to n; if no column widths exist before this call, proportional widths are calulated and set, otherwise no column widths are set

void GG::ListBox::SetSortCol ( int  n  ) 

sets the index of the column used to sort rows when sorting is enabled; not range-checked

void GG::ListBox::SetSortCmp ( const boost::function< bool(const Row &, const Row &, int)> &  sort_cmp  ) 

sets the comparison function used to sort a given pair of Rows during row sorting.

Note that sort_cmp is assumed to produce an ascending order when used to sort; setting the LIST_SORTDESCENDING style can be used to produce a reverse sort.

void GG::ListBox::LockColWidths (  ) 

fixes the column widths; by default, an empty ListBox will take on the number of columns of its first added row.

Note:
The number of columns and their widths may still be set via SetNumCols() and SetColWidth() after this function has been called.

void GG::ListBox::UnLockColWidths (  ) 

allows the number of columns to be determined by the first row added to an empty ListBox

void GG::ListBox::SetColAlignment ( int  n,
Alignment  align 
)

sets the alignment of column n to align; not range-checked

void GG::ListBox::SetRowAlignment ( int  n,
Alignment  align 
)

sets the alignment of the Row at row index n to align; not range-checked

void GG::ListBox::AllowDropType ( const std::string &  str  ) 

allows Rows with data type str to be dropped over this ListBox when drag-and-drop is enabled.

Note:
Passing "" enables all drop types.

void GG::ListBox::DisallowDropType ( const std::string &  str  ) 

disallows Rows with data type str to be dropped over this ListBox when drag-and-drop is enabled.

Note:
If "" is still an allowed drop type, drops of type str will still be allowed, even after disallowed with a call to this function.

void GG::ListBox::AutoScrollDuringDragDrops ( bool  auto_scroll  ) 

set this to determine whether the list should autoscroll when the user is attempting to drop an item into a location that is not currently visible.

void GG::ListBox::SetAutoScrollMargin ( int  margin  ) 

sets the thickness of the area around the border of the client area that will provoke an auto-scroll, if AutoScrollDuringDragDrops() returns true.

void GG::ListBox::SetAutoScrollInterval ( int  interval  ) 

sets the number of milliseconds that elapse between row/column scrolls when auto-scrolling.

virtual void GG::ListBox::DefineAttributes ( WndEditor *  editor  )  [virtual]

provides the attributes of this object that are appropriate for a user to edit in a WndEditor; see WndEditor for details.

Reimplemented from GG::Control.

GG::ListBox::GG_ABSTRACT_EXCEPTION ( Exception   ) 

The base class for ListBox exceptions.

Reimplemented from GG::Wnd.

GG::ListBox::GG_CONCRETE_EXCEPTION ( DontAcceptDrop  ,
GG::ListBox  ,
Exception   
)

Thrown by a ListBox that does not wish to accept a received drop, for whatever reason.

This may be throw at any time during the receipt of a drop -- even in client code activated by a DroppedSignal, which is emitted after the drop has been processed and the dropped item inserted.

int GG::ListBox::RightMargin (  )  const [protected]

space skipped at right of client area for vertical scroll bar

int GG::ListBox::BottomMargin (  )  const [protected]

space skipped at bottom of client area for horizontal scroll bar

int GG::ListBox::CellMargin (  )  const [inline, protected]

the number of pixels left between the contents of each cell and the cell boundary

Definition at line 382 of file ListBox.h.

int GG::ListBox::RowUnderPt ( const Pt pt  )  const [protected]

returns row under pt, if any; value must be checked (it may be < 0 or >= NumRows())

int GG::ListBox::OldSelRow (  )  const [protected]

returns the last row that was selected with a left-button mouse-down

int GG::ListBox::OldRDownRow (  )  const [protected]

returns the last row that was selected with a right-button mouse-down

int GG::ListBox::LClickRow (  )  const [protected]

returns the last row that was left-clicked

int GG::ListBox::RClickRow (  )  const [protected]

returns the last row that was right-clicked

bool GG::ListBox::AutoScrollingUp (  )  const [protected]

returns true iff the list is being autoscrolled up due to drag-and-drop

bool GG::ListBox::AutoScrollingDown (  )  const [protected]

returns true iff the list is being autoscrolled down due to drag-and-drop

bool GG::ListBox::AutoScrollingLeft (  )  const [protected]

returns true iff the list is being autoscrolled left due to drag-and-drop

bool GG::ListBox::AutoScrollingRight (  )  const [protected]

returns true iff the list is being autoscrolled right due to drag-and-drop

int GG::ListBox::VerticalScrollPadding ( int  client_height_without_horizontal_scroll  )  [protected]

Returns the amount of vertical padding it is necessary to add to the combined height of all rows to make the vertical scroll the proper length to fully show the last row.

This is calculated by first determining the first row when the last row is visible, then determining how much left over space would result if only the range first-row-shown to last-row were visible.

int GG::ListBox::HorizontalScrollPadding ( int  client_width_without_vertical_scroll  )  [protected]

Returns the amount of horizontal padding it is necessary to add to the combined width of all columns to make the horizontal scroll the proper length to fully show the last column.

This is calculated by first determining the first column when the last column is visible, then determining how much left over space would result if only the range first-column-shown to last-column were visible.

virtual bool GG::ListBox::EventFilter ( Wnd w,
const WndEvent event 
) [protected, virtual]

handles an WndEvent destined for Wnd w, but which this Wnd is allowed to handle first.

Returns true if this filter processed the message.

Reimplemented from GG::Wnd.

int GG::ListBox::Insert ( Row row,
int  at,
bool  dropped 
) [protected]

insertion sorts into list, or inserts into an unsorted list before index "at"; returns index of insertion point

Row* GG::ListBox::Erase ( int  idx,
bool  removing_duplicate 
) [protected]

erases the row at index idx, handling it as a duplicate removal (such as for drag-and-drops within a single ListBox) if indicated

void GG::ListBox::BringCaretIntoView (  )  [protected]

makes sure caret is visible when scrolling occurs due to keystrokes etc.

void GG::ListBox::RecreateScrolls (  )  [protected]

recreates the vertical and horizontal scrolls as needed.

void GG::ListBox::ResetAutoScrollVars (  )  [protected]

resets all variables related to auto-scroll to their initial values

void GG::ListBox::Resort (  )  [protected]

performs a full resort of all rows, using the current sort functor.


Friends And Related Function Documentation

friend class DropDownList [friend]

allow complete access to DropDownList, which relies on ListBox to do its rendering

Definition at line 475 of file ListBox.h.


Member Data Documentation

ClearedSignalType GG::ListBox::ClearedSignal [mutable]

the cleared signal object for this ListBox

Definition at line 261 of file ListBox.h.

SelChangedSignalType GG::ListBox::SelChangedSignal [mutable]

the selection change signal object for this ListBox

Definition at line 262 of file ListBox.h.

InsertedSignalType GG::ListBox::InsertedSignal [mutable]

the inserted signal object for this ListBox

Definition at line 263 of file ListBox.h.

DroppedSignalType GG::ListBox::DroppedSignal [mutable]

the dropped signal object for this ListBox

Definition at line 264 of file ListBox.h.

LeftClickedSignalType GG::ListBox::LeftClickedSignal [mutable]

the left click signal object for this ListBox

Definition at line 265 of file ListBox.h.

RightClickedSignalType GG::ListBox::RightClickedSignal [mutable]

the right click signal object for this ListBox

Definition at line 266 of file ListBox.h.

DoubleClickedSignalType GG::ListBox::DoubleClickedSignal [mutable]

the double click signal object for this ListBox

Definition at line 267 of file ListBox.h.

ErasedSignalType GG::ListBox::ErasedSignal [mutable]

the erased signal object for this ListBox

Definition at line 268 of file ListBox.h.

BrowsedSignalType GG::ListBox::BrowsedSignal [mutable]

the browsed signal object for this ListBox

Definition at line 269 of file ListBox.h.

const int GG::ListBox::BORDER_THICK [static]

the thickness with which to render the border of the control

Definition at line 362 of file ListBox.h.


The documentation for this class was generated from the following file:
Generated on Wed Mar 26 14:35:42 2008 for GG by  doxygen 1.5.2