#include <endpointstartstopbutton.h>
Public Member Functions | |
EndpointStartStopButton (Conexus::Endpoint::pointer endpoint=Conexus::Endpoint::pointer(), bool show_text=true, bool show_image=true) | |
Basic constructor. | |
~EndpointStartStopButton () | |
Destructor. | |
void | set_endpoint (Conexus::Endpoint::pointer endpoint) |
Place a Conexus Endpoint under the control of this widget. | |
void | unset_endpoint () |
Unsets the controlled endpoint and leaves the widget controlling nothing. | |
Conexus::Endpoint::pointer | endpoint () |
Returns the Conexus Endpoint under control or an empty pointer if no endpoint is controlled. | |
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 Member Functions | |
void | on_button_toggled () |
Callback to handle start/stop clicks. | |
void | update_display () |
Updates the display. | |
void | on_external_start_stop (StartStop) |
Connected to the controlled endpoint's start/stop signal. | |
void | initialize (bool show_text, bool show_image) |
Common initializer for constructors. | |
Protected Attributes | |
Conexus::Endpoint::pointer | m_endpoint |
The endpoint under control. | |
::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. | |
sigc::connection | m_endpoint_start_stop_connection |
Used to disconnect on_external_start_stop() when the endpoint is removed or changed. |
Conexus::Gtk::EndpointStartStopButton::EndpointStartStopButton | ( | Conexus::Endpoint::pointer | endpoint = Conexus::Endpoint::pointer() , |
|
bool | show_text = true , |
|||
bool | show_image = true | |||
) |
Basic constructor.
show_text | If true, the start/stop text label will be shown | |
show_image | If true, the start/stop image will be shown |
References initialize().
Conexus::Gtk::EndpointStartStopButton::~EndpointStartStopButton | ( | ) |
Destructor.
Conexus::Endpoint::pointer Conexus::Gtk::EndpointStartStopButton::endpoint | ( | ) |
Returns the Conexus Endpoint under control or an empty pointer if no endpoint is controlled.
References m_endpoint.
void Conexus::Gtk::EndpointStartStopButton::hide_image | ( | ) |
void Conexus::Gtk::EndpointStartStopButton::hide_text | ( | ) |
void Conexus::Gtk::EndpointStartStopButton::initialize | ( | bool | show_text, | |
bool | show_image | |||
) | [protected] |
Common initializer for constructors.
References hide_image(), hide_text(), m_default_start_image, m_default_stop_image, m_hbox, m_imagebox, m_text, on_button_toggled(), set_start_text_to_default(), set_stop_text_to_default(), show_image(), show_text(), and update_display().
Referenced by EndpointStartStopButton().
bool Conexus::Gtk::EndpointStartStopButton::is_image_visible | ( | ) |
bool Conexus::Gtk::EndpointStartStopButton::is_text_visible | ( | ) |
void Conexus::Gtk::EndpointStartStopButton::on_button_toggled | ( | ) | [protected] |
Callback to handle start/stop clicks.
References m_endpoint, and update_display().
Referenced by initialize().
void Conexus::Gtk::EndpointStartStopButton::on_external_start_stop | ( | StartStop | ss | ) | [protected] |
void Conexus::Gtk::EndpointStartStopButton::set_endpoint | ( | Conexus::Endpoint::pointer | endpoint | ) |
Place a Conexus Endpoint under the control of this widget.
io | The Conexus endpoint to control |
If endpoint is a NULL pointer or equal to the currently set endpoint this method will return without doing anything
References m_endpoint, m_endpoint_start_stop_connection, and on_external_start_stop().
void Conexus::Gtk::EndpointStartStopButton::set_start_image | ( | ::Gtk::Image & | image | ) |
void Conexus::Gtk::EndpointStartStopButton::set_start_image_to_default | ( | ) |
Reset the start state image to the default stock connect icon.
References m_default_start_image, m_start_image, and update_display().
void Conexus::Gtk::EndpointStartStopButton::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.
References m_start_text, and update_display().
Referenced by set_start_text_to_default().
void Conexus::Gtk::EndpointStartStopButton::set_start_text_to_default | ( | ) |
Reset the start text to the default value of "Connected \<i\>\<small\>( Click to Disconnect )\</small\>\</i\>".
References set_start_text().
Referenced by initialize().
void Conexus::Gtk::EndpointStartStopButton::set_stop_image | ( | ::Gtk::Image & | image | ) |
The image to display when the widge tis in a stopped state.
References m_stop_image, and update_display().
void Conexus::Gtk::EndpointStartStopButton::set_stop_image_to_default | ( | ) |
Reset the stopped state image to the default stock disconnect icon.
References m_default_stop_image, m_stop_image, and update_display().
void Conexus::Gtk::EndpointStartStopButton::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.
References m_stop_text, and update_display().
Referenced by set_stop_text_to_default().
void Conexus::Gtk::EndpointStartStopButton::set_stop_text_to_default | ( | ) |
Reset the stop text to the default value of "Disconnected \<i\>\<small\>( Click to Connect )\</small\>\</i\>".
References set_stop_text().
Referenced by initialize().
void Conexus::Gtk::EndpointStartStopButton::show_image | ( | ) |
void Conexus::Gtk::EndpointStartStopButton::show_text | ( | ) |
const ::Gtk::Image & Conexus::Gtk::EndpointStartStopButton::start_image | ( | ) |
const Glib::ustring & Conexus::Gtk::EndpointStartStopButton::start_text | ( | ) |
const ::Gtk::Image & Conexus::Gtk::EndpointStartStopButton::stop_image | ( | ) |
const Glib::ustring & Conexus::Gtk::EndpointStartStopButton::stop_text | ( | ) |
void Conexus::Gtk::EndpointStartStopButton::unset_endpoint | ( | ) |
Unsets the controlled endpoint and leaves the widget controlling nothing.
References m_endpoint, and m_endpoint_start_stop_connection.
void Conexus::Gtk::EndpointStartStopButton::update_display | ( | ) | [protected] |
Updates the display.
References m_imagebox, m_start_image, m_start_text, m_stop_image, m_stop_text, and m_text.
Referenced by initialize(), on_button_toggled(), set_start_image(), set_start_image_to_default(), set_start_text(), set_stop_image(), set_stop_image_to_default(), and set_stop_text().
::Gtk::Image Conexus::Gtk::EndpointStartStopButton::m_default_start_image [protected] |
::Gtk::Image Conexus::Gtk::EndpointStartStopButton::m_default_stop_image [protected] |
The endpoint under control.
Referenced by endpoint(), on_button_toggled(), set_endpoint(), and unset_endpoint().
sigc::connection Conexus::Gtk::EndpointStartStopButton::m_endpoint_start_stop_connection [protected] |
Used to disconnect on_external_start_stop() when the endpoint is removed or changed.
Referenced by set_endpoint(), and unset_endpoint().
::Gtk::HBox Conexus::Gtk::EndpointStartStopButton::m_hbox [protected] |
::Gtk::EventBox Conexus::Gtk::EndpointStartStopButton::m_imagebox [protected] |
Container for image.
Referenced by hide_image(), initialize(), is_image_visible(), show_image(), and update_display().
::Gtk::Image* Conexus::Gtk::EndpointStartStopButton::m_start_image [protected] |
The image displayed when in a started state.
Referenced by set_start_image(), set_start_image_to_default(), start_image(), and update_display().
Glib::ustring Conexus::Gtk::EndpointStartStopButton::m_start_text [protected] |
The text displayed when in a started state.
Referenced by set_start_text(), start_text(), and update_display().
::Gtk::Image* Conexus::Gtk::EndpointStartStopButton::m_stop_image [protected] |
The image displayed when in a stopped state.
Referenced by set_stop_image(), set_stop_image_to_default(), stop_image(), and update_display().
Glib::ustring Conexus::Gtk::EndpointStartStopButton::m_stop_text [protected] |
The text displayed when in a stopped state.
Referenced by set_stop_text(), stop_text(), and update_display().
::Gtk::Label Conexus::Gtk::EndpointStartStopButton::m_text [protected] |
Widget displays the current stop/start text.
Referenced by hide_text(), initialize(), is_text_visible(), show_text(), and update_display().