]> git.mxchange.org Git - flightgear.git/blob - src/GUI/puList.hxx
- backport plib/cvs (transparency feature; never tried that :-)
[flightgear.git] / src / GUI / puList.hxx
1 // puList.hxx - a scrolling PUI list box.
2
3 #ifndef __PULIST_HXX
4 #define __PULIST_HXX 1
5
6 #ifdef HAVE_CONFIG_H
7 #  include <config.h>
8 #endif
9
10 #include <plib/pu.h>
11
12 # define PUCLASS_LIST   0x80000000  // Hopefully this value will never be used by plib
13
14 /**
15  * A scrolling list for PUI.
16  *
17  * Believe it or not, PUI does not have one of these.
18  */
19 class puList : public puGroup
20 {
21  public:
22     puList (int x, int y, int w, int h, int sl_width = 20);
23     puList (int x, int y, int w, int h, char ** contents, int sl_width = 20);
24     virtual ~puList ();
25
26     virtual void newList (char ** contents);
27     // TODO: other string value funcs
28     virtual char * getListStringValue ();
29     virtual int getListIntegerValue();
30     virtual void setColourScheme (float r, float g, float b, float a);
31     virtual void setColour (int which, float r, float g, float b, float a);
32     virtual void setSize (int w, int h);
33
34     int  getNumItems ( void ) const ;
35     int  getTopItem  ( void ) const { return _list_box->getTopItem(); }
36     void setTopItem (int index);
37
38  protected:
39     virtual void init (int w, int h, short transparent);
40     puListBox * _list_box;
41
42  private:
43     char ** _contents;
44     puFrame * _frame;
45     puSlider * _slider;
46     puArrowButton * _up_arrow;
47     puArrowButton * _down_arrow;
48     int _style;
49     int _sw;            // slider width
50     int _width, _height;
51 };
52
53 #endif // __PULIST_HXX