]> git.mxchange.org Git - flightgear.git/blobdiff - src/GUI/new_gui.hxx
Clear chat messages when an aircraft becomes inactive in the property tree.
[flightgear.git] / src / GUI / new_gui.hxx
index 1ccd5662d62299f843d15bcff2022ac586691da8..981628af8406eb0843bb162eb0532ee7d0e13bae 100644 (file)
@@ -27,9 +27,10 @@ SG_USING_STD(string);
 
 #include <Main/fg_props.hxx>
 
+class SGBinding;
+
 class FGMenuBar;
 class FGDialog;
-class FGBinding;
 class FGColor;
 class FGFontCache;
 
@@ -165,6 +166,15 @@ public:
      */
     virtual FGDialog * getActiveDialog ();
 
+
+    /**
+     * Get the named dialog if active.
+     *
+     * @return The named dialog, or 0 if it isn't active.
+     */
+    virtual FGDialog * getDialog (const string &name);
+
+
     virtual FGColor *getColor (const char * name) const {
         _citt_t it = _colors.find(name);
         return (it != _colors.end()) ? it->second : NULL;
@@ -177,15 +187,8 @@ public:
     virtual puFont *getDefaultFont() { return _font; }
 
 
-    /**
-     * menu wide font cache, accessible from other classes as well.
-     */
-    FGFontCache *get_fontcache() { return _fontcache; }
-
 protected:
 
-    FGFontCache * _fontcache;
-
     /**
      * Test if the menubar is visible.
      *
@@ -293,7 +296,7 @@ class FGFontCache {
 private:
     struct fnt {
         fnt(puFont *pu = 0) : pufont(pu), texfont(0) {}
-        ~fnt() { delete pufont; delete texfont; }
+        ~fnt() { if (texfont) { delete pufont; delete texfont; } }
         puFont *pufont;
         fntTexFont *texfont;
     };
@@ -301,6 +304,8 @@ private:
 
     map<const string,fnt *> _fonts;
     typedef map<const string,fnt *>::const_iterator _itt_t;
+    bool _initialized;
+    struct fnt *getfnt(const char *name, float size, float slant);
 
 public:
     FGFontCache();
@@ -308,6 +313,10 @@ public:
 
     puFont *get(const char *name, float size=15.0, float slant=0.0);
     puFont *get(SGPropertyNode *node);
+
+    fntTexFont *getTexFont(const char *name, float size=15.0, float slant=0.0);
+
+    SGPath getfntpath(const char *name);
 };