]> git.mxchange.org Git - flightgear.git/blobdiff - src/GUI/puList.cxx
puList.cxx: _list_box->getIntegerValue() returns -1 as long as no list
[flightgear.git] / src / GUI / puList.cxx
index 17f654bfcfbb046cd13d09ce0da6703fa17fe05e..b99ccd4051b66d2547938c0e180af2d0c464d838 100644 (file)
@@ -53,12 +53,14 @@ handle_arrow (puObject * arrow)
 puList::puList (int x, int y, int w, int h)
     : puGroup(x, y)
 {
+    type |= PUCLASS_LIST;
     init(w, h);
 }
 
 puList::puList (int x, int y, int w, int h, char ** contents)
     : puGroup(x, y)
 {
+    type |= PUCLASS_LIST;
     init(w, h);
     newList(contents);
 }
@@ -75,9 +77,16 @@ puList::newList (char ** contents)
 }
 
 char *
-puList::getStringValue ()
+puList::getListStringValue ()
 {
-    return _contents[_list_box->getIntegerValue()];
+    int i = _list_box->getIntegerValue();
+    return i < 0 ? 0 : _contents[i];
+}
+
+int
+puList::getListIntegerValue()
+{
+  return _list_box->getIntegerValue();
 }
 
 void