]> git.mxchange.org Git - flightgear.git/blobdiff - src/ATC/atcdialog.hxx
Make environment-manager closest airport updating quieter, and use an event instead...
[flightgear.git] / src / ATC / atcdialog.hxx
index 1a54debfbb7d8a6810d988c0c78dfbba0f1d75f2..3125fd3e475e2e9a585cb9ed2f6ade38a20d44d3 100644 (file)
 #include <GUI/gui.h>           // mkDialog
 #include <GUI/new_gui.hxx>
 
+typedef std::vector<std::string> StringVec;
+typedef StringVec::iterator StringVecIterator;
 
-static bool doATCDialog(const SGPropertyNode* arg);
 
 class FGATCDialogNew {
 private:
      NewGUI *_gui;
-     bool dialogVisible;       
+     bool dialogVisible;
+     StringVec commands;
+
+     static FGATCDialogNew *_instance;
 public:
 
     FGATCDialogNew();
@@ -56,8 +60,21 @@ public:
 
     void update(double dt);
     void PopupDialog();
+    void addEntry(int, string);
+    void removeEntry(int);
+
+    static bool popup( const SGPropertyNode * ) {
+        instance()->PopupDialog();
+        return true;
+    }
+
+    inline static FGATCDialogNew * instance() {
+        if( _instance != NULL ) return _instance;
+        _instance = new FGATCDialogNew();
+        _instance->init();
+        return _instance;
+    }
 };
 
-extern FGATCDialogNew *current_atcdialog;
 
 #endif // _ATC_DIALOG_HXX_
\ No newline at end of file