1 #ifndef _PROP_PICKER_HXX
2 #define _PROP_PICKER_HXX
9 #include <simgear/props/props.hxx>
11 void prop_pickerInit();
12 void prop_pickerView( puObject * );
13 void prop_pickerRefresh();
14 void prop_editOpen( const char * name, const char * value );
20 class fgPropPicker : public fgPopup, public SGPropertyChangeListener {
22 static void handle_select ( puObject *b );
23 static void input_entered ( puObject *b );
24 static void fgPropPickerHandleSlider ( puObject * slider );
25 static void fgPropPickerHandleArrow ( puObject *arrow );
26 static void fgPropPickerHandleOk ( puObject* b );
28 void delete_arrays ();
30 // update the text string in the puList using the given node and
31 // updating the requested offset. The value of dotFiles is taken
32 // into account before the index is applied, i.e this should be
33 // an index into 'children' */
34 void updateTextForEntry(int index);
39 char startDir [ PUSTRING_MAX * 2 ];
41 SGPropertyNode_ptr* children;
44 // set if we're display the . and .. entries at the start of the
52 puOneShot *cancel_button;
54 puArrowButton *down_arrow;
55 puArrowButton *up_arrow;
61 void find_props ( bool restore_slider_pos = false );
62 fgPropPicker ( int x, int y, int w, int h, int arrows,
63 const char *dir, const char *title = "Pick a file" );
67 static void go_up_one_directory ( char *fname );
68 static void chop_file ( char *fname );
70 // over-ride the method from SGPropertyNodeListener
71 virtual void valueChanged (SGPropertyNode * node);
76 class fgPropEdit : public fgPopup {
78 static void fgPropEditHandleCancel ( puObject *b );
79 static void fgPropEditHandleOK ( puObject* b );
83 puOneShot *cancel_button;
91 char propPath [ PUSTRING_MAX * 2 ];
93 fgPropEdit ( const char *name, const char *value, char *proppath );
97 static void go_up_one_directory ( char *fname );
98 static void chop_file ( char *fname );
101 #endif // _PROP_PICKER_HXX