1 // kln89_page_*.[ch]xx - this file is one of the "pages" that
2 // are used in the KLN89 GPS unit simulation.
4 // Written by David Luff, started 2005.
6 // Copyright (C) 2005 - David C Luff - david.luff@nottingham.ac.uk
8 // This program is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU General Public License as
10 // published by the Free Software Foundation; either version 2 of the
11 // License, or (at your option) any later version.
13 // This program is distributed in the hope that it will be useful, but
14 // WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // General Public License for more details.
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the Free Software
20 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
28 #include "kln89_page_nrst.hxx"
30 KLN89NrstPage::KLN89NrstPage(KLN89* parent)
39 KLN89NrstPage::~KLN89NrstPage() {
42 void KLN89NrstPage::Update(double dt) {
43 // crsr is always on on nearest page
44 bool blink = _kln89->_blink;
46 _kln89->DrawText("NEAREST", 2, 3, 3);
47 if(!(_uLinePos == 1 && blink)) _kln89->DrawText("APT?", 2, 0, 2);
48 if(!(_uLinePos == 2 && blink)) _kln89->DrawText("VOR?", 2, 5, 2);
49 if(!(_uLinePos == 3 && blink)) _kln89->DrawText("NDB?", 2, 10, 2);
50 if(!(_uLinePos == 4 && blink)) _kln89->DrawText("INT?", 2, 0, 1);
51 if(!(_uLinePos == 5 && blink)) _kln89->DrawText("USR?", 2, 5, 1);
52 if(!(_uLinePos == 6 && blink)) _kln89->DrawText("SUA?", 2, 10, 1);
53 if(!(_uLinePos == 7 && blink)) _kln89->DrawText("FSS?", 2, 0, 0);
54 if(!(_uLinePos == 8 && blink)) _kln89->DrawText("CTR?", 2, 5, 0);
57 case 1: _kln89->Underline(2, 0, 2, 4); break;
58 case 2: _kln89->Underline(2, 5, 2, 4); break;
59 case 3: _kln89->Underline(2, 10, 2, 4); break;
60 case 4: _kln89->Underline(2, 0, 1, 4); break;
61 case 5: _kln89->Underline(2, 5, 1, 4); break;
62 case 6: _kln89->Underline(2, 10, 1, 4); break;
63 case 7: _kln89->Underline(2, 0, 0, 4); break;
64 case 8: _kln89->Underline(2, 5, 0, 4); break;
67 // Actually, the kln89 sim from Bendix-King dosn't draw the 'ENT'
68 // for 'APT?' if it was on 'Leg' (pos 0) immediately previously, but does if
69 // it was not on 'Leg' immediately previously. I think we can desist from
70 // reproducing this probable bug.
72 if(!blink) _kln89->DrawEnt();
75 KLN89Page::Update(dt);
78 void KLN89NrstPage::CrsrPressed() {
81 void KLN89NrstPage::EntPressed() {
83 ShowScratchpadMessage(" No ", " Nrst ");
87 void KLN89NrstPage::LooseFocus() {
89 _scratchpadMsg = false;