From d5116e496fc750e0287a3344dd4365c49c4a5cce Mon Sep 17 00:00:00 2001 From: mfranz Date: Wed, 2 Nov 2005 13:16:58 +0000 Subject: [PATCH] make transmission buttons accessible via accelerator keys "1", "2", etc. --- src/ATC/ATCDialog.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ATC/ATCDialog.cxx b/src/ATC/ATCDialog.cxx index 65fbefd1d..0f1bc8e65 100644 --- a/src/ATC/ATCDialog.cxx +++ b/src/ATC/ATCDialog.cxx @@ -239,6 +239,7 @@ void FGATCDialog::PopupDialog() { copyProperties(button_group->getNode("button-template", true), entry); entry->removeChildren("hide", false); entry->setStringValue("property", buf); + entry->setIntValue("keynum", '1' + n); if (n == 0) entry->setBoolValue("default", true); @@ -291,7 +292,7 @@ struct atcdata { return id != a.id && distance < a.distance; } bool operator==(const atcdata& a) const { - return distance == a.distance && id == a.id; + return id == a.id && distance == a.distance; } string id; string name; @@ -307,7 +308,7 @@ void FGATCDialog::FreqDialog() { _gui->closeDialog(dialog_name); SGPropertyNode_ptr button_group = getNamedNode(dlg, "quick-buttons"); - // remove all dynamic ATC buttons + // remove all dynamic airport/ATC buttons button_group->removeChildren("button", false); // Find the ATC stations within a reasonable range (about 40 miles?) @@ -324,7 +325,7 @@ void FGATCDialog::FreqDialog() { int num_stat = current_commlist->FindByPos(lon, lat, elev, 40.0, &atc_stations); if (num_stat != 0) { map uniq; - // fill map (sorts by distance) + // fill map (sorts by distance and removes duplicates) comm_list_iterator itr = atc_stations.begin(); for (; itr != atc_stations.end(); ++itr) { Point3D station = Point3D(itr->x, itr->y, itr->z); -- 2.39.5