summaryrefslogtreecommitdiff
path: root/src/GipfelWidget.cxx
diff options
context:
space:
mode:
authorJohannes Hofmann <johannes.hofmann@gmx.de>2005-04-13 17:09:19 +0000
committerJohannes Hofmann <johannes.hofmann@gmx.de>2005-04-13 17:09:19 +0000
commita25441aaab4c15bc5a0dba9dbd4d26cc36780163 (patch)
tree5825cce00541c766f1f25fdb12c889dbae935495 /src/GipfelWidget.cxx
parent9002a841a37a4dc4acd1c55e56a5e778156a5622 (diff)
es geht voran
es geht voran
Diffstat (limited to 'src/GipfelWidget.cxx')
-rw-r--r--src/GipfelWidget.cxx28
1 files changed, 24 insertions, 4 deletions
diff --git a/src/GipfelWidget.cxx b/src/GipfelWidget.cxx
index 10b8c55..821943d 100644
--- a/src/GipfelWidget.cxx
+++ b/src/GipfelWidget.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: GipfelWidget.cxx,v 1.2 2005/04/13 18:07:16 hofmann Exp $"
+// "$Id: GipfelWidget.cxx,v 1.3 2005/04/13 19:09:19 hofmann Exp $"
//
// PSEditWidget routines.
//
@@ -41,13 +41,13 @@
GipfelWidget::GipfelWidget(int X,int Y,int W, int H): Fl_Widget(X, Y, W, H) {
-
img = NULL;
+ pan = new Panorama();
fl_register_images();
}
int
-GipfelWidget::load(const char *file) {
+GipfelWidget::load_image(const char *file) {
img = new Fl_JPEG_Image(file);
if (img == NULL) {
@@ -59,9 +59,21 @@ GipfelWidget::load(const char *file) {
return 0;
}
+int
+GipfelWidget::load_data(const char *file) {
+ return pan->load_file(file);
+}
+
+int
+GipfelWidget::set_viewpoint(const char *pos) {
+ return pan->set_viewpoint(pos);
+}
void
GipfelWidget::draw() {
+ Mountain *m;
+ int center = w() / 2;
+
if (img == NULL) {
return;
}
@@ -71,8 +83,16 @@ GipfelWidget::draw() {
fl_color(FL_RED);
+ fl_font(FL_COURIER, 10);
+ m = pan->get_visible_mountains();
+ while (m) {
+ int m_x = pan->get_x(m);
+
+ fl_line(center + m_x + x(), 0 + y(), center + m_x + x(), h() + y());
+ fl_draw(m->name, m_x + x(), 20 + y() + m_x / 4);
+ m = m->get_next();
+ }
- fl_draw_box(FL_UP_BOX, x()+20, y()+20, 25,25, FL_GRAY);
fl_pop_clip();
}