papyrus logo

scrolledviewport.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2009 by Rick L. Vinyard, Jr.                            *
00003  *   rvinyard@cs.nmsu.edu                                                  *
00004  *                                                                         *
00005  *   This file is part of the papyrus library.                             *
00006  *                                                                         *
00007  *   papyrus is free software; you can redistribute it and/or modify       *
00008  *   it under the terms of the GNU Lesser General Public License           *
00009  *   version 3.0 as published by the Free Software Foundation.             *
00010  *                                                                         *
00011  *   papyrus is distributed in the hope that it will be useful,            *
00012  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00013  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00014  *   GNU Lesser General Public License version 3.0 for more details.       *
00015  *                                                                         *
00016  *   You should have received a copy of the GNU Lesser General Public      *
00017  *   License along with the papyrus library. If not, see                   *
00018  *   <http://www.gnu.org/licenses/>.                                       *
00019  ***************************************************************************/
00020 #ifndef PAPYRUS_GTKSCROLLEDVIEWPORT_H
00021 #define PAPYRUS_GTKSCROLLEDVIEWPORT_H
00022 
00023 #include <gtkmm/table.h>
00024 #include <papyrus-gtkmm/viewport.h>
00025 
00026 namespace Papyrus
00027 {
00028 
00029   namespace Gtk
00030   {
00031 
00035     class ScrolledViewport : public ::Gtk::Table
00036     {
00037       public:
00038         ScrolledViewport();
00039 
00040         ~ScrolledViewport();
00041 
00042         ::Gtk::CornerType get_placement() const;
00043 
00044         void get_policy ( ::Gtk::PolicyType& hscrollbar_policy, ::Gtk::PolicyType& vscrollbar_policy ) const;
00045 
00046         ::Gtk::ShadowType get_shadow_type() const;
00047 
00048         void get_hincrements( double& hstep_increment, double& hpage_increment ) const;
00049 
00050         void get_vincrements( double& vstep_increment, double& vpage_increment ) const;
00051 
00052         void get_increments( double& hstep_increment, double& hpage_increment, double& vstep_increment, double& vpage_increment ) const;
00053 
00054         bool get_hscrollbar_visible() const;
00055 
00056         bool get_vscrollbar_visible() const;
00057 
00058         void set_placement ( ::Gtk::CornerType window_placement );
00059 
00060         void set_policy ( ::Gtk::PolicyType hscrollbar_policy, ::Gtk::PolicyType vscrollbar_policy );
00061 
00062         void set_shadow_type(::Gtk::ShadowType type);
00063 
00064         void set_hincrements( double hstep_increment, double hpage_increment );
00065 
00066         void set_vincrements( double vstep_increment, double vpage_increment );
00067 
00068         void set_increments( double hstep_increment, double hpage_increment, double vstep_increment, double vpage_increment );
00069 
00070         // TODO implement this
00071         // void unset_placement();
00072 
00073         Viewport& viewport();
00074 
00075         const Viewport& viewport() const;
00076         
00078         Papyrus::Canvas::pointer canvas();
00079         
00080         ::Gtk::Button& corner_button();
00081 
00082       protected:
00083         double m_x_low, m_x_high, m_y_low, m_y_high;
00084 
00085         Canvas::pointer m_canvas;
00086         
00087         ::Gtk::CornerType m_corner_type;
00088         ::Gtk::PolicyType m_hscrollbar_policy;
00089         ::Gtk::PolicyType m_vscrollbar_policy;
00090 
00091         Viewport m_viewport;
00092         ::Gtk::Frame m_frame;
00093         ::Gtk::Button m_corner;
00094         ::Gtk::HScrollbar m_hscrollbar;
00095         ::Gtk::VScrollbar m_vscrollbar;
00096 
00097         Region m_last_global_extents;
00098 
00099         sigc::connection m_canvas_extents_connection;
00100         sigc::connection m_canvas_scrolled_connection;
00101         sigc::connection m_canvas_size_connection;
00102 
00103         void layout_children(bool construction=false);
00104 
00105         void on_canvas_extents_changed();
00106 
00107         void on_canvas_scrolled( double x, double y );
00108 
00109         bool on_hscrollbar_changed(::Gtk::ScrollType, double);
00110 
00111         bool on_vscrollbar_changed(::Gtk::ScrollType, double);
00112 
00113         virtual void on_corner_clicked();
00114 
00115         void on_canvas_replaced();
00116 
00117     };
00118 
00119   }
00120 
00121 }
00122 
00123 #endif

Generated on Fri Apr 16 12:40:11 2010 for papyrus by doxygen 1.6.1