summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2005-11-10 20:54:08 +0100
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2005-11-10 20:54:08 +0100
commit189a55db609cb11f64bba4a5567afa37e65c396b (patch)
treee756cb7fccb04bf9e00b926af76787a904f633d6
parent370cd0086f94d6740a56b3f6f574c47350343919 (diff)
add set_show_hidden() to GipfelWidget
-rw-r--r--src/GipfelWidget.H3
-rw-r--r--src/GipfelWidget.cxx21
2 files changed, 22 insertions, 2 deletions
diff --git a/src/GipfelWidget.H b/src/GipfelWidget.H
index 44148d6..1aebbea 100644
--- a/src/GipfelWidget.H
+++ b/src/GipfelWidget.H
@@ -37,6 +37,7 @@ class GipfelWidget : public Fl_Widget {
Fl_Menu_Button *mb;
char *img_file;
double track_width;
+ int show_hidden;
int handle(int event);
@@ -77,6 +78,8 @@ class GipfelWidget : public Fl_Widget {
void set_hide_value(double h);
+ void set_show_hidden(int h);
+
void set_view_lat(double v);
void set_view_long(double v);
diff --git a/src/GipfelWidget.cxx b/src/GipfelWidget.cxx
index bed4cd1..df07113 100644
--- a/src/GipfelWidget.cxx
+++ b/src/GipfelWidget.cxx
@@ -67,6 +67,7 @@ GipfelWidget::GipfelWidget(int X,int Y,int W, int H): Fl_Widget(X, Y, W, H) {
m2 = NULL;
img_file = NULL;
track_width = 500.0;
+ show_hidden = 0;
for (i=0; i<=3; i++) {
marker->add(new Hill(i * 10, 0));
@@ -309,7 +310,11 @@ GipfelWidget::draw() {
for (i=0; i<mnts->get_num(); i++) {
m = mnts->get(i);
- if (m->flags & (Hill::DUPLICATE|Hill::TRACK_POINT|Hill::HIDDEN)) {
+ if (m->flags & (Hill::DUPLICATE|Hill::TRACK_POINT)) {
+ continue;
+ }
+
+ if (!show_hidden && (m->flags & Hill::HIDDEN)) {
continue;
}
@@ -395,7 +400,11 @@ GipfelWidget::set_labels(Hills *v) {
for (i=0; i<v->get_num(); i++) {
m = v->get(i);
- if (m->flags & (Hill::DUPLICATE|Hill::TRACK_POINT|Hill::HIDDEN)) {
+ if (m->flags & (Hill::DUPLICATE|Hill::TRACK_POINT)) {
+ continue;
+ }
+
+ if (!show_hidden && (m->flags & Hill::HIDDEN)) {
continue;
}
@@ -623,6 +632,14 @@ GipfelWidget::set_hide_value(double h) {
}
void
+GipfelWidget::set_show_hidden(int h) {
+ show_hidden = h;
+ set_labels(pan->get_visible_mountains());
+
+ redraw();
+
+}
+void
GipfelWidget::set_view_lat(double v) {
pan->set_view_lat(v);
set_labels(pan->get_visible_mountains());