vectortv.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: vectortv_8h-source.html,v 1.1 2007-09-10 23:31:15 rafi Exp $
00022 //
00023 // File:   vectortv.h
00024 // Author: Rafael Ostertag
00025 //
00026 // Created on July 20, 2007, 8:31 PM
00027 //
00028 
00031 
00032 #ifndef _VECTORTV_H
00033 #define _VECTORTV_H
00034 
00035 #include <gtkmm.h>
00036 #include "vectorlist.h"
00037 #include "vectorwindow.h"
00038 #include "da.h"
00039 #include "funcobjs.h"
00040 
00041 // Forward declaration
00042 class NTab;
00043 
00044 
00056 class VectorTV : public Gtk::TreeView {
00057 public:
00059     typedef sigc::signal0<void> type_signal_selected;
00061     typedef sigc::signal1<void, Glib::ustring> type_signal_has_status;
00063     typedef sigc::signal0<void> type_signal_has_no_status;
00064         
00065 private:
00070     Glib::RefPtr<Gtk::TreeStore> liststore;
00071     VectorList vectorlist;
00072         
00074     Glib::RefPtr<Gtk::UIManager> ui_manager;
00076     Glib::RefPtr<Gtk::ActionGroup> action_group;
00078     Gtk::Menu* popup_menu;
00079     
00083     long vectors_added;
00084     
00086     GVectors::VectorStore &vstore;
00088     DA& drawing_area;
00090     NTab& ntab;
00091 
00093     type_signal_selected m_signal_selected_none;
00095     type_signal_selected m_signal_selected_one;
00097     type_signal_selected m_signal_selected_two;
00100     type_signal_selected m_signal_selected_several;
00103     type_signal_has_status m_signal_has_status;
00106     type_signal_has_no_status m_signal_has_no_status;
00107     
00112     TreeLastTwoSelected last_two_selected;
00113 
00114 protected:
00116     void setup_popup_icons();
00118     void create_popup_menu();
00120     bool on_button_press_event(GdkEventButton* event);
00121     
00124     void set_sensitive_popup_none_selected();
00127     void set_sensitive_popup_one_selected();
00130     void set_sensitive_popup_two_selected();
00133     void set_sensitive_popup_several_selected();
00134     
00138     void on_cursor_changed();
00141     bool on_expose_event(GdkEventExpose* evt);
00142 
00144     void delete_selected_vectors(const Gtk::TreeModel::iterator& iter);
00145     
00148     void status_one_selected();
00151     void status_two_selected();
00154     void status_several_selected();
00155 
00156 public:
00157     VectorTV(GVectors::VectorStore& v, DA& da, NTab& n);
00158     ~VectorTV();
00159 
00160     void load(const std::string& fn, FileType t);
00161     
00162     /*
00163      * Used by MainWindow
00164      */
00166     void on_signal_add_vector();
00168     void on_signal_add_child_vector();
00170     void on_signal_remove_vector();
00172     void on_signal_edit_vector();
00174     void on_signal_connecting_vector();
00176     void on_signal_middle_vector();
00178     void on_signal_cross_vector();
00180     void on_signal_invert_vector();
00181     
00183     type_signal_selected signal_selected_none();
00185     type_signal_selected signal_selected_one();
00187     type_signal_selected signal_selected_two();
00189     type_signal_selected signal_selected_several();
00191     type_signal_has_status signal_has_status();
00193     type_signal_has_no_status signal_has_no_status();
00194 };
00195 
00196 #endif  /* _VECTORTV_H */
00197 

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