#include <conexusmm/endpointstopbutton.h>
To control a Conexus endpoint, just connect it and optionally set whether the widget will control read stop/start, write stop/start or both.
Public Member Functions | ||||
EndpointStopButton (bool show_text=true, bool show_image=true) | ||||
| ||||
~EndpointStopButton () | ||||
Destructor. | ||||
void | connect (Conexus::Endpoint &io) | |||
Place a Conexus Endpoint under the control of this widget. | ||||
void | disconnect (Conexus::Endpoint &io) | |||
Remove a Conexus endpoint from this widget's control. | ||||
const Glib::ustring & | start_text () | |||
The text to be displayed when the widget is in a started state. | ||||
const Glib::ustring & | stop_text () | |||
The text to be displayed when the widget is in a stopped state. | ||||
void | set_start_text (const Glib::ustring &text) | |||
Set the start state text. | ||||
void | set_start_text_to_default () | |||
Reset the start text to the default value of "Connected \<i\>\<small\>( Click to Disconnect )\</small\>\</i\>". | ||||
void | set_stop_text (const Glib::ustring &text) | |||
Set the stop state text. | ||||
void | set_stop_text_to_default () | |||
Reset the stop text to the default value of "Disconnected \<i\>\<small\>( Click to Connect )\</small\>\</i\>". | ||||
bool | is_text_visible () | |||
True if the text label will be shown, false if it will be hidden. | ||||
void | show_text () | |||
Shows the text label. | ||||
void | hide_text () | |||
Hides the text label. | ||||
const Gtk::Image & | start_image () | |||
The image to display when the widget is in a started state. | ||||
const Gtk::Image & | stop_image () | |||
The image to display when the widget is in a stopped state. | ||||
void | set_start_image (Gtk::Image &image) | |||
Set the start state image. | ||||
void | set_start_image_to_default () | |||
Reset the start state image to the default stock connect icon. | ||||
void | set_stop_image (Gtk::Image &image) | |||
The image to display when the widge tis in a stopped state. | ||||
void | set_stop_image_to_default () | |||
Reset the stopped state image to the default stock disconnect icon. | ||||
bool | is_image_visible () | |||
True if the start/stop image is shown; false if hidden. | ||||
void | show_image () | |||
Shows the start/stop image. | ||||
void | hide_image () | |||
Hides the start/stop image. | ||||
Protected Types | ||||
typedef std::set< Conexus::Endpoint * > | Controlled | |||
The type used for the set of endpoints this widget controls. | ||||
Protected Member Functions | ||||
void | on_button_toggled () | |||
Callback to handle start/stop clicks. | ||||
void | update_display () | |||
Updates the display. | ||||
Protected Attributes | ||||
Gtk::HBox | m_hbox | |||
Holds the text and image widgets. | ||||
Gtk::EventBox | m_imagebox | |||
Container for image. | ||||
Gtk::Label | m_text | |||
Widget displays the current stop/start text. | ||||
Glib::ustring | m_start_text | |||
The text displayed when in a started state. | ||||
Glib::ustring | m_stop_text | |||
The text displayed when in a stopped state. | ||||
Gtk::Image * | m_start_image | |||
The image displayed when in a started state. | ||||
Gtk::Image | m_default_start_image | |||
Default start image. | ||||
Gtk::Image * | m_stop_image | |||
The image displayed when in a stopped state. | ||||
Gtk::Image | m_default_stop_image | |||
Default stop image. | ||||
Controlled | m_controlled | |||
The widget controls these endpoints. |
ConexusGtk::EndpointStopButton::EndpointStopButton | ( | bool | show_text = true , |
|
bool | show_image = true | |||
) |
use_text | If true, the start/stop text label will be shown |
use_image | If true, the start/stop image will be shown |
void ConexusGtk::EndpointStopButton::connect | ( | Conexus::Endpoint & | io | ) |
Place a Conexus Endpoint under the control of this widget.
io | The Conexus endpoint to control |
void ConexusGtk::EndpointStopButton::set_start_text | ( | const Glib::ustring & | text | ) |
Set the start state text.
Pango markup is used for display, so if desired the text may also contain pango markup.
void ConexusGtk::EndpointStopButton::set_stop_text | ( | const Glib::ustring & | text | ) |
Set the stop state text.
Pango markup is used for display, so if desired the text may also contain pango markup.