AirportList::AirportList (int x, int y, int width, int height)
: puList(x, y, width, height),
+ GUI_ID(FGCLASS_AIRPORTLIST),
_airports(globals->get_airports()),
_content(0)
{
#include <plib/pu.h>
+
+// ugly temproary workaround for plib's lack of user defined class ids FIXME
+#define FGCLASS_LIST 0x00000001
+#define FGCLASS_AIRPORTLIST 0x00000002
+class GUI_ID { public: GUI_ID(int id) : id(id) {} int id; };
+
+
#include "puList.hxx"
SG_USING_STD(string);
class FGAirportList;
-class AirportList : public puList
+class AirportList : public puList, public GUI_ID
{
public:
AirportList (int x, int y, int width, int height);
continue;
puObject *obj = _propertyObjects[i]->object;
- if (!strcmp(obj->getTypeString(), "fgList")) {
+ if ((obj->getType() & PUCLASS_LIST) && (dynamic_cast<GUI_ID *>(obj)->id & FGCLASS_LIST)) {
fgList *pl = static_cast<fgList *>(obj);
pl->update();
} else
#include <vector>
SG_USING_STD(vector);
+#include "AirportList.hxx"
+
+
class FGDialog;
class FGBinding;
class NewGUI;
};
-class fgList : public fgValueList, public puList {
+class fgList : public fgValueList, public puList, public GUI_ID {
public:
fgList(int x1, int y1, int x2, int y2, SGPropertyNode *p, int sw) :
- fgValueList(p), puList(x1, y1, x2, y2, _list, sw) {}
- virtual void update();
- virtual const char *getTypeString() { return "fgList"; }
+ fgValueList(p), puList(x1, y1, x2, y2, _list, sw), GUI_ID(FGCLASS_LIST) {}
+ void update();
};
class fgComboBox : public fgValueList, public puaComboBox {