]> git.mxchange.org Git - flightgear.git/commitdiff
Make various PUI widgets private.
authorJames Turner <zakalawe@mac.com>
Wed, 6 Feb 2013 18:04:51 +0000 (19:04 +0100)
committerJames Turner <zakalawe@mac.com>
Thu, 7 Feb 2013 12:02:52 +0000 (12:02 +0000)
src/GUI/FGPUIDialog.cxx
src/GUI/FGPUIDialog.hxx

index ebaba3cd079c3e6a6d376b9efa55a4fecf980b93..70ba763f4b155753afee914cb3ad58e889b484e9 100644 (file)
@@ -83,6 +83,90 @@ validate_format(const char *f)
     return type;
 }
 
+////////////////////////////////////////////////////////////////////////
+
+//
+// Custom subclass of puPopup to implement "draggable" windows in the
+// interface.  Note that this is a subclass of puPopup, not
+// puDialogBox.  Sadly, PUI (mis)uses subclassing to implement a
+// boolean property: modality.  That means that we can't implement
+// dragging of both puPopup windows and puDialogBoxes with the same
+// code.  Rather than duplicate code, I've chosen to implement only
+// "non-modal dragability" here.  Modal dialog boxes (like the exit
+// confirmation) are not draggable.
+//
+class fgPopup : public puPopup {
+public:
+  fgPopup(int x, int y, bool r = true, bool d = true) :
+  puPopup(x, y), _draggable(d), _resizable(r), _dragging(false)
+  {}
+  int checkHit(int b, int up, int x, int y);
+  int checkKey(int key, int updown);
+  int getHitObjects(puObject *, int x, int y);
+  bool checkHitCanvas(puObject *, int x, int y);
+  puObject *getKeyObject(puObject *, int key);
+  puObject *getActiveInputField(puObject *);
+  void applySize(puObject *);
+private:
+  enum { LEFT = 1, RIGHT = 2, TOP = 4, BOTTOM = 8 };
+  bool _draggable;
+  bool _resizable;
+  bool _dragging;
+  int _resizing;
+  int _start_cursor;
+  int _cursor;
+  int _dlgX, _dlgY, _dlgW, _dlgH;
+  int _startX, _startY;
+};
+
+
+class fgValueList {
+public:
+  fgValueList(SGPropertyNode *p);
+  virtual ~fgValueList();
+  virtual void update();
+  
+protected:
+  char **_list;
+  
+private:
+  void make_list();
+  void destroy_list();
+  SGPropertyNode_ptr _props;
+};
+
+
+class fgList : public fgValueList, public puaList, public GUI_ID {
+public:
+  fgList(int x1, int y1, int x2, int y2, SGPropertyNode *p, int sw) :
+  fgValueList(p), puaList(x1, y1, x2, y2, _list, sw), GUI_ID(FGCLASS_LIST) {}
+  void update();
+};
+
+class fgComboBox : public fgValueList, public puaComboBox {
+public:
+  fgComboBox(int x1, int y1, int x2, int y2, SGPropertyNode *p, bool editable) :
+  fgValueList(p),
+  puaComboBox(x1, y1, x2, y2, _list, editable),
+  _inHit(false)
+  {}
+  
+  void update();
+  
+  virtual void setSize(int w, int h);
+  
+  virtual int checkHit(int b, int up, int x, int y);
+  
+  virtual void recalc_bbox();
+private:
+  bool _inHit;
+};
+
+class fgSelectBox : public fgValueList, public puaSelectBox {
+public:
+  fgSelectBox(int x1, int y1, int x2, int y2, SGPropertyNode *p) :
+  fgValueList(p), puaSelectBox(x1, y1, x2, y2, _list) {}
+};
 
 ////////////////////////////////////////////////////////////////////////
 // Implementation of GUIInfo.
index 71024ca837e30059503f756dabd3bdc744f15ede..52ea117b22d54b3651ef8f50f3a55dd75522059c 100644 (file)
@@ -19,6 +19,7 @@
 #define FGCLASS_AIRPORTLIST   0x00000002
 #define FGCLASS_PROPERTYLIST  0x00000004
 #define FGCLASS_WAYPOINTLIST  0x00000008
+#define FGCLASS_LOGLIST       0x00000010
 
 class GUI_ID { public: GUI_ID(int id) : id(id) {} virtual ~GUI_ID() {} int id; };
 
@@ -192,87 +193,4 @@ private:
     std::vector<ConditionalObjectRef> _conditionalObjects;
 };
 
-//
-// Custom subclass of puPopup to implement "draggable" windows in the
-// interface.  Note that this is a subclass of puPopup, not
-// puDialogBox.  Sadly, PUI (mis)uses subclassing to implement a
-// boolean property: modality.  That means that we can't implement
-// dragging of both puPopup windows and puDialogBoxes with the same
-// code.  Rather than duplicate code, I've chosen to implement only
-// "non-modal dragability" here.  Modal dialog boxes (like the exit
-// confirmation) are not draggable.
-//
-class fgPopup : public puPopup {
-public:
-    fgPopup(int x, int y, bool r = true, bool d = true) :
-            puPopup(x, y), _draggable(d), _resizable(r), _dragging(false)
-    {}
-    int checkHit(int b, int up, int x, int y);
-    int checkKey(int key, int updown);
-    int getHitObjects(puObject *, int x, int y);
-    bool checkHitCanvas(puObject *, int x, int y);
-    puObject *getKeyObject(puObject *, int key);
-    puObject *getActiveInputField(puObject *);
-    void applySize(puObject *);
-private:
-    enum { LEFT = 1, RIGHT = 2, TOP = 4, BOTTOM = 8 };
-    bool _draggable;
-    bool _resizable;
-    bool _dragging;
-    int _resizing;
-    int _start_cursor;
-    int _cursor;
-    int _dlgX, _dlgY, _dlgW, _dlgH;
-    int _startX, _startY;
-};
-
-
-class fgValueList {
-public:
-    fgValueList(SGPropertyNode *p);
-    virtual ~fgValueList();
-    virtual void update();
-
-protected:
-    char **_list;
-
-private:
-    void make_list();
-    void destroy_list();
-    SGPropertyNode_ptr _props;
-};
-
-
-class fgList : public fgValueList, public puaList, public GUI_ID {
-public:
-    fgList(int x1, int y1, int x2, int y2, SGPropertyNode *p, int sw) :
-            fgValueList(p), puaList(x1, y1, x2, y2, _list, sw), GUI_ID(FGCLASS_LIST) {}
-    void update();
-};
-
-class fgComboBox : public fgValueList, public puaComboBox {
-public:
-    fgComboBox(int x1, int y1, int x2, int y2, SGPropertyNode *p, bool editable) :
-        fgValueList(p), 
-        puaComboBox(x1, y1, x2, y2, _list, editable),
-        _inHit(false)
-      {}
-        
-    void update();
-    
-    virtual void setSize(int w, int h);
-    
-    virtual int checkHit(int b, int up, int x, int y);
-    
-    virtual void recalc_bbox();
-private:
-    bool _inHit;
-};
-
-class fgSelectBox : public fgValueList, public puaSelectBox {
-public:
-    fgSelectBox(int x1, int y1, int x2, int y2, SGPropertyNode *p) :
-        fgValueList(p), puaSelectBox(x1, y1, x2, y2, _list) {}
-};
-
 #endif // __DIALOG_HXX