diff --git a/livesupport/modules/widgets/include/LiveSupport/Widgets/WidgetFactory.h b/livesupport/modules/widgets/include/LiveSupport/Widgets/WidgetFactory.h index 0732973f8..6a8529432 100644 --- a/livesupport/modules/widgets/include/LiveSupport/Widgets/WidgetFactory.h +++ b/livesupport/modules/widgets/include/LiveSupport/Widgets/WidgetFactory.h @@ -21,8 +21,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Author : $Author: maroy $ - Version : $Revision: 1.12 $ + Author : $Author: fgerlits $ + Version : $Revision: 1.13 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/widgets/include/LiveSupport/Widgets/WidgetFactory.h,v $ ------------------------------------------------------------------------------*/ @@ -86,8 +86,8 @@ using namespace LiveSupport::Core; * * * - * @author $Author: maroy $ - * @version $Revision: 1.12 $ + * @author $Author: fgerlits $ + * @version $Revision: 1.13 $ */ class WidgetFactory : virtual public Configurable @@ -103,7 +103,8 @@ class WidgetFactory : */ typedef enum { deleteButton, smallPlayButton, smallPauseButton, smallStopButton, - hugePlayButton } + hugePlayButton, + cuePlayButton, cueStopButton } ImageButtonType; /** diff --git a/livesupport/modules/widgets/src/TestWindow.cxx b/livesupport/modules/widgets/src/TestWindow.cxx index a4856af40..96aa2eed0 100644 --- a/livesupport/modules/widgets/src/TestWindow.cxx +++ b/livesupport/modules/widgets/src/TestWindow.cxx @@ -21,8 +21,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Author : $Author: maroy $ - Version : $Revision: 1.14 $ + Author : $Author: fgerlits $ + Version : $Revision: 1.15 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/widgets/src/TestWindow.cxx,v $ ------------------------------------------------------------------------------*/ @@ -57,16 +57,24 @@ using namespace LiveSupport::Widgets; * Constructor. *----------------------------------------------------------------------------*/ TestWindow :: TestWindow (void) - throw () + throw () : WhiteWindow("test window", Colors::White, WidgetFactory::getInstance()->getWhiteWindowCorners()) { Ptr::Ref widgetFactory = WidgetFactory::getInstance(); - // init the imageButton - imageButton = Gtk::manage( + // init the imageButtons + hugeImageButton = Gtk::manage( widgetFactory->createButton(WidgetFactory::hugePlayButton)); + cuePlayImageButton = Gtk::manage( + widgetFactory->createButton(WidgetFactory::cuePlayButton)); + cuePlayImageButton->signal_clicked().connect(sigc::mem_fun(*this, + &TestWindow::onPlayButtonPressed)); + cueStopImageButton = Gtk::manage( + widgetFactory->createButton(WidgetFactory::cueStopButton)); + cueStopImageButton->signal_clicked().connect(sigc::mem_fun(*this, + &TestWindow::onStopButtonPressed)); // create a button button = Gtk::manage(widgetFactory->createButton("Hello, World!")); @@ -93,19 +101,42 @@ TestWindow :: TestWindow (void) // create and set up the layout layout = Gtk::manage(new Gtk::Table()); - layout->attach(*imageButton, 0, 1, 0, 1); - layout->attach(*notebook, 0, 1, 1, 2); + layout->attach(*hugeImageButton, 0, 1, 0, 1); + layout->attach(*cuePlayImageButton, 1, 2, 0, 1); + layout->attach(*notebook, 0, 2, 1, 2); blueBin->add(*layout); add(*blueBin); show_all(); + layout->attach(*cueStopImageButton, 1, 2, 0, 1); } /*------------------------------------------------------------------------------ * Destructor. *----------------------------------------------------------------------------*/ -TestWindow :: ~TestWindow (void) throw () +TestWindow :: ~TestWindow (void) throw () { } +/*------------------------------------------------------------------------------ + * Change the image from "play" to "stop" on the button when pressed. + *----------------------------------------------------------------------------*/ +void +TestWindow :: onPlayButtonPressed(void) throw () +{ + cuePlayImageButton->hide(); + cueStopImageButton->show(); +} + + +/*------------------------------------------------------------------------------ + * Change the image from "stop" to "play" on the button when pressed. + *----------------------------------------------------------------------------*/ +void +TestWindow :: onStopButtonPressed(void) throw () +{ + cueStopImageButton->hide(); + cuePlayImageButton->show(); +} + diff --git a/livesupport/modules/widgets/src/TestWindow.h b/livesupport/modules/widgets/src/TestWindow.h index 874931d1d..f7c34356b 100644 --- a/livesupport/modules/widgets/src/TestWindow.h +++ b/livesupport/modules/widgets/src/TestWindow.h @@ -21,8 +21,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Author : $Author: maroy $ - Version : $Revision: 1.8 $ + Author : $Author: fgerlits $ + Version : $Revision: 1.9 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/widgets/src/TestWindow.h,v $ ------------------------------------------------------------------------------*/ @@ -71,11 +71,24 @@ using namespace LiveSupport::Core; /** * A window, enabling interactive testing of UI components. * - * @author $Author: maroy $ - * @version $Revision: 1.8 $ + * @author $Author: fgerlits $ + * @version $Revision: 1.9 $ */ class TestWindow : public WhiteWindow { + private: + /** + * Change the image from "play" to "stop" on the button when pressed. + */ + void + onPlayButtonPressed(void) throw (); + + /** + * Change the image from "stop" to "play" on the button when pressed. + */ + void + onStopButtonPressed(void) throw (); + protected: /** * The layout used in the window. @@ -88,9 +101,19 @@ class TestWindow : public WhiteWindow Notebook * notebook; /** - * An image button. + * An image button with transparent background. */ - ImageButton * imageButton; + ImageButton * hugeImageButton; + + /** + * A clickable image button showing a "play" icon. + */ + ImageButton * cuePlayImageButton; + + /** + * A clickable image button showing a "stop" icon. + */ + ImageButton * cueStopImageButton; /** * A button. diff --git a/livesupport/modules/widgets/src/WidgetFactory.cxx b/livesupport/modules/widgets/src/WidgetFactory.cxx index 7c6824a8c..b29a2f80b 100644 --- a/livesupport/modules/widgets/src/WidgetFactory.cxx +++ b/livesupport/modules/widgets/src/WidgetFactory.cxx @@ -21,8 +21,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Author : $Author: maroy $ - Version : $Revision: 1.14 $ + Author : $Author: fgerlits $ + Version : $Revision: 1.15 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/widgets/src/WidgetFactory.cxx,v $ ------------------------------------------------------------------------------*/ @@ -150,6 +150,30 @@ static const std::string hugePlayButtonPassiveName static const std::string hugePlayButtonRollName = "imageButton/hugePlayRoll.png"; +/** + * The name of the passive image for the cue play button. + */ +static const std::string cuePlayButtonPassiveName + = "imageButton/cuePlay.png"; + +/** + * The name of the rollover image for the cue play button. + */ +static const std::string cuePlayButtonRollName + = "imageButton/cuePlayRoll.png"; + +/** + * The name of the passive image for the cue stop button. + */ +static const std::string cueStopButtonPassiveName + = "imageButton/cueStop.png"; + +/** + * The name of the rollover image for the cue stop button. + */ +static const std::string cueStopButtonRollName + = "imageButton/cueStopRoll.png"; + /** * The name of the combo box left image. */ @@ -350,6 +374,16 @@ WidgetFactory :: createButton(ImageButtonType type) throw () rollImage = loadImage(hugePlayButtonRollName); break; + case cuePlayButton: + passiveImage = loadImage(cuePlayButtonPassiveName); + rollImage = loadImage(cuePlayButtonRollName); + break; + + case cueStopButton: + passiveImage = loadImage(cueStopButtonPassiveName); + rollImage = loadImage(cueStopButtonRollName); + break; + default: return 0; } diff --git a/livesupport/modules/widgets/var/imageButton/cuePlay.png b/livesupport/modules/widgets/var/imageButton/cuePlay.png new file mode 100644 index 000000000..c79b1aa92 Binary files /dev/null and b/livesupport/modules/widgets/var/imageButton/cuePlay.png differ diff --git a/livesupport/modules/widgets/var/imageButton/cuePlayRoll.png b/livesupport/modules/widgets/var/imageButton/cuePlayRoll.png new file mode 100644 index 000000000..3e7f5570e Binary files /dev/null and b/livesupport/modules/widgets/var/imageButton/cuePlayRoll.png differ diff --git a/livesupport/modules/widgets/var/imageButton/cueStop.png b/livesupport/modules/widgets/var/imageButton/cueStop.png new file mode 100644 index 000000000..5a3f958b1 Binary files /dev/null and b/livesupport/modules/widgets/var/imageButton/cueStop.png differ diff --git a/livesupport/modules/widgets/var/imageButton/cueStopRoll.png b/livesupport/modules/widgets/var/imageButton/cueStopRoll.png new file mode 100644 index 000000000..1ec2055a6 Binary files /dev/null and b/livesupport/modules/widgets/var/imageButton/cueStopRoll.png differ