From e7a2566a7a4d6b52d64536737bb4bca5fd08c605 Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Sun, 14 Aug 2005 23:00:39 +0100 Subject: switch popup menu to use new choose_hill function --- src/gipfel.cxx | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) (limited to 'src/gipfel.cxx') 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 #include #include + #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; iget_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) { -- cgit v1.2.3