00001 /*************************************************************************** 00002 * Copyright (C) 2004 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 PAPYRUSGTKLINEWIDTHCOMBOBOX_H 00021 #define PAPYRUSGTKLINEWIDTHCOMBOBOX_H 00022 00023 #include <gtkmm.h> 00024 00025 #include <papyrus-gtkmm/enums.h> 00026 00027 namespace Papyrus 00028 { 00029 namespace Gtk 00030 { 00031 00042 class LineWidthComboBox : public ::Gtk::ComboBox 00043 { 00044 public: 00045 LineWidthComboBox ( int active = 0, double start=1.0, double stop=6.0, INCREMENT increment=INCREMENT_LINEAR, double factor=1.0 ); 00046 00047 ~LineWidthComboBox(); 00048 00049 double width(); 00050 double start(); 00051 double stop(); 00052 void start_stop ( double& start, double& stop ); 00053 00054 void set_start ( double start ); 00055 void set_stop ( double stop ); 00056 void set_start_stop ( double start, double stop ); 00057 00058 double factor(); 00059 void set_factor ( double factor ); 00060 00061 INCREMENT increment_type(); 00062 void set_increment_type ( INCREMENT increment ); 00063 00064 protected: 00065 00066 class ModelColumns: public ::Gtk::TreeModelColumnRecord 00067 { 00068 public: 00069 ModelColumns() 00070 { 00071 add ( picture ); 00072 } 00073 00074 ::Gtk::TreeModelColumn<Glib::RefPtr<Gdk::Pixbuf> > picture; 00075 }; 00076 00077 Glib::RefPtr< ::Gtk::ListStore> m_store; 00078 std::vector<Glib::RefPtr<Gdk::Pixbuf> > m_pixbufs; 00079 ModelColumns m_columns; 00080 00081 double m_start, m_stop, m_factor; 00082 INCREMENT m_increment; 00083 00084 void load_pixbufs(); 00085 00086 00087 }; 00088 00089 } 00090 00091 } 00092 00093 #endif