pick/simple.h

00001 /***************************************************************************
00002  *   Copyright (C) 2004 by Rick L. Vinyard, Jr.                            *
00003  *   rvinyard@cs.nmsu.edu                                                  *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU Lesser General Public License as        *
00007  *   published by the Free Software Foundation version 2.1.                *
00008  *                                                                         *
00009  *   This program is distributed in the hope that it will be useful,       *
00010  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00011  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00012  *   GNU General Public License for more details.                          *
00013  *                                                                         *
00014  *   You should have received a copy of the GNU Lesser General Public      *
00015  *   License along with this library; if not, write to the                 *
00016  *   Free Software Foundation, Inc.,                                       *
00017  *   51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA              *
00018  ***************************************************************************/
00019 
00020 #include <gtkmm.h>
00021 
00022 #include <papyrusmm/viewport.h>
00023 #include <papyrus/rectangle.h>
00024 #include <papyrus/image.h>
00025 #include <papyrus/circle.h>
00026 #include <papyrus/text.h>
00027 #include <papyrus/polyline.h>
00028 #include <papyrus/polygon.h>
00029 #include <papyrus/regularpolygon.h>
00030 
00031 class Simple : public Gtk::Window
00032 {
00033 
00034 public:
00035   Simple();
00036   virtual ~Simple();
00037 
00038 protected:
00039   //Signal handlers:
00040 
00041   //Member widgets:
00042   Gtk::VBox m_vbox;
00043   Gtk::Frame m_frame;
00044   Gtk::HScale m_slider;
00045   Gtk::HScale m_zoom;
00046   Gtk::CheckButton m_animate;
00047   PapyrusGtk::Viewport m_viewport;
00048   Papyrus::Rectangle::pointer m_rect;
00049   Papyrus::Image::pointer m_png;
00050   Papyrus::Circle::pointer m_circle;
00051   Papyrus::Text::pointer m_text;
00052   Papyrus::Polyline::pointer m_lines;
00053   Papyrus::Polygon::pointer m_polygon;
00054   Papyrus::Rectangle::pointer m_bboxrect;
00055   Papyrus::Group::pointer m_bbox;
00056   Papyrus::RegularPolygon::pointer m_regularpolygon;
00057   Papyrus::Group::pointer m_grouped;
00058 
00059   void slider_changed();
00060   void zoom_changed();
00061   bool animate_step();
00062   void animate_toggled();
00063   void on_sig_size_allocate(Gtk::Allocation&);
00064 
00065   void adjust_canvas(int width, int height);
00066 
00067   void draw_scene();
00068 
00069   void update_bbox(double x, double y);
00070 
00071   bool on_click(GdkEventButton* button);
00072 
00073 };

Generated on Sun Jan 7 22:53:57 2007 by  doxygen 1.5.1