]> git.mxchange.org Git - flightgear.git/blob - src/GUI/puList.hxx
- Added ultra-light traffic is now a separate traffic class that can have its
[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     char ** _contents;
22     puFrame * _frame;
23     puSlider * _slider;
24     puArrowButton * _up_arrow;
25     puArrowButton * _down_arrow;
26     int _style;
27     int _sw;            // slider width
28     int _width, _height;
29
30  protected:
31     virtual void init (int w, int h, short transparent);
32     puListBox * _list_box;
33
34  public:
35     puList (int x, int y, int w, int h, int sl_width = 20);
36     puList (int x, int y, int w, int h, char ** contents, int sl_width = 20);
37     virtual ~puList ();
38
39     virtual void newList (char ** contents);
40
41     // TODO: other string value funcs
42     virtual char * getListStringValue ();
43     virtual int getListIntegerValue();
44     virtual void setColourScheme (float r, float g, float b, float a);
45     virtual void setColour (int which, float r, float g, float b, float a);
46     virtual void setSize (int w, int h);
47
48     int  getNumVisible ( void ) const { return _list_box->getNumVisible(); }
49     int  getNumItems   ( void ) const { return _list_box->getNumItems(); }
50     int  getTopItem    ( void ) const { return _list_box->getTopItem(); }
51     void setTopItem    (int index);
52
53 };
54
55 #endif // __PULIST_HXX