conexus logo

endpointstartstopbutton.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2001 by Rick L. Vinyard, Jr.                            *
00003  *   rvinyard@cs.nmsu.edu                                                  *
00004  *                                                                         *
00005  *   This file is part of the conexus library.                             *
00006  *                                                                         *
00007  *   The conexus library is free software; you can redistribute it and/or  *
00008  *   modify it under the terms of the GNU General Public License           *
00009  *   version 3 as published by the Free Software Foundation.               *
00010  *                                                                         *
00011  *   The conexus library is distributed in the hope that it will be        *
00012  *   useful, but WITHOUT ANY WARRANTY; without even the implied warranty   *
00013  *   of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU   *
00014  *   General Public License for more details.                              *
00015  *                                                                         *
00016  *   You should have received a copy of the GNU General Public License     *
00017  *   along with this software. If not see <http://www.gnu.org/licenses/>.  *
00018  ***************************************************************************/
00019 #ifndef CONEXUSGTKMMENDPOINTSTARTSTOPBUTTON_H
00020 #define CONEXUSGTKMMENDPOINTSTARTSTOPBUTTON_H
00021 
00022 #include <map>
00023 #include <gtkmm.h>
00024 
00025 #include <conexus/endpoint.h>
00026 
00027 namespace Conexus
00028 {
00029   namespace Gtk
00030   {
00031 
00037     class EndpointStartStopButton : public ::Gtk::CheckButton
00038     {
00039       public:
00040 
00046         EndpointStartStopButton ( Conexus::Endpoint::pointer io = Conexus::Endpoint::pointer(),
00047                                   bool show_text = true,
00048                                   bool show_image = true );
00049 
00051         ~EndpointStartStopButton();
00052 
00062         void set_endpoint ( Conexus::Endpoint::pointer io = Conexus::Endpoint::pointer() );
00063 
00067         Conexus::Endpoint::pointer endpoint();
00068         
00070         const Glib::ustring& start_text();
00071 
00073         const Glib::ustring& stop_text();
00074 
00079         void set_start_text ( const Glib::ustring& text );
00080 
00084         void set_start_text_to_default();
00085 
00090         void set_stop_text ( const Glib::ustring& text );
00091 
00095         void set_stop_text_to_default();
00096 
00098         bool is_text_visible();
00099 
00101         void show_text( );
00102 
00104         void hide_text();
00105 
00107         const ::Gtk::Image& start_image();
00108 
00110         const ::Gtk::Image& stop_image();
00111 
00113         void set_start_image ( ::Gtk::Image& image );
00114 
00116         void set_start_image_to_default();
00117 
00119         void set_stop_image ( ::Gtk::Image& image );
00120 
00122         void set_stop_image_to_default();
00123 
00125         bool is_image_visible();
00126 
00128         void show_image( );
00129 
00131         void hide_image( );
00132 
00133       protected:
00135         Conexus::Endpoint::pointer m_endpoint;
00136 
00138         ::Gtk::HBox m_hbox;
00139 
00141         ::Gtk::EventBox m_imagebox;
00142 
00144         ::Gtk::Label m_text;
00145 
00147         Glib::ustring m_start_text;
00148 
00150         Glib::ustring m_stop_text;
00151 
00153         ::Gtk::Image* m_start_image;
00154 
00156         ::Gtk::Image m_default_start_image;
00157 
00159         ::Gtk::Image* m_stop_image;
00160 
00162         ::Gtk::Image m_default_stop_image;
00163 
00168         sigc::connection m_endpoint_start_stop_connection;
00169 
00171         void on_button_toggled();
00172 
00174         void update_display( );
00175 
00179         void on_external_start_stop( StartStop );
00180 
00181     };
00182 
00183   }
00184 
00185 }
00186 
00187 #endif

Generated on Tue Jun 9 10:01:55 2009 for conexus by doxygen 1.5.7.1