X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FATC%2Fatcdialog.hxx;h=3125fd3e475e2e9a585cb9ed2f6ade38a20d44d3;hb=43bc61d1318abd52de6c723dbeef0e4058b1a823;hp=f52b5b4f1852e0f7c20a8b2abdf6add13ea4c9f0;hpb=f8a8805e2dde01e0c0a962c283880fa60fa23f0f;p=flightgear.git diff --git a/src/ATC/atcdialog.hxx b/src/ATC/atcdialog.hxx index f52b5b4f1..3125fd3e4 100644 --- a/src/ATC/atcdialog.hxx +++ b/src/ATC/atcdialog.hxx @@ -40,16 +40,17 @@ #include // mkDialog #include -typedef vector StringVec; -typedef vector:: iterator StringVecIterator; +typedef std::vector StringVec; +typedef StringVec::iterator StringVecIterator; -static bool doATCDialog(const SGPropertyNode* arg); class FGATCDialogNew { private: NewGUI *_gui; bool dialogVisible; StringVec commands; + + static FGATCDialogNew *_instance; public: FGATCDialogNew(); @@ -61,8 +62,19 @@ public: 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 *currentATCDialog; #endif // _ATC_DIALOG_HXX_ \ No newline at end of file