Main Page | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

GList Class Reference

List widget. More...

#include <GList.h>

Inheritance diagram for GList:

GLayout GView GTarget GEvent GFlags List of all members.

Public Member Functions

 GList (int id, int x, int y, int cx, int cy, char *name="List")
 Constructor.
virtual void OnItemClick (GListItem *Item, GMouse &m)
 Called when an item is clicked.
virtual void OnItemBeginDrag (GListItem *Item, GMouse &m)
 Called when the user selects an item and starts to drag it.
virtual void OnItemSelect (GListItem *Item)
virtual void OnColumnClick (int Col, GMouse &m)
 Called when a column is clicked.
virtual void OnColumnDrag (int Col, GMouse &m)
 Called when a column is dragged somewhere.
virtual bool OnColumnReindex (GListColumn *Col, int OldIndex, int NewIndex)
 Called when the column is dropped to a new location.
void OnPaint (GSurface *pDC)
 Called to paint the onscreen representation of the view.
int OnEvent (GMessage *Msg)
 Handles the incoming events.
int OnHitTest (int x, int y)
 Return the type of cursor that should be visible when the mouse is at x,y.
void OnMouseClick (GMouse &m)
 The mouse was clicked over this view.
void OnMouseMove (GMouse &m)
 The mouse moves over the control.
int OnNotify (GView *Ctrl, int Flags)
 Called when a child view or view with it's SetNotify() set to this window changes.
void OnPosChange ()
 Called when the view position changes.
bool OnKey (GKey &k)
 A key was pressed while this view has focus.
void OnMouseWheel (double Lines)
 The mouse wheel was scrolled.
void OnFocus (bool b)
 The view gains or loses the keyboard focus.
void OnPulse ()
 Called every so often by the timer system.
GListColumnAddColumn (char *Name, int Width=50, int Where=-1)
 Adds a column to the list.
bool AddColumn (GListColumn *Col, int Where=-1)
 Adds a preexisting column to the control.
bool DeleteColumn (GListColumn *Col)
 Deletes a column from the GList.
void EmptyColumns ()
 Deletes all the columns of the GList.
GListColumnColumnAt (int Index)
 Returns the column at index 'Index'.
int ColumnAtX (int X, GListColumn **Col=0, int *Offset=0)
 Returns the column at horizontal offset 'x'.
int GetColumns ()
 Returns the number of columns.
void DragColumn (int Index)
 Starts a column d'n'd operation with the column at index 'Index'.
bool GetColumnClickInfo (int &Col, GMouse &m)
 Returns the last column click info.
bool ShowColumnHeader ()
 Returns whether display of column headers is switched on.
void ShowColumnHeader (bool Show)
 Turns on display of column headers.
bool AllowEditLabels ()
 Returns whether the user can edit labels.
void AllowEditLabels (bool b)
 Sets whether the user can edit labels.
bool DrawGridLines ()
 Returns whether grid lines are drawn.
void DrawGridLines (bool b)
 Sets whether grid lines are drawn.
bool MultiSelect ()
 Returns whether the user can select multiple items at the same time.
void MultiSelect (bool b)
 Sets whether the user can select multiple items at the same time.
GListMode GetMode ()
void SetMode (GListMode m)
int Value ()
 Returns the index of the first selected item.
void Value (int i)
 Selects the item at index 'i'.
bool Select (GListItem *Obj)
 Selects 'obj'.
GListItemGetSelection ()
 Gets the first selected object.
bool GetSelection (List< GListItem > &l)
 Gets all the selected objects.
void SelectAll ()
 Select all the item in the list.
bool GetAll (List< GListItem > &l)
 Fills the list 'l' pointers to all the items in the list, however the GList retains ownership of the objects.
void ScrollToSelection ()
 Scrolls the view to the first selected item if not in view.
void UpdateAllItems ()
 Clears the text cache for all the items and repaints the screen.
GListItemFirst ()
 Returns the first item in the list.
GListItemLast ()
 Returns the list item in the list.
GListItemNext ()
 Returns the next item in the list.
GListItemPrev ()
 Returns the previous item in the list.
GListItemCurrent ()
 Returns the current item in the list. This is not the selected item(s).
int GetItems ()
 Gets the number of items.
bool IsEmpty ()
 Returns true if the list is empty.
bool Delete ()
 Deletes the current item.
bool Delete (int Index)
 Deletes the item at index 'Index'.
bool Delete (GListItem *p)
 Deletes the item 'p'.
bool Insert (GListItem *p, int Index=-1, bool Update=true)
 Inserts the item 'p' at index 'Index'.
bool Insert (List< GListItem > &l, int Index=-1, bool Update=true)
 Insert a list of item.
bool Remove (GListItem *Obj)
 Remove the item 'Obj' but don't delete it.
bool HasItem (GListItem *Obj)
 Return true if the item 'Obj' is in the list.
int IndexOf (GListItem *Obj)
 Return the index of the item 'Obj' or -1 if not present.
GListItemItemAt (int Index)
 Returns the item at index 'Index'.
void Sort (GListCompareFunc Compare, int Data)
 Sort the list.
void Empty ()
 Removes all items from list and delete the objects.
void RemoveAll ()
 Removes all references to externally owned items. Doesn't delete objects.
void ResizeColumnsToContent (int Border=DEFAULT_COLUMN_SPACING)
 Resizes all the columns to their content, allowing a little extra space for visual effect.

Friends

class GListItem
class GListColumn

Detailed Description

List widget.


Constructor & Destructor Documentation

GList::GList int  id,
int  x,
int  y,
int  cx,
int  cy,
char *  name = "List"
 

Constructor.

Parameters:
id  The control's ID
x  Left edge position
y  Top edge position
cx  The width
cy  The height
name  An unseen descriptor of the control


Member Function Documentation

bool GList::AddColumn GListColumn Col,
int  Where = -1
 

Adds a preexisting column to the control.

Parameters:
Col  The column object. The object once added is owned by the GList
Where  The location to insert or -1 to append

GListColumn * GList::AddColumn char *  Name,
int  Width = 50,
int  Where = -1
 

Adds a column to the list.

Parameters:
Name  The text for the column or NULL for no text
Width  The width of the column
Where  The index to insert at, or -1 to append to the end

GListMode GList::GetMode  ) 
 

Get the display mode.

See also:
GListMode

bool GList::Insert List< GListItem > &  l,
int  Index = -1,
bool  Update = true
 

Insert a list of item.

Parameters:
l  The items to insert
Index  The starting index to insert at
Update  True if you want the list to update immediately. If you are inserting a lot of item list quickly then you should pass false here and then update just once at the end of the insertions.

bool GList::Insert GListItem p,
int  Index = -1,
bool  Update = true
 

Inserts the item 'p' at index 'Index'.

Parameters:
i  The item to insert
Index  The index to insert at or -1 for append
Update  True if you want the list to update immediately. If you are inserting a lot of items quickly then you should pass false here and then update just once at the end of the insertions.

void GList::OnColumnClick int  Col,
GMouse m
[virtual]
 

Called when a column is clicked.

Parameters:
Col  The index of the column
m  The mouse parameters at the time

virtual void GList::OnColumnDrag int  Col,
GMouse m
[inline, virtual]
 

Called when a column is dragged somewhere.

Parameters:
Col  The column index
m  The mouse parameters at the time

virtual bool GList::OnColumnReindex GListColumn Col,
int  OldIndex,
int  NewIndex
[inline, virtual]
 

Called when the column is dropped to a new location.

Parameters:
Col  The column dropped
OldIndex  The old index
NewIndex  The new index

void GList::OnItemBeginDrag GListItem Item,
GMouse m
[virtual]
 

Called when the user selects an item and starts to drag it.

Parameters:
Item  The item being dragged
m  The mouse parameters at the time

void GList::OnItemClick GListItem Item,
GMouse m
[virtual]
 

Called when an item is clicked.

Parameters:
Item  The item clicked
m  The mouse parameters for the click

void GList::OnItemSelect GListItem Item  )  [virtual]
 

Called when the user selects an item. If multiple items are selected in one hit this is only called for the first item. Use GetSelection to get the extent of the selected items.

Parameters:
Item  The item selected

int GList::OnNotify GView Ctrl,
int  Flags
[virtual]
 

Called when a child view or view with it's SetNotify() set to this window changes.

The event by default will bubble up to the GWindow at the top of the window heirarchy visiting each GView on the way. If it reaches a GView that processes it then the event stops propergating up the heirarchy.

Reimplemented from GLayout.

void GList::OnPulse  )  [virtual]
 

Called every so often by the timer system.

See also:
SetPulse()

Reimplemented from GView.

void GList::SetMode GListMode  m  ) 
 

Set the display mode.

See also:
GListMode

void GList::Sort GListCompareFunc  Compare,
int  Data
 

Sort the list.

Parameters:
Compare  The comparision function. Should return a integer greater then > 0 if the first item item is greater in value.
Data  User defined 32-bit value passed through to the 'Compare' function


The documentation for this class was generated from the following files:
Generated on Wed Oct 26 14:47:00 2005 for Lgi by  doxygen 1.4.1