1 #ifndef _PROP_PICKER_HXX
2 #define _PROP_PICKER_HXX
9 #include <simgear/props/props.hxx>
11 // A local alternative name, for use when a variable called "string"
12 // is in scope - e.g. in classes derived from puInput.
13 typedef string stdString;
16 void prop_pickerInit();
17 void prop_pickerView( puObject * );
18 void prop_pickerRefresh();
19 void prop_editOpen(SGPropertyNode *);
22 class fgPropPicker : public fgPopup, public SGPropertyChangeListener {
24 fgPropPicker ( int x, int y, int w, int h, int arrows,
25 SGPropertyNode *, const char *title = "Pick a file" );
27 void find_props ( bool restore_slider_pos = false );
28 SGPropertyNode *getCurrent () const { return curr; }
29 void setCurrent(SGPropertyNode *p) { curr = p; }
31 // over-ride the method from SGPropertyNodeListener
32 virtual void valueChanged (SGPropertyNode * node);
37 static void handle_select ( puObject *b );
38 static void input_entered ( puObject *b );
39 static void fgPropPickerHandleSlider ( puObject * slider );
40 static void fgPropPickerHandleArrow ( puObject *arrow );
41 static void fgPropPickerHandleOk ( puObject* b );
43 void delete_arrays ();
45 // update the text string in the puList using the given node and
46 // updating the requested offset. The value of dotFiles is taken
47 // into account before the index is applied, i.e this should be
48 // an index into 'children' */
49 void updateTextForEntry(int index);
55 SGPropertyNode_ptr curr;
56 SGPropertyNode_ptr flags;
57 SGPropertyNode_ptr* children;
60 // set if we're displaying the . and .. entries at the start of the
68 puOneShot *cancel_button;
70 puArrowButton *down_arrow;
71 puArrowButton *up_arrow;
78 class fgPropEdit : public fgPopup {
80 fgPropEdit ( SGPropertyNode *node );
82 SGPropertyNode *getEditNode() const { return node; }
83 void setEditNode(SGPropertyNode *p) { node = p; }
85 static void fgPropEditHandleCancel ( puObject *b );
86 static void fgPropEditHandleOK ( puObject* b );
90 puOneShot *cancel_button;
92 SGPropertyNode_ptr node;
96 stdString namestring; // FIXME make setters/getters
101 #endif // _PROP_PICKER_HXX