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

wftk::ListBox Class Reference

A multi-line selection with scroll bar. More...

#include <listbox.h>

Inheritance diagram for wftk::ListBox:

wftk::SingleContainer wftk::Widget wftk::ScreenArea List of all members.

Public Member Functions

 ListBox ()
 Default constructor.
void setColor (const Color &color)
 set the background color the ListBox, or the text color of the selected row
void setSelectedColor (const Color &color)
 set the color of the selected row
std::string getSelection () const
 get which element is selected
void addElement (const std::string &data)
 add an element to the ListBox
void addElements (const std::vector< std::string > &data)
 add a list of elements to the ListBox
void clear ()
 empty the ListBox
void scrollUp ()
 scroll up in the list
void scrollDown ()
 scroll down in the list
void setSelected (const std::string &item)
 select this item

Public Attributes

SigC::Signal1< void, const
std::string & > 
selectionChanged
 signal to send when the selection changes

Detailed Description

A multi-line selection with scroll bar.


Member Function Documentation

void wftk::ListBox::addElement const std::string &  data  ) 
 

add an element to the ListBox

Parameters:
data a string containing the element to add to the list

void wftk::ListBox::addElements const std::vector< std::string > &  data  ) 
 

add a list of elements to the ListBox

Parameters:
data a std::vector containing the strings with the element names

std::string wftk::ListBox::getSelection  )  const [inline]
 

get which element is selected

Returns:
a std::string containing the selected element, or "" if nothing is selected

void wftk::ListBox::setColor const Color color  ) 
 

set the background color the ListBox, or the text color of the selected row

Parameters:
color a color ressource

Reimplemented from wftk::Widget.

void wftk::ListBox::setSelected const std::string &  item  ) 
 

select this item

Parameters:
item item to select

void wftk::ListBox::setSelectedColor const Color color  ) 
 

set the color of the selected row

Parameters:
color a color ressource


The documentation for this class was generated from the following files:

Generated Tue Apr 12 22:48:54 2005.
Copyright © 1998-2003 by the respective authors.

This document is licensed under the terms of the GNU Free Documentation License and may be freely distributed under the conditions given by this license.