ntab.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // gvectors is a frontend to libgvectors using gtkmm.
00004 // Copyright (C) 2007  Rafael Ostertag
00005 //
00006 // This program is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU General Public License
00008 // as published by the Free Software Foundation; either version 2
00009 // of the License, or (at your option) any later version.
00010 //
00011 // This program 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 General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU General Public License
00017 // along with this program; if not, write to the Free Software
00018 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
00019 // USA.
00020 //
00021 // $Id: ntab_8h-source.html,v 1.1 2007-09-10 23:31:15 rafi Exp $
00022 //
00023 // File:   ntab.h
00024 // Author: Rafael Ostertag
00025 //
00026 // Created on July 8, 2007, 8:17 PM
00027 //
00028 
00031 
00032 #ifndef _NTAB_H
00033 #define _NTAB_H
00034 
00035 #include <gtkmm.h>
00036 #include <gvectors.h>
00037 #include "enums.h"
00038 #include "da.h"
00039 #include "vectortv.h"
00040 
00048 class NTab : public Gtk::HPaned {
00049 public:
00051     typedef sigc::signal<void,const NTab&,bool> type_signal_tab_modified;
00052     
00053 private:
00055     GVectors::VectorStore vstore;
00057     VectorTV tv;
00059     DA da;
00061     Gtk::ScrolledWindow sw1;
00063     Gtk::ScrolledWindow sw2;
00064     
00065     Gtk::VBox vbox;
00066     Gtk::VBox view_ctrl;
00067     Gtk::HBox scale_box;
00068     Gtk::HBox rotate_x;
00069     Gtk::HBox rotate_y;
00070     Gtk::HBox rotate_z;
00071     
00072     Gtk::Label scalelabel;
00073     Gtk::SpinButton scalespin;
00074     Gtk::Adjustment scaleadj;
00075     
00076     Gtk::Label rotatexlabel;
00077     Gtk::Adjustment rotatexadj;
00078     Gtk::SpinButton rotatexspin;
00079     
00080     Gtk::Label rotateylabel;
00081     Gtk::Adjustment rotateyadj;
00082     Gtk::SpinButton rotateyspin;
00083     
00084     Gtk::Label rotatezlabel;
00085     Gtk::Adjustment rotatezadj;
00086     Gtk::SpinButton rotatezspin;
00087     
00090     bool spin_disregard_on_change;
00092     bool modified;
00093     
00095     FileType filetype;
00098     Glib::ustring filename;
00099 
00100 protected:
00102     type_signal_tab_modified m_signal_tab_modified;
00103     
00105     void on_scale_spin_changed();
00108     void on_rotate_spin_changed();
00109     
00110 public:
00111     NTab();
00112     inline virtual ~NTab() { ; }
00113    
00115     void set_rotation_buttons(const GVectors::Rotation& r);
00117     void set_scale_button(double s);
00118     
00120     void set_modified(bool m);
00122     inline bool ismodified() const { return modified; }
00123        
00125     inline Glib::ustring get_filename() const { return filename; }
00126     
00128     void save(const std::string& fn, FileType t);
00130     void save();
00132     void load(const std::string& fn, FileType t);
00133 
00135     type_signal_tab_modified signal_tab_modified();
00136     
00138     inline void vectortv_on_signal_add_vector() {
00139         tv.on_signal_add_vector();
00140     }
00141 
00143     inline void vectortv_on_signal_add_child_vector() {
00144         tv.on_signal_add_child_vector();
00145     }
00146 
00148     inline void vectortv_on_signal_remove_vector() {
00149         tv.on_signal_remove_vector();
00150     }
00151     
00153     inline void vectortv_on_signal_edit_vector() {
00154         tv.on_signal_edit_vector();
00155     }
00156     
00158     inline void vectortv_on_signal_connecting_vector() {
00159         tv.on_signal_connecting_vector();
00160     }
00161     
00163     inline void vectortv_on_signal_middle_vector() {
00164         tv.on_signal_middle_vector();
00165     }
00166     
00168     inline void vectortv_on_signal_cross_vector() {
00169         tv.on_signal_cross_vector();
00170     }
00171     
00173     inline void vectortv_on_signal_invert_vector() {
00174         tv.on_signal_invert_vector();
00175     }
00176     
00179     inline VectorTV::type_signal_selected vectortv_signal_selected_none() {
00180         return tv.signal_selected_none();
00181     }
00182     
00185     inline VectorTV::type_signal_selected vectortv_signal_selected_one() {
00186         return tv.signal_selected_one();
00187     }
00188     
00191     inline VectorTV::type_signal_selected vectortv_signal_selected_two() {
00192         return tv.signal_selected_two();
00193     }
00194 
00197     inline VectorTV::type_signal_selected vectortv_signal_selected_several() {
00198         return tv.signal_selected_several();
00199     }
00200     
00203     inline VectorTV::type_signal_has_status vectortv_signal_has_status() {
00204         return tv.signal_has_status();
00205     }
00206     
00209     inline VectorTV::type_signal_has_no_status vectortv_signal_has_no_status() {
00210         return tv.signal_has_no_status();
00211     }
00212 };
00213 
00214 #endif  /* _NTAB_H */

Generated on Tue Sep 11 01:14:28 2007 for gvectors by  doxygen 1.4.7