1 #include <Main/globals.hxx>
2 #include <Airports/simple.hxx>
4 #include "AirportList.hxx"
7 AirportList::AirportList (int x, int y, int width, int height)
8 : puList(x, y, width, height)
12 _airports = globals->get_airports();
13 _nAirports = _airports->size();
15 _content = new char *[_nAirports+1];
16 for (int i = 0; i < _nAirports; i++) {
17 const FGAirport * airport = _airports->getAirport(i);
18 snprintf(buf, 1023, "%s %s\n",
20 airport->name.c_str());
21 _content[i] = strndup(buf, 1023);
23 _content[_nAirports] = 0;
27 AirportList::~AirportList ()
29 for (int i = 0; i < _nAirports; i++) {
37 AirportList::getStringValue ()
39 return (char *)_airports->getAirport(getIntegerValue())->id.c_str();
42 // end of AirportList.cxx