]> git.mxchange.org Git - flightgear.git/blobdiff - src/GUI/WaypointList.cxx
fix #416: reciprocal filter broken
[flightgear.git] / src / GUI / WaypointList.cxx
index f525f213b200b23d48f41ca1b428d9a497a01b65..235ef960f572416f7aa9e4de057c2bbb819be191 100644 (file)
 #include <Navaids/positioned.hxx>
 #include <Autopilot/route_mgr.hxx>
 
+// select if the widget grabs keys necessary to fly aircraft from the keyboard,
+// or not. See http://code.google.com/p/flightgear-bugs/issues/detail?id=338
+// for discussion about why / what is going on.
+#define AVOID_FLIGHT_KEYS 1
+
 using namespace flightgear;
 
 enum {
@@ -83,7 +88,7 @@ public:
       --destIndex;
     }
     
-    int currentWpIndex = currentWaypoint();
+    unsigned int currentWpIndex = currentWaypoint();
     WayptRef w(_rm->removeWayptAtIndex(srcIndex));
     SG_LOG(SG_GENERAL, SG_INFO, "wpt:" << w->ident());
     _rm->insertWayptAtIndex(w, destIndex);
@@ -473,7 +478,10 @@ void WaypointList::drawRow(int dx, int dy, int rowIndex, int y)
   } // of valid wp altitude
   x += 60 + PUSTR_LGAP;
   
-  if (wp->speedRestriction() != RESTRICT_NONE) {
+  if (wp->speedRestriction() == SPEED_RESTRICT_MACH) {
+    count = ::snprintf(buffer, 126, "%03.2fM", wp->speedMach());
+    f->drawString(buffer, x, yy);
+  } else if (wp->speedRestriction() != RESTRICT_NONE) {
     count = ::snprintf(buffer, 126, "%dKts", (int) wp->speedKts());
     f->drawString(buffer, x, yy);
   }
@@ -656,6 +664,10 @@ int WaypointList::checkKey (int key, int updown )
   if ((updown == PU_UP) || !isVisible () || !isActive () || (window != puGetWindow())) {
     return FALSE ;
   }
+
+#ifdef AVOID_FLIGHT_KEYS
+    return FALSE;
+#endif
   
   switch (key)
   {