]> git.mxchange.org Git - flightgear.git/blob - src/GUI/prop_picker.hxx
Autopilot cleanup:
[flightgear.git] / src / GUI / prop_picker.hxx
1 /*
2   prop_picker.hxx
3
4 */
5
6 #include <plib/pu.h>
7
8 #include <stdio.h>
9 #include "gui.h"
10
11 void prop_pickerInit();
12 void prop_pickerView( puObject * );
13 void prop_pickerRefresh();
14 void prop_editInit(char * name, char * value );
15 void prop_editOpen( char * name, char * value );
16
17 class fgPropPicker       ;
18 class fgPropEdit       ;
19
20 class fgPropPicker : public puDialogBox
21 {
22
23   static void handle_select ( puObject *b ) ;
24   static void input_entered ( puObject *b ) ;
25   static void fgPropPickerHandleSlider ( puObject * slider );
26   static void fgPropPickerHandleArrow ( puObject *arrow );
27   static void fgPropPickerHandleOk ( puObject* b );
28
29   char** files ;
30   char** names ;
31   char** values ;
32   char*  dflag ;
33   int num_files   ;
34   int arrow_count ;
35   char startDir [ PUSTRING_MAX * 2 ] ;
36
37 /* puInput   *input         ; */
38
39 protected:
40
41   puFrame   *frame         ;
42   puListBox *list_box      ;
43   puSlider  *slider        ;
44   puOneShot *cancel_button ;
45   puOneShot *ok_button     ;
46   puArrowButton *down_arrow ;
47   puArrowButton *up_arrow ;
48
49 public:
50   puText    *proppath      ;
51   void find_props () ;
52   fgPropPicker ( int x, int y, int w, int h, int arrows,
53                  const char *dir, const char *title = "Pick a file" ) ;
54
55   ~fgPropPicker () {;}
56
57   static void go_up_one_directory ( char *fname ) ;
58   static void chop_file ( char *fname ) ;
59
60 } ;
61
62 class fgPropEdit : public puDialogBox
63 {
64
65   static void fgPropEditHandleCancel ( puObject *b ) ;
66   static void fgPropEditHandleOK ( puObject* b );
67
68 protected:
69
70   puFrame   *frame         ;
71   puOneShot *cancel_button ;
72   puOneShot *ok_button     ;
73
74 public:
75   puText    *propname     ;
76   puInput   *propinput     ;
77   char propPath [ PUSTRING_MAX * 2 ] ;
78
79   fgPropEdit ( char *name, char *value, char *proppath ) ;
80
81   ~fgPropEdit () {;}
82
83   static void go_up_one_directory ( char *fname ) ;
84   static void chop_file ( char *fname ) ;
85
86 } ;