diff options
author | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2005-08-14 23:00:39 +0100 |
---|---|---|
committer | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2005-08-14 23:00:39 +0100 |
commit | e7a2566a7a4d6b52d64536737bb4bca5fd08c605 (patch) | |
tree | 96180a2fe4fa77c0307c74d777d874a92f1ab7bd /src/gipfel.cxx | |
parent | c68dc4526cf9a1920b79b14c1cfd030b3aa7dcb5 (diff) |
switch popup menu to use new choose_hill function
Diffstat (limited to 'src/gipfel.cxx')
-rw-r--r-- | src/gipfel.cxx | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/src/gipfel.cxx b/src/gipfel.cxx index 3c8c450..9db82fa 100644 --- a/src/gipfel.cxx +++ b/src/gipfel.cxx @@ -45,10 +45,11 @@ #include <FL/Fl_Valuator.H> #include <FL/Fl_Value_Slider.H> #include <FL/Fl_Value_Input.H> + #include "Fl_Value_Dial.H" #include "Fl_Search_Chooser.H" - #include "GipfelWidget.H" +#include "choose_hill.H" char *img_file; char *data_file; @@ -126,26 +127,11 @@ void view_height_cb(Fl_Value_Input* o, void*) { } void viewpoint_cb(Fl_Value_Input* o, void*) { - Fl_Search_Chooser *sc = new Fl_Search_Chooser("Choose Viewpoint"); - Hills *h_sort = new Hills(gipf->get_mountains()); - h_sort->sort_name(); - - for (int i=0; i<h_sort->get_num(); i++) { - Hill *m = h_sort->get(i); - if (m->flags & (HILL_DUPLICATE | HILL_TRACK_POINT)) { - continue; - } - sc->add(m->name, m); + Hill *m = choose_hill(gipf->get_mountains(), "Choose Viewpoint"); + if (m) { + gipf->set_viewpoint(m); + set_values(); } - - sc->show(); - while (sc->shown()) { - Fl::wait(); - } - - gipf->set_viewpoint((Hill*) sc->data()); - delete sc; - set_values(); } void proj_cb(Fl_Value_Input* o, void*d) { |