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

VOSGUI::SelectList Class Reference

MetaObject implementing SelectList Object Type. More...

#include <select_list.hh>

Inheritance diagram for VOSGUI::SelectList:

VOSGUI::Select VOSGUI::Widget MetaObject VOSGUI::LocalSelectList VOSGUI::RemoteSelectList List of all members.

Public Member Functions

Static Public Member Functions

Protected Attributes


Detailed Description

MetaObject implementing SelectList Object Type.

This control presents a list of objects. One or more may be selected, in which case they are added to the "selected" group.

Todo:
add subobjects representing columns, containing properties with text or images to be used in each column. support multiple view types. icons.

add property specifying order to try determining what text to display in list (e.g. "subobj(misc:title),property-contents,context-name"). or use a list of properties. Or change the choices group to contain small structure objects (linking to label and the actual object)

Warning:
You must call initialize() for this object to work correctly.

Definition at line 58 of file select_list.hh.


Constructor & Destructor Documentation

SelectList::SelectList MetaObject superobject  ) 
 

Constructor.

Definition at line 30 of file select_list.cc.

SelectList::~SelectList  )  [virtual]
 

Destructor.

Definition at line 36 of file select_list.cc.


Member Function Documentation

void SelectList::add Vobject *  obj,
const string &  title = "item",
int  pos = -1
 

Add an object to list.

Parameters:
obj The object to add.
title Text to put in the list.
pos Position to add it at. See Vobject::insertChild() for the meaning of negative positions. If not specified, the object will be added at the end. Behavior of clients when there are "gaps" (the list is missing objects at some positions) is undefined.

Definition at line 92 of file select_list.cc.

Vobject * SelectList::choicesObjectList  ) 
 

Return the Vobject containing choices objects.

Definition at line 140 of file select_list.cc.

Vobject * SelectList::getFirstSelected  ) 
 

Get the first selected object.

This is convenient for use when multiple selection is off. (But does not make much sense when it is on). Returns 0 if there are no object selected.

Definition at line 83 of file select_list.cc.

Property * SelectList::getItemLabel Vobject &  item  ) 
 

Find a suitable label Property for an item (for internal use, primarily).

The following sources are tried, in this order:

  1. The value of the item's "misc:label" subproperty
  2. The value of the item's "misc:title" subproperty
  3. The value of the item's "misc:name" subproperty
  4. The value of the item's "misc:nick" subproperty
  5. 0

Todo:
Use a property to set the order of label sources.

Definition at line 214 of file select_list.cc.

bool SelectList::getMultiple  ) 
 

Definition at line 155 of file select_list.cc.

Property * SelectList::getMultipleObj  ) 
 

Definition at line 163 of file select_list.cc.

Referenced by getMultiple().

deque< Vobject * > SelectList::getSelected  ) 
 

Get the selected objects.

Definition at line 74 of file select_list.cc.

const string SelectList::getType  )  [virtual]
 

Return type string ("gui:widget.select.list").

Reimplemented from VOSGUI::Select.

Definition at line 58 of file select_list.cc.

void SelectList::initialize  )  [virtual]
 

Find "gui:selected" and "gui:choices" subobjects.

You MUST call this, or call setSelectedObj(), setChoicesObj() and setMultiple(), for things to work correctly.

Reimplemented from VOSGUI::Widget.

Reimplemented in VOSGUI::LocalSelectList.

Definition at line 200 of file select_list.cc.

void SelectList::registerExtenders  )  [static]
 

Register Extenders.

Reimplemented from VOSGUI::Select.

Definition at line 63 of file select_list.cc.

Referenced by VOSGUI::registerAll().

void SelectList::remove Vobject *  obj  )  throw (NoSuchObjectError)
 

Remove (the first occurance of) an object from the list.

Bug:
only removes the first occurance of the object.

Definition at line 96 of file select_list.cc.

Vobject * SelectList::selectedObjectList  ) 
 

Return the Vobject containing selected objects.

Definition at line 129 of file select_list.cc.

void SelectList::setChoicesObj Vobject *  obj  ) 
 

Set the choices container object.

Don't call after initialize() or it won't work right.

Definition at line 144 of file select_list.cc.

void SelectList::setMultiple bool  m = true,
PropertyAccessControl pac = 0
 

Set multiple selection property.

This does not affect the behavior of the add() method, rather it instructs client applications to allow or disallow multiple selections.

Parameters:
m If true, the property is set to "yes", and multiple selections should be allowed. If false, only one selection should be allowed. If no argument is given, multiple selection will be turned on. This property is initially set to "yes".
pac Property access control policty to use on this property. If not given, defaults to NoPropertyAccessControl::static_

Definition at line 150 of file select_list.cc.

Referenced by VOSGUI::LocalSelectList::initialize().

void SelectList::setSelectedObj Vobject *  obj  ) 
 

Set the selected objects container object.

Don't call after initialize() or it won't work.

Definition at line 133 of file select_list.cc.


Member Data Documentation

vRef<Vobject> VOSGUI::SelectList::choices [protected]
 

Definition at line 62 of file select_list.hh.

Referenced by add(), choicesObjectList(), initialize(), VOSGUI::LocalSelectList::initialize(), and setChoicesObj().

vRef<Vobject> VOSGUI::SelectList::selected [protected]
 

Definition at line 63 of file select_list.hh.

Referenced by getFirstSelected(), getSelected(), initialize(), VOSGUI::LocalSelectList::initialize(), selectedObjectList(), and setSelectedObj().


The documentation for this class was generated from the following files:
Generated on Tue Aug 12 03:56:13 2003 for Interreality Project - VOS by doxygen 1.3.2