2003-11-27 23:41:00 +00:00
|
|
|
// puList.hxx - a scrolling PUI list box.
|
|
|
|
|
|
|
|
#ifndef __PULIST_HXX
|
|
|
|
#define __PULIST_HXX 1
|
|
|
|
|
2004-04-29 09:36:27 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include <config.h>
|
|
|
|
#endif
|
|
|
|
|
2005-11-06 14:22:02 +00:00
|
|
|
#include <plib/pu.h>
|
2003-11-27 23:41:00 +00:00
|
|
|
|
2005-11-06 14:22:02 +00:00
|
|
|
# define PUCLASS_LIST 0x80000000 // Hopefully this value will never be used by plib
|
2003-11-27 23:41:00 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* A scrolling list for PUI.
|
|
|
|
*
|
|
|
|
* Believe it or not, PUI does not have one of these.
|
|
|
|
*/
|
|
|
|
class puList : public puGroup
|
|
|
|
{
|
2006-05-24 20:46:10 +00:00
|
|
|
char ** _contents;
|
|
|
|
puFrame * _frame;
|
|
|
|
puSlider * _slider;
|
|
|
|
puArrowButton * _up_arrow;
|
|
|
|
puArrowButton * _down_arrow;
|
|
|
|
int _style;
|
|
|
|
int _sw; // slider width
|
|
|
|
int _width, _height;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void init (int w, int h, short transparent);
|
|
|
|
puListBox * _list_box;
|
|
|
|
|
2003-11-27 23:41:00 +00:00
|
|
|
public:
|
2006-03-23 23:00:31 +00:00
|
|
|
puList (int x, int y, int w, int h, int sl_width = 20);
|
|
|
|
puList (int x, int y, int w, int h, char ** contents, int sl_width = 20);
|
2003-11-27 23:41:00 +00:00
|
|
|
virtual ~puList ();
|
|
|
|
|
|
|
|
virtual void newList (char ** contents);
|
2006-05-24 20:46:10 +00:00
|
|
|
|
2003-11-27 23:41:00 +00:00
|
|
|
// TODO: other string value funcs
|
2005-01-31 10:36:59 +00:00
|
|
|
virtual char * getListStringValue ();
|
|
|
|
virtual int getListIntegerValue();
|
2006-03-23 17:44:10 +00:00
|
|
|
virtual void setColourScheme (float r, float g, float b, float a);
|
|
|
|
virtual void setColour (int which, float r, float g, float b, float a);
|
2006-03-23 23:00:31 +00:00
|
|
|
virtual void setSize (int w, int h);
|
2006-03-23 17:44:10 +00:00
|
|
|
|
2006-05-24 20:46:10 +00:00
|
|
|
int getNumVisible ( void ) const { return _list_box->getNumVisible(); }
|
|
|
|
int getNumItems ( void ) const { return _list_box->getNumItems(); }
|
|
|
|
int getTopItem ( void ) const { return _list_box->getTopItem(); }
|
|
|
|
void setTopItem (int index);
|
2003-11-27 23:41:00 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __PULIST_HXX
|