// Draw an airport or waypoint label on the moving map
// Specify position by the map pixel co-ordinate of the left or right, bottom, of the *visible* portion of the label.
// The black background quad will automatically overlap this by 1 pixel.
-void KLN89::DrawLabel(string s, int x1, int y1, bool right_align) {
+void KLN89::DrawLabel(const string& s, int x1, int y1, bool right_align) {
MapToInstrument(x1, y1);
if(!right_align) {
for(unsigned int i=0; i<s.size(); ++i) {
// Draw an airport or waypoint label on the moving map
// Specify position by the map pixel co-ordinate of the left or right, bottom, of the *visible* portion of the label.
// The black background quad will automatically overlap this by 1 pixel.
- void DrawLabel(string s, int x1, int y1, bool right_align = false);
+ void DrawLabel(const string& s, int x1, int y1, bool right_align = false);
int GetLabelQuadrant(double h);
int GetLabelQuadrant(double h1, double h2);
}\r
}\r
\r
-void KLN89Page::ShowScratchpadMessage(string line1, string line2) {\r
+void KLN89Page::ShowScratchpadMessage(const string& line1, const string& line2) {\r
_scratchpadLine1 = line1;\r
_scratchpadLine2 = line2;\r
_scratchpadTimer = 0.0;\r
_entInvert = false;\r
}\r
\r
-void KLN89Page::SetId(string s) {\r
+void KLN89Page::SetId(const string& s) {\r
_id = s;\r
}\r
\r
-string KLN89Page::GetId() {\r
+const string& KLN89Page::GetId() {\r
return(_id);\r
}\r
inline void SetEntInvert(bool b) { _entInvert = b; }\r
\r
// Get / Set a waypoint id, NOT the page name!\r
- virtual void SetId(string s);\r
- virtual string GetId();\r
+ virtual void SetId(const string& s);\r
+ virtual const string& GetId();\r
\r
protected:\r
KLN89* _kln89;\r
string _id; // The ID of the waypoint that the page is displaying.\r
// Doesn't make sense for all pages, but does for all the data pages.\r
\r
- void ShowScratchpadMessage(string line1, string line2);\r
+ void ShowScratchpadMessage(const string& line1, const string& line2);\r
\r
bool _scratchpadMsg; // Set true when there is a scratchpad message to display\r
double _scratchpadTimer; // Used for displaying the scratchpad messages for the right amount of time.\r
KLN89Page::Update(dt);
}
-void KLN89AptPage::SetId(string s) {
+void KLN89AptPage::SetId(const string& s) {
_last_apt_id = _apt_id;
_save_apt_id = _apt_id;
_apt_id = s;
void Knob2Left1();
void Knob2Right1();
- void SetId(string s);
+ void SetId(const string& s);
private:
// Update the cached airport details
KLN89Page::Update(dt);
}
-void KLN89DirPage::SetId(string s) {
+void KLN89DirPage::SetId(const string& s) {
if(s.size()) {
_id = s;
// TODO - fill in lat, lon, type
} else {
_kln89->DtoInitiate(_id);
}
-}
\ No newline at end of file
+}
void Update(double dt);
- void SetId(string s);
+ void SetId(const string& s);
void ClrPressed();
void EntPressed();
// Override the base class GetId function to return the waypoint ID under the cursor
// on FPL0 page, if there is one and the cursor is on.
// Otherwise return an empty string.
- inline string GetId() { return(_fp0SelWpId); }
+ inline const string& GetId() { return(_fp0SelWpId); }
private:
int _fpMode; // 0 = Dis, 1 = Dtk
KLN89Page::Update(dt);
}
-void KLN89IntPage::SetId(string s) {
+void KLN89IntPage::SetId(const string& s) {
_last_int_id = _int_id;
_save_int_id = _int_id;
_int_id = s;
void Knob2Left1();
void Knob2Right1();
- void SetId(string s);
+ void SetId(const string& s);
private:
string _int_id;
KLN89Page::Update(dt);
}
-void KLN89NDBPage::SetId(string s) {
+void KLN89NDBPage::SetId(const string& s) {
_last_ndb_id = _ndb_id;
_save_ndb_id = _ndb_id;
_ndb_id = s;
void Knob2Left1();
void Knob2Right1();
- void SetId(string s);
+ void SetId(const string& s);
private:
string _ndb_id;
KLN89Page::Update(dt);
}
-void KLN89VorPage::SetId(string s) {
+void KLN89VorPage::SetId(const string& s) {
_last_vor_id = _vor_id;
_save_vor_id = _vor_id;
_vor_id = s;
void Knob2Left1();
void Knob2Right1();
- void SetId(string s);
+ void SetId(const string& s);
private:
string _vor_id;