Overview     Modules     Class Hierarchy     Classes     Members  
tlp::StringsListSelectionWidget Class Reference

A widget for selecting a set of strings. More...

#include <StringsListSelectionWidget.h>

Inheritance diagram for tlp::StringsListSelectionWidget:
Collaboration diagram for tlp::StringsListSelectionWidget:

Public Types

enum  ListType { SIMPLE_LIST, DOUBLE_LIST }

Public Member Functions

 StringsListSelectionWidget (QWidget *parent=0, const ListType listType=DOUBLE_LIST, const unsigned int maxSelectedStringsListSize=0)
 StringsListSelectionWidget (const std::vector< std::string > &unselectedStringsList, QWidget *parent=0, const ListType listType=DOUBLE_LIST, const unsigned int maxSelectedStringsListSize=0)
void setListType (const ListType listType)
void setUnselectedStringsList (const std::vector< std::string > &unselectedStringsList)
void setSelectedStringsList (const std::vector< std::string > &selectedStringsList)
void clearUnselectedStringsList ()
void clearSelectedStringsList ()
void setUnselectedStringsListLabel (const std::string &unselectedStringsListLabel)
void setSelectedStringsListLabel (const std::string &selectedStringsListLabel)
void setMaxSelectedStringsListSize (const unsigned int maxSelectedStringsListSize)
std::vector< std::string > getSelectedStringsList () const
std::vector< std::string > getUnselectedStringsList () const
std::vector< std::string > getCompleteStringsList () const
void selectAllStrings ()
void unselectAllStrings ()
- Public Member Functions inherited from tlp::StringsListSelectionWidgetInterface
virtual ~StringsListSelectionWidgetInterface ()

Detailed Description

A widget for selecting a set of strings.

This widget allow to select a subset of strings from an initial input strings list. The look of the widget can be set via the ListType parameter : -> SIMPLE_LIST : the widget contains only one strings list, the selection of strings is done via the checkboxes located on the left of the items list -> DOUBLE_LIST : the widget contains two lists, the left one contains the unselected string list and the right one the selected strings list. To select a string (resp. unselect a string), it has to be moved from the list on the left to the list on the right (resp. from the list on the right to the list on the left) via the buttons located between the two lists or by drag'n drop.

Member Enumeration Documentation

Enumerator:
SIMPLE_LIST 
DOUBLE_LIST 

Constructor & Destructor Documentation

tlp::StringsListSelectionWidget::StringsListSelectionWidget ( QWidget *  parent = 0,
const ListType  listType = DOUBLE_LIST,
const unsigned int  maxSelectedStringsListSize = 0 
)

Default constructor (for qt designer)

Parameters
parentthe widget's parent
listTypethis parameter defines the widget's look (see class description)
maxSelectedStringsListSizethe maximum number of strings that can be selected (if 0, no size restriction)
tlp::StringsListSelectionWidget::StringsListSelectionWidget ( const std::vector< std::string > &  unselectedStringsList,
QWidget *  parent = 0,
const ListType  listType = DOUBLE_LIST,
const unsigned int  maxSelectedStringsListSize = 0 
)

This constructor creates the widget and initializes the unselected strings list

Parameters
unselectedStringsLista vector containing the set of strings that can be selected
parentthe widget's parent
listTypethis parameter defines the widget's look (see class description)
maxSelectedStringsListSizethe maximum number of strings that can be selected (if 0, no size restriction)

Member Function Documentation

void tlp::StringsListSelectionWidget::clearSelectedStringsList ( )
virtual

Method which empty the selected strings list

Implements tlp::StringsListSelectionWidgetInterface.

void tlp::StringsListSelectionWidget::clearUnselectedStringsList ( )
virtual

Method which empty the unselected strings list

Implements tlp::StringsListSelectionWidgetInterface.

std::vector<std::string> tlp::StringsListSelectionWidget::getCompleteStringsList ( ) const

Method which returns both of the selected and unselected strings as a vector

std::vector<std::string> tlp::StringsListSelectionWidget::getSelectedStringsList ( ) const
virtual

Method which returns the selected strings as a vector

Implements tlp::StringsListSelectionWidgetInterface.

std::vector<std::string> tlp::StringsListSelectionWidget::getUnselectedStringsList ( ) const
virtual

Method which returns the unselected strings as a vector

Implements tlp::StringsListSelectionWidgetInterface.

void tlp::StringsListSelectionWidget::selectAllStrings ( )
virtual

Method which selects all strings

Implements tlp::StringsListSelectionWidgetInterface.

void tlp::StringsListSelectionWidget::setListType ( const ListType  listType)

Method which sets the look of the widget

Parameters
listTypethis parameter defines the widget's look (see class description)
void tlp::StringsListSelectionWidget::setMaxSelectedStringsListSize ( const unsigned int  maxSelectedStringsListSize)
virtual

Method which sets the maximum size of the selected strings list

Implements tlp::StringsListSelectionWidgetInterface.

void tlp::StringsListSelectionWidget::setSelectedStringsList ( const std::vector< std::string > &  selectedStringsList)
virtual

Method which sets the selected strings list

Parameters
selectedStringsLista vector containing a set of strings to be selected

Implements tlp::StringsListSelectionWidgetInterface.

void tlp::StringsListSelectionWidget::setSelectedStringsListLabel ( const std::string &  selectedStringsListLabel)

Method which sets the label text value of the selected strings list (this method does nothing if listType = SIMPLE_LIST)

void tlp::StringsListSelectionWidget::setUnselectedStringsList ( const std::vector< std::string > &  unselectedStringsList)
virtual

Method which sets the unselected strings list

Parameters
unselectedStringsLista vector containing a set of strings to be unselected

Implements tlp::StringsListSelectionWidgetInterface.

void tlp::StringsListSelectionWidget::setUnselectedStringsListLabel ( const std::string &  unselectedStringsListLabel)

Method which sets the label text value of the unselected strings list (this method does nothing if listType = SIMPLE_LIST)

void tlp::StringsListSelectionWidget::unselectAllStrings ( )
virtual

Method which unselect all strings

Implements tlp::StringsListSelectionWidgetInterface.



Tulip Software by LaBRI Visualization Team    2001 - 2012