]> git.mxchange.org Git - flightgear.git/blobdiff - src/GUI/prop_picker.hxx
Don't restore initial screen geometry because there is nothing in fg_os* to resize...
[flightgear.git] / src / GUI / prop_picker.hxx
index 6f17a46dc2bc088eb83a437225c58349c30424be..fbbeabd346c379595acd3ec561f7de0b17c1c64b 100755 (executable)
@@ -7,17 +7,21 @@
 
 #include <stdio.h>
 #include "gui.h"
+#include "dialog.hxx"
+#include <simgear/props/props.hxx>
 
 void prop_pickerInit();
 void prop_pickerView( puObject * );
 void prop_pickerRefresh();
-void prop_editInit(char * name, char * value );
-void prop_editOpen( char * name, char * value );
+void prop_editInit( const char * name, const char * value );
+void prop_editOpen( const char * name, const char * value );
 
 class fgPropPicker       ;
 class fgPropEdit       ;
 
-class fgPropPicker : public puDialogBox
+class fgPropPicker : 
+    public fgPopup,
+    public SGPropertyChangeListener
 {
 
   static void handle_select ( puObject *b ) ;
@@ -26,14 +30,26 @@ class fgPropPicker : public puDialogBox
   static void fgPropPickerHandleArrow ( puObject *arrow );
   static void fgPropPickerHandleOk ( puObject* b );
 
+  void delete_arrays () ;
+
+  /** update the text string in the puList using the given node and
+      updating the requested offset. The value of dotFiles is taken
+      into account before the index is applied, i.e this should be
+      an index into 'children' */
+  void updateTextForEntry(int index);
+       
   char** files ;
-  char** names ;
-  char** values ;
-  char*  dflag ;
   int num_files   ;
   int arrow_count ;
   char startDir [ PUSTRING_MAX * 2 ] ;
 
+  SGPropertyNode_ptr* children;
+  int num_children;
+       
+  /** set if we're display the . and .. entries at the start of the
+      list */
+  bool dotFiles;
+       
 /* puInput   *input         ; */
 
 protected:
@@ -43,7 +59,10 @@ protected:
   puSlider  *slider        ;
   puOneShot *cancel_button ;
   puOneShot *ok_button     ;
+  puArrowButton *down_arrow ;
+  puArrowButton *up_arrow ;
 
+  NewGUI * _gui;
 
 public:
   puText    *proppath      ;
@@ -56,9 +75,11 @@ public:
   static void go_up_one_directory ( char *fname ) ;
   static void chop_file ( char *fname ) ;
 
+  // over-ride the method from SGPropertyNodeListener
+  virtual void valueChanged (SGPropertyNode * node);
 } ;
 
-class fgPropEdit : public puDialogBox
+class fgPropEdit : public fgPopup
 {
 
   static void fgPropEditHandleCancel ( puObject *b ) ;
@@ -70,12 +91,14 @@ protected:
   puOneShot *cancel_button ;
   puOneShot *ok_button     ;
 
+  NewGUI * _gui;
+
 public:
   puText    *propname     ;
   puInput   *propinput     ;
   char propPath [ PUSTRING_MAX * 2 ] ;
 
-  fgPropEdit ( char *name, char *value, char *proppath ) ;
+  fgPropEdit ( const char *name, const char *value, char *proppath ) ;
 
   ~fgPropEdit () {;}
 
@@ -83,4 +106,3 @@ public:
   static void chop_file ( char *fname ) ;
 
 } ;
-