964349e401
I have made the 'Select Airport from List' option in FlightGear work (I think) properly. I have some concerns about the solution, which could be broken by changes to plib (if they re-use the value I have assigned to PUCLASS_LIST), but for the moment it seems to work OK. Erik Hofman: A request has been sent to John Fay to include the puList code in the puAux subdirectory of plib so expect some changes for future version of FlightGear.
44 lines
1,009 B
C++
44 lines
1,009 B
C++
// puList.hxx - a scrolling PUI list box.
|
|
|
|
#ifndef __PULIST_HXX
|
|
#define __PULIST_HXX 1
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
# include <config.h>
|
|
#endif
|
|
|
|
#include <plib/pu.h>
|
|
|
|
# define PUCLASS_LIST 0x80000000 // Hopefully this value will never be used by plib
|
|
# define PUCLASS_LIST 0x80000000 // Hopefully this value will never be used by plib
|
|
|
|
/**
|
|
* A scrolling list for PUI.
|
|
*
|
|
* Believe it or not, PUI does not have one of these.
|
|
*/
|
|
class puList : public puGroup
|
|
{
|
|
public:
|
|
puList (int x, int y, int w, int h);
|
|
puList (int x, int y, int w, int h, char ** contents);
|
|
virtual ~puList ();
|
|
|
|
virtual void newList (char ** contents);
|
|
// TODO: other string value funcs
|
|
virtual char * getListStringValue ();
|
|
virtual int getListIntegerValue();
|
|
|
|
protected:
|
|
virtual void init (int w, int h);
|
|
|
|
private:
|
|
char ** _contents;
|
|
puFrame * _frame;
|
|
puListBox * _list_box;
|
|
puSlider * _slider;
|
|
puArrowButton * _up_arrow;
|
|
puArrowButton * _down_arrow;
|
|
};
|
|
|
|
#endif // __PULIST_HXX
|