diff options
-rw-r--r-- | src/Fl_Search_Chooser.H | 17 | ||||
-rw-r--r-- | src/Fl_Search_Chooser.cxx | 9 | ||||
-rw-r--r-- | src/choose_hill.cxx | 9 |
3 files changed, 18 insertions, 17 deletions
diff --git a/src/Fl_Search_Chooser.H b/src/Fl_Search_Chooser.H index aacb57e..bf5f1a7 100644 --- a/src/Fl_Search_Chooser.H +++ b/src/Fl_Search_Chooser.H @@ -12,31 +12,30 @@ #include <FL/Fl_Input.H> class Fl_Search_Browser : public Fl_Select_Browser { - public: + private: + int find_prefix(const char *p, int s, int e); + public: Fl_Search_Browser(int X, int Y, int W, int H, const char *c):Fl_Select_Browser(X,Y,W,H,c){}; int find_prefix(const char *p); - - private: - int find_prefix(const char *p, int s, int e); }; class Fl_Search_Chooser : public Fl_Window { private: + Fl_Search_Browser *sb; int visible_focus; + + static void input_cb(Fl_Input* in, void*c); + static void ok_cb(Fl_Input* in, void*c); + static void cancel_cb(Fl_Input* in, void*c); public: - Fl_Search_Browser *sb; - Fl_Search_Chooser(const char *title); void close(); - void add(const char *t, void *d); - void *data(); - int handle(int event); }; diff --git a/src/Fl_Search_Chooser.cxx b/src/Fl_Search_Chooser.cxx index b5e535f..66f2099 100644 --- a/src/Fl_Search_Chooser.cxx +++ b/src/Fl_Search_Chooser.cxx @@ -47,17 +47,20 @@ Fl_Search_Browser::find_prefix(const char *p, int s, int e) { } } -static void input_cb(Fl_Input* in, void*c) { +void +Fl_Search_Chooser::input_cb(Fl_Input* in, void*c) { Fl_Search_Browser *sb = ((Fl_Search_Chooser *) c)->sb; sb->find_prefix(in->value()); } -static void ok_cb(Fl_Input* in, void*c) { +void +Fl_Search_Chooser::ok_cb(Fl_Input* in, void*c) { Fl_Search_Chooser *sc = (Fl_Search_Chooser *) c; sc->close(); } -static void cancel_cb(Fl_Input* in, void*c) { +void +Fl_Search_Chooser::cancel_cb(Fl_Input* in, void*c) { Fl_Search_Chooser *sc = (Fl_Search_Chooser *) c; sc->sb->deselect(); sc->close(); diff --git a/src/choose_hill.cxx b/src/choose_hill.cxx index 879e18a..1d86bde 100644 --- a/src/choose_hill.cxx +++ b/src/choose_hill.cxx @@ -19,21 +19,20 @@ choose_hill(const Hills *hills, const char *l) { for (int i=0; i<h_sort->get_num(); i++) { Hill *m = h_sort->get(i); - if (m->flags & (Hill::DUPLICATE | Hill::TRACK_POINT)) { + if (m->flags & (Hill::DUPLICATE | Hill::TRACK_POINT)) continue; - } + sc->add(m->name, m); } delete h_sort; sc->show(); - while (sc->shown()) { + + while (sc->shown()) Fl::wait(); - } ret = (Hill*) sc->data(); - delete(sc); return ret; |