Changeset 75:e8be66db0934 for src/mlx/gui
- Timestamp:
- 04/14/12 05:04:22 (13 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/gui/flight.py
r73 r75 64 64 label.set_justify(gtk.Justification.CENTER if pygobject 65 65 else gtk.JUSTIFY_CENTER) 66 label.set_use_markup(True) 66 67 alignment.add(label) 67 68 table.attach(alignment, 0, 1, 0, 1) … … 1216 1217 self._sid = gtk.Entry() 1217 1218 self._sid.set_width_chars(10) 1218 self._sid.set_tooltip_text("The Standard Instrument Deparature procedure followed.")1219 self._sid.set_tooltip_text("The name of the Standard Instrument Deparature procedure followed.") 1219 1220 self._sid.connect("changed", self._updateForwardButton) 1220 1221 table.attach(self._sid, 1, 2, 1, 2) … … 1320 1321 def _forwardClicked(self, button): 1321 1322 """Called when the forward button is clicked.""" 1323 self._wizard.nextPage() 1324 1325 #----------------------------------------------------------------------------- 1326 1327 class LandingPage(Page): 1328 """Page for entering landing data.""" 1329 def __init__(self, wizard): 1330 """Construct the landing page.""" 1331 help = "Enter the STAR and/or transition, runway,\n" \ 1332 "approach type and V<sub>ref</sub> used." 1333 1334 super(LandingPage, self).__init__(wizard, "Landing", help) 1335 1336 alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5, 1337 xscale = 0.0, yscale = 0.0) 1338 1339 table = gtk.Table(5, 4) 1340 table.set_row_spacings(4) 1341 table.set_col_spacings(16) 1342 table.set_homogeneous(False) 1343 alignment.add(table) 1344 self.setMainWidget(alignment) 1345 1346 self._starButton = gtk.CheckButton() 1347 self._starButton.connect("clicked", self._starButtonClicked) 1348 self._starButton.set_active(True) 1349 table.attach(self._starButton, 0, 1, 0, 1) 1350 1351 label = gtk.Label("_STAR:") 1352 label.set_use_underline(True) 1353 label.set_alignment(0.0, 0.5) 1354 table.attach(label, 1, 2, 0, 1) 1355 1356 self._star = gtk.Entry() 1357 self._star.set_width_chars(10) 1358 self._star.set_tooltip_text("The name of Standard Terminal Arrival Route followed.") 1359 self._star.connect("changed", self._updateForwardButton) 1360 self._star.set_sensitive(False) 1361 table.attach(self._star, 2, 3, 0, 1) 1362 label.set_mnemonic_widget(self._starButton) 1363 1364 self._transitionButton = gtk.CheckButton() 1365 self._transitionButton.connect("clicked", self._transitionButtonClicked) 1366 self._transitionButton.set_active(True) 1367 table.attach(self._transitionButton, 0, 1, 1, 2) 1368 1369 label = gtk.Label("_Transition:") 1370 label.set_use_underline(True) 1371 label.set_alignment(0.0, 0.5) 1372 table.attach(label, 1, 2, 1, 2) 1373 1374 self._transition = gtk.Entry() 1375 self._transition.set_width_chars(10) 1376 self._transition.set_tooltip_text("The name of transition executed or VECTORS if vectored by ATC.") 1377 self._transition.connect("changed", self._updateForwardButton) 1378 self._transition.set_sensitive(False) 1379 table.attach(self._transition, 2, 3, 1, 2) 1380 label.set_mnemonic_widget(self._transitionButton) 1381 1382 label = gtk.Label("Run_way:") 1383 label.set_use_underline(True) 1384 label.set_alignment(0.0, 0.5) 1385 table.attach(label, 1, 2, 2, 3) 1386 1387 self._runway = gtk.Entry() 1388 self._runway.set_width_chars(10) 1389 self._runway.set_tooltip_text("The runway the landing is performed on.") 1390 self._runway.connect("changed", self._updateForwardButton) 1391 table.attach(self._runway, 2, 3, 2, 3) 1392 label.set_mnemonic_widget(self._runway) 1393 1394 label = gtk.Label("_Approach type:") 1395 label.set_use_underline(True) 1396 label.set_alignment(0.0, 0.5) 1397 table.attach(label, 1, 2, 3, 4) 1398 1399 self._approachType = gtk.Entry() 1400 self._approachType.set_width_chars(10) 1401 self._approachType.set_tooltip_text("The type of the approach, e.g. ILS or VISUAL.") 1402 self._runway.connect("changed", self._updateForwardButton) 1403 table.attach(self._approachType, 2, 3, 3, 4) 1404 label.set_mnemonic_widget(self._approachType) 1405 1406 label = gtk.Label("V<sub>_ref</sub>:") 1407 label.set_use_markup(True) 1408 label.set_use_underline(True) 1409 label.set_alignment(0.0, 0.5) 1410 table.attach(label, 1, 2, 5, 6) 1411 1412 self._vref = gtk.SpinButton() 1413 self._vref.set_increments(step = 1, page = 10) 1414 self._vref.set_range(min = 50, max = 300) 1415 self._vref.set_value(140) 1416 self._vref.set_numeric(True) 1417 self._vref.set_tooltip_markup("The approach reference speed in knots.") 1418 table.attach(self._vref, 2, 3, 5, 6) 1419 label.set_mnemonic_widget(self._vref) 1420 1421 table.attach(gtk.Label("knots"), 3, 4, 5, 6) 1422 1423 button = self.addButton(gtk.STOCK_GO_BACK) 1424 button.set_use_stock(True) 1425 button.connect("clicked", self._backClicked) 1426 1427 self._button = self.addButton(gtk.STOCK_GO_FORWARD, default = True) 1428 self._button.set_use_stock(True) 1429 self._button.connect("clicked", self._forwardClicked) 1430 1431 def activate(self): 1432 """Called when the page is activated.""" 1433 self._starButton.set_sensitive(True) 1434 self._starButton.set_active(False) 1435 self._star.set_text("") 1436 1437 self._transitionButton.set_sensitive(True) 1438 self._transitionButton.set_active(False) 1439 self._transition.set_text("") 1440 1441 self._runway.set_text("") 1442 self._runway.set_sensitive(True) 1443 1444 self._approachType.set_text("") 1445 self._approachType.set_sensitive(True) 1446 1447 self._vref.set_value(140) 1448 self._vref.set_sensitive(True) 1449 1450 self._updateForwardButton() 1451 1452 def finalize(self): 1453 """Finalize the page.""" 1454 self._starButton.set_sensitive(False) 1455 self._star.set_sensitive(False) 1456 1457 self._transitionButton.set_sensitive(False) 1458 self._transition.set_sensitive(False) 1459 1460 self._runway.set_sensitive(False) 1461 1462 self._approachType.set_sensitive(False) 1463 1464 self._vref.set_sensitive(False) 1465 1466 def _starButtonClicked(self, button): 1467 """Called when the STAR button is clicked.""" 1468 active = button.get_active() 1469 self._star.set_sensitive(active) 1470 if active: 1471 self._star.grab_focus() 1472 self._updateForwardButton() 1473 1474 def _transitionButtonClicked(self, button): 1475 """Called when the Transition button is clicked.""" 1476 active = button.get_active() 1477 self._transition.set_sensitive(active) 1478 if active: 1479 self._transition.grab_focus() 1480 self._updateForwardButton() 1481 1482 def _updateForwardButton(self, widget = None): 1483 """Update the sensitivity of the forward button.""" 1484 sensitive = (self._starButton.get_active() or \ 1485 self._transitionButton.get_active()) and \ 1486 (self._star.get_text()!="" or 1487 not self._starButton.get_active()) and \ 1488 (self._transition.get_text()!="" or 1489 not self._transitionButton.get_active()) and \ 1490 self._runway.get_text()!="" and \ 1491 self._approachType.get_text()!="" 1492 self._button.set_sensitive(sensitive) 1493 1494 def _backClicked(self, button): 1495 """Called when the Back button is pressed.""" 1496 self.goBack() 1497 1498 def _forwardClicked(self, button): 1499 """Called when the forward button is clicked.""" 1322 1500 #self._wizard.nextPage() 1501 self.finalize() 1323 1502 1324 1503 #----------------------------------------------------------------------------- … … 1345 1524 self._pages.append(BriefingPage(self, False)) 1346 1525 self._pages.append(TakeoffPage(self)) 1526 self._pages.append(LandingPage(self)) 1347 1527 1348 1528 maxWidth = 0
Note:
See TracChangeset
for help on using the changeset viewer.