conexus logo

Conexus::Gtk::EndpointStartStopButton Class Reference

This widget can control the stop/start state of a single Conexus endpoint. More...

#include <endpointstartstopbutton.h>

List of all members.

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.


Detailed Description

This widget can control the stop/start state of a single Conexus endpoint.

Author:
Rick L Vinyard Jr

Constructor & Destructor Documentation

Conexus::Gtk::EndpointStartStopButton::EndpointStartStopButton ( Conexus::Endpoint::pointer  endpoint = Conexus::Endpoint::pointer(),
bool  show_text = true,
bool  show_image = true 
)

Basic constructor.

Parameters:
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.


Member Function Documentation

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 (  ) 

Hides the start/stop image.

References m_imagebox.

Referenced by initialize().

void Conexus::Gtk::EndpointStartStopButton::hide_text (  ) 

Hides the text label.

References m_text.

Referenced by initialize().

void Conexus::Gtk::EndpointStartStopButton::initialize ( bool  show_text,
bool  show_image 
) [protected]

bool Conexus::Gtk::EndpointStartStopButton::is_image_visible (  ) 

True if the start/stop image is shown; false if hidden.

References m_imagebox.

bool Conexus::Gtk::EndpointStartStopButton::is_text_visible (  ) 

True if the text label will be shown, false if it will be hidden.

References m_text.

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]

Connected to the controlled endpoint's start/stop signal.

Referenced by set_endpoint().

void Conexus::Gtk::EndpointStartStopButton::set_endpoint ( Conexus::Endpoint::pointer  endpoint  ) 

Place a Conexus Endpoint under the control of this widget.

Parameters:
io The Conexus endpoint to control
Removes the previously set endpoint and sets the current endpoint under the control of the widget.

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  ) 

Set the start state image.

References m_start_image, and update_display().

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 (  ) 

Shows the start/stop image.

References m_imagebox.

Referenced by initialize().

void Conexus::Gtk::EndpointStartStopButton::show_text (  ) 

Shows the text label.

References m_text.

Referenced by initialize().

const ::Gtk::Image & Conexus::Gtk::EndpointStartStopButton::start_image (  ) 

The image to display when the widget is in a started state.

References m_start_image.

const Glib::ustring & Conexus::Gtk::EndpointStartStopButton::start_text (  ) 

The text to be displayed when the widget is in a started state.

References m_start_text.

const ::Gtk::Image & Conexus::Gtk::EndpointStartStopButton::stop_image (  ) 

The image to display when the widget is in a stopped state.

References m_stop_image.

const Glib::ustring & Conexus::Gtk::EndpointStartStopButton::stop_text (  ) 

The text to be displayed when the widget is in a stopped state.

References m_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]


Member Data Documentation

Default start image.

Referenced by initialize(), and set_start_image_to_default().

Default stop image.

Referenced by initialize(), and set_stop_image_to_default().

The endpoint under control.

Referenced by endpoint(), on_button_toggled(), set_endpoint(), and unset_endpoint().

Used to disconnect on_external_start_stop() when the endpoint is removed or changed.

Referenced by set_endpoint(), and unset_endpoint().

Holds the text and image widgets.

Referenced by initialize().

Container for image.

Referenced by hide_image(), initialize(), is_image_visible(), show_image(), and update_display().

The image displayed when in a started state.

Referenced by set_start_image(), set_start_image_to_default(), start_image(), and update_display().

The text displayed when in a started state.

Referenced by set_start_text(), start_text(), and update_display().

The image displayed when in a stopped state.

Referenced by set_stop_image(), set_stop_image_to_default(), stop_image(), and update_display().

The text displayed when in a stopped state.

Referenced by set_stop_text(), stop_text(), and update_display().

Widget displays the current stop/start text.

Referenced by hide_text(), initialize(), is_text_visible(), show_text(), and update_display().


The documentation for this class was generated from the following files:

Generated on Wed Jul 8 15:51:27 2009 for conexus by doxygen 1.5.8