}
_activeFP = _flightPlans[0];
- // Hackish
- _entJump = -1;
- _entRestoreCrsr = false;
+ _entJump = _clrJump = -1;
+ _jumpRestoreCrsr = false;
_dispMsg = false;
_pages[(unsigned int)_cleanUpPage]->CleanUp();
_cleanUpPage = -1;
}
- _entRestoreCrsr = false;
- _entJump = -1;
+ _jumpRestoreCrsr = false;
+ _entJump = _clrJump = -1;
((KLN89Page*)_activePage)->SetEntInvert(false);
if(_mode == KLN89_MODE_DISP) {
_mode = KLN89_MODE_CRSR;
}
_curPage = _entJump;
_activePage = _pages[(unsigned int)_entJump];
- if(_entRestoreCrsr) _mode = KLN89_MODE_CRSR;
- _entJump = -1;
+ if(_jumpRestoreCrsr) _mode = KLN89_MODE_CRSR;
+ _entJump = _clrJump = -1;
}
if(_activePage == _dir_page) {
_dir_page->EntPressed();
}
void KLN89::ClrPressed() {
+ if(_clrJump >= 0) {
+ _curPage = _clrJump;
+ _activePage = _pages[(unsigned int)_clrJump];
+ if(_jumpRestoreCrsr) _mode = KLN89_MODE_CRSR;
+ _entJump = _clrJump = -1;
+ }
_activePage->ClrPressed();
}
// And a facility to save the immediately preceeding active page
KLN89Page* _lastActivePage;
- // Hackish
- int _entJump; // The page to jump back to if ent is pressed. -1 indicates no jump
- bool _entRestoreCrsr; // Indicates that pressing ENT at this point should restore cursor mode
+ // Ugly hack. Housekeeping to allow us to temporarily display one page, while remembering which
+ // other page to "jump" back to. Used when the waypoint pages are used to review waypoint entry
+ // from the flightplan page.
+ int _entJump; // The page to jump back to if ENT is pressed. -1 indicates no jump.
+ int _clrJump; // The page to jump back to if CLR is pressed. -1 indicates no jump.
+ bool _jumpRestoreCrsr; // Indicates that jump back at this point should restore cursor mode.
// Misc pages that aren't in the cyclic list.
// Direct To
_entWp = NULL;
_entWpStr.clear();
_wLinePos = 0;
+ // We can also get here from the waypoint review page, so clear _bEntExp as well
+ _bEntExp = false;
// Do we need to re-calc _fplPos here?
} else {
// First check that we're not trying to delete an approach waypoint. Note that we can delete the approach by deleting the header though.
SG_LOG(SG_GENERAL, SG_ALERT, "Error - unknown waypoint type found in KLN89::FplPage::EntPressed()\n");
}
_kln89->_activePage->SetId(_entWp->id);
- _kln89->_entJump = 7;
+ _kln89->_entJump = _kln89->_clrJump = 7;
_kln89->_cleanUpPage = 7;
- _kln89->_entRestoreCrsr = true;
+ _kln89->_jumpRestoreCrsr = true;
_kln89->_mode = KLN89_MODE_DISP;
}
_bEntExp = true;