diff --git a/livesupport/modules/widgets/include/LiveSupport/Widgets/BlueBin.h b/livesupport/modules/widgets/include/LiveSupport/Widgets/BlueBin.h index fec8cf996..0a68b8e10 100644 --- a/livesupport/modules/widgets/include/LiveSupport/Widgets/BlueBin.h +++ b/livesupport/modules/widgets/include/LiveSupport/Widgets/BlueBin.h @@ -22,7 +22,7 @@ Author : $Author: maroy $ - Version : $Revision: 1.1 $ + Version : $Revision: 1.2 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/widgets/include/LiveSupport/Widgets/BlueBin.h,v $ ------------------------------------------------------------------------------*/ @@ -62,7 +62,7 @@ using namespace LiveSupport::Core; * A container holding exactly one child, habing a light blue border to it. * * @author $Author: maroy $ - * @version $Revision: 1.1 $ + * @version $Revision: 1.2 $ */ class BlueBin : public Gtk::Bin { @@ -231,6 +231,7 @@ class BlueBin : public Gtk::Bin /** * Constructor, with only one state. * + * @param backgroundColor the RGB value for the background color. * @param topLeftImage the top left image of the border * @param leftImage the left image of the border * @param topImage the top image of the border @@ -240,7 +241,8 @@ class BlueBin : public Gtk::Bin * @param bottomImage the bottom image of the border * @param bottomRightImage the bottom right image of the border */ - BlueBin(Glib::RefPtr topLeftImage, + BlueBin(unsigned int backgroundColor, + Glib::RefPtr topLeftImage, Glib::RefPtr leftImage, Glib::RefPtr topImage, Glib::RefPtr topRightImage, diff --git a/livesupport/modules/widgets/include/LiveSupport/Widgets/Button.h b/livesupport/modules/widgets/include/LiveSupport/Widgets/Button.h index 6e810377d..cc351fc26 100644 --- a/livesupport/modules/widgets/include/LiveSupport/Widgets/Button.h +++ b/livesupport/modules/widgets/include/LiveSupport/Widgets/Button.h @@ -22,7 +22,7 @@ Author : $Author: maroy $ - Version : $Revision: 1.1 $ + Version : $Revision: 1.2 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/widgets/include/LiveSupport/Widgets/Button.h,v $ ------------------------------------------------------------------------------*/ @@ -63,7 +63,7 @@ using namespace LiveSupport::Core; * A button holding a text. * * @author $Author: maroy $ - * @version $Revision: 1.1 $ + * @version $Revision: 1.2 $ */ class Button : public Gtk::Button { @@ -274,6 +274,28 @@ class Button : public Gtk::Button */ virtual ~Button(void) throw (); + + /** + * Set the label of the button. + * + * @param label the text the button should display. + */ + virtual void + set_label(const Glib::ustring & label) throw () + { + this->label->set_label(label); + } + + /** + * Get the label of the button. + * + * @return the current label of the button. + */ + Glib::ustring + get_label(void) const throw () + { + return this->label->get_label(); + } }; diff --git a/livesupport/modules/widgets/include/LiveSupport/Widgets/WidgetFactory.h b/livesupport/modules/widgets/include/LiveSupport/Widgets/WidgetFactory.h index 250dc0d1f..963762028 100644 --- a/livesupport/modules/widgets/include/LiveSupport/Widgets/WidgetFactory.h +++ b/livesupport/modules/widgets/include/LiveSupport/Widgets/WidgetFactory.h @@ -22,7 +22,7 @@ Author : $Author: maroy $ - Version : $Revision: 1.1 $ + Version : $Revision: 1.2 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/widgets/include/LiveSupport/Widgets/WidgetFactory.h,v $ ------------------------------------------------------------------------------*/ @@ -80,7 +80,7 @@ using namespace LiveSupport::Core; * * * @author $Author: maroy $ - * @version $Revision: 1.1 $ + * @version $Revision: 1.2 $ */ class WidgetFactory : virtual public Configurable @@ -171,6 +171,46 @@ class WidgetFactory : */ Glib::RefPtr blueBinBottomRightImage; + /** + * The top left image of the border for dark BlueBin. + */ + Glib::RefPtr darkBlueBinTopLeftImage; + + /** + * The left image of the border for dark BlueBin. + */ + Glib::RefPtr darkBlueBinLeftImage; + + /** + * The top image of the border for dark BlueBin. + */ + Glib::RefPtr darkBlueBinTopImage; + + /** + * The top right image of the border for dark BlueBin. + */ + Glib::RefPtr darkBlueBinTopRightImage; + + /** + * The right image of the border for dark BlueBin. + */ + Glib::RefPtr darkBlueBinRightImage; + + /** + * The bottom left image of the border for dark BlueBin. + */ + Glib::RefPtr darkBlueBinBottomLeftImage; + + /** + * The bottom image of the border for dark BlueBin. + */ + Glib::RefPtr darkBlueBinBottomImage; + + /** + * The bottom right image of the border for dark BlueBin. + */ + Glib::RefPtr darkBlueBinBottomRightImage; + /** * The default constructor. */ @@ -246,6 +286,12 @@ class WidgetFactory : */ Ptr::Ref createBlueBin(void) throw (); + + /** + * Create and return a dark blue singular container. + */ + Ptr::Ref + createDarkBlueBin(void) throw (); }; diff --git a/livesupport/modules/widgets/src/BlueBin.cxx b/livesupport/modules/widgets/src/BlueBin.cxx index 40149abb9..0a610072b 100644 --- a/livesupport/modules/widgets/src/BlueBin.cxx +++ b/livesupport/modules/widgets/src/BlueBin.cxx @@ -22,7 +22,7 @@ Author : $Author: maroy $ - Version : $Revision: 1.1 $ + Version : $Revision: 1.2 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/widgets/src/BlueBin.cxx,v $ ------------------------------------------------------------------------------*/ @@ -49,11 +49,13 @@ using namespace LiveSupport::Widgets; /* ============================================================= module code */ +#include /*------------------------------------------------------------------------------ * Constructor. *----------------------------------------------------------------------------*/ -BlueBin :: BlueBin(Glib::RefPtr topLeftImage, +BlueBin :: BlueBin(unsigned int backgroundColor, + Glib::RefPtr topLeftImage, Glib::RefPtr leftImage, Glib::RefPtr topImage, Glib::RefPtr topRightImage, @@ -77,7 +79,10 @@ BlueBin :: BlueBin(Glib::RefPtr topLeftImage, child = 0; bgColor = Gdk::Color(); - bgColor.set_rgb(0xcf00, 0xde00, 0xe700); + unsigned int red = (backgroundColor & 0xff0000) >> 8; + unsigned int green = (backgroundColor & 0x00ff00); + unsigned int blue = (backgroundColor & 0x0000ff) << 8; + bgColor.set_rgb(red, green, blue); Glib::RefPtr colormap = get_default_colormap(); colormap->alloc_color(bgColor); } diff --git a/livesupport/modules/widgets/src/TestWindow.cxx b/livesupport/modules/widgets/src/TestWindow.cxx index 2be89ce23..bcaf32481 100644 --- a/livesupport/modules/widgets/src/TestWindow.cxx +++ b/livesupport/modules/widgets/src/TestWindow.cxx @@ -22,7 +22,7 @@ Author : $Author: maroy $ - Version : $Revision: 1.4 $ + Version : $Revision: 1.5 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/widgets/src/TestWindow.cxx,v $ ------------------------------------------------------------------------------*/ @@ -73,7 +73,7 @@ TestWindow :: TestWindow (void) button = widgetFactory->createButton("Hello, World!"); // create a blue container - blueBin = widgetFactory->createBlueBin(); + blueBin = widgetFactory->createDarkBlueBin(); // create and set up the layout layout.reset(new Gtk::Table()); diff --git a/livesupport/modules/widgets/src/WidgetFactory.cxx b/livesupport/modules/widgets/src/WidgetFactory.cxx index b95001867..44bf329c7 100644 --- a/livesupport/modules/widgets/src/WidgetFactory.cxx +++ b/livesupport/modules/widgets/src/WidgetFactory.cxx @@ -22,7 +22,7 @@ Author : $Author: maroy $ - Version : $Revision: 1.2 $ + Version : $Revision: 1.3 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/widgets/src/WidgetFactory.cxx,v $ ------------------------------------------------------------------------------*/ @@ -130,6 +130,50 @@ static const std::string blueBinBottomName = "blueBin/bottom.png"; static const std::string blueBinBottomRightName = "blueBin/bottomRight.png"; +/** + * The name of the top left image for dark BlueBin. + */ +static const std::string darkBlueBinTopLeftName = "darkBlueBin/topLeft.png"; + +/** + * The name of the left image for dark BlueBin. + */ +static const std::string darkBlueBinLeftName = "darkBlueBin/left.png"; + +/** + * The name of the top image for dark BlueBin. + */ +static const std::string darkBlueBinTopName = "darkBlueBin/top.png"; + +/** + * The name of the top right image for dark BlueBin. + */ +static const std::string darkBlueBinTopRightName + = "darkBlueBin/topRight.png"; + +/** + * The name of the right image for dark BlueBin. + */ +static const std::string darkBlueBinRightName = "darkBlueBin/right.png"; + +/** + * The name of the bottom left image for dark BlueBin. + */ +static const std::string darkBlueBinBottomLeftName = + "darkBlueBin/bottomLeft.png"; + +/** + * The name of the bottom image for dark BlueBin. + */ +static const std::string darkBlueBinBottomName = "darkBlueBin/bottom.png"; + +/** + * The name of the bottom right image for dark BlueBin. + */ +static const std::string darkBlueBinBottomRightName + = "darkBlueBin/bottomRight.png"; + + /* =============================================== local function prototypes */ @@ -188,6 +232,16 @@ WidgetFactory :: configure(const xmlpp::Element & element) blueBinBottomImage = loadImage(blueBinBottomName); blueBinBottomRightImage = loadImage(blueBinBottomRightName); + // load the dark blue bin images. + darkBlueBinTopLeftImage = loadImage(darkBlueBinTopLeftName); + darkBlueBinLeftImage = loadImage(darkBlueBinLeftName); + darkBlueBinTopImage = loadImage(darkBlueBinTopName); + darkBlueBinTopRightImage = loadImage(darkBlueBinTopRightName); + darkBlueBinRightImage = loadImage(darkBlueBinRightName); + darkBlueBinBottomLeftImage = loadImage(darkBlueBinBottomLeftName); + darkBlueBinBottomImage = loadImage(darkBlueBinBottomName); + darkBlueBinBottomRightImage = loadImage(darkBlueBinBottomRightName); + } @@ -232,7 +286,8 @@ WidgetFactory :: createButton(const Glib::ustring & label) throw () Ptr::Ref WidgetFactory :: createBlueBin(void) throw () { - Ptr::Ref blueBin(new BlueBin(blueBinTopLeftImage, + Ptr::Ref blueBin(new BlueBin(0xcfdee7, + blueBinTopLeftImage, blueBinLeftImage, blueBinTopImage, blueBinTopRightImage, @@ -245,3 +300,23 @@ WidgetFactory :: createBlueBin(void) throw () } +/*------------------------------------------------------------------------------ + * Create a dark blue bin + *----------------------------------------------------------------------------*/ +Ptr::Ref +WidgetFactory :: createDarkBlueBin(void) throw () +{ + Ptr::Ref blueBin(new BlueBin(0x99cdff, + darkBlueBinTopLeftImage, + darkBlueBinLeftImage, + darkBlueBinTopImage, + darkBlueBinTopRightImage, + darkBlueBinRightImage, + darkBlueBinBottomLeftImage, + darkBlueBinBottomImage, + darkBlueBinBottomRightImage)); + + return blueBin; +} + + diff --git a/livesupport/modules/widgets/var/darkBlueBin/bottom.png b/livesupport/modules/widgets/var/darkBlueBin/bottom.png new file mode 100644 index 000000000..ea0428e3a Binary files /dev/null and b/livesupport/modules/widgets/var/darkBlueBin/bottom.png differ diff --git a/livesupport/modules/widgets/var/darkBlueBin/bottomLeft.png b/livesupport/modules/widgets/var/darkBlueBin/bottomLeft.png new file mode 100644 index 000000000..55325d4e7 Binary files /dev/null and b/livesupport/modules/widgets/var/darkBlueBin/bottomLeft.png differ diff --git a/livesupport/modules/widgets/var/darkBlueBin/bottomRight.png b/livesupport/modules/widgets/var/darkBlueBin/bottomRight.png new file mode 100644 index 000000000..3852da14a Binary files /dev/null and b/livesupport/modules/widgets/var/darkBlueBin/bottomRight.png differ diff --git a/livesupport/modules/widgets/var/darkBlueBin/left.png b/livesupport/modules/widgets/var/darkBlueBin/left.png new file mode 100644 index 000000000..d27061d9b Binary files /dev/null and b/livesupport/modules/widgets/var/darkBlueBin/left.png differ diff --git a/livesupport/modules/widgets/var/darkBlueBin/right.png b/livesupport/modules/widgets/var/darkBlueBin/right.png new file mode 100644 index 000000000..7fcdc81b4 Binary files /dev/null and b/livesupport/modules/widgets/var/darkBlueBin/right.png differ diff --git a/livesupport/modules/widgets/var/darkBlueBin/top.png b/livesupport/modules/widgets/var/darkBlueBin/top.png new file mode 100644 index 000000000..89f8a583b Binary files /dev/null and b/livesupport/modules/widgets/var/darkBlueBin/top.png differ diff --git a/livesupport/modules/widgets/var/darkBlueBin/topLeft.png b/livesupport/modules/widgets/var/darkBlueBin/topLeft.png new file mode 100644 index 000000000..cd3f12159 Binary files /dev/null and b/livesupport/modules/widgets/var/darkBlueBin/topLeft.png differ diff --git a/livesupport/modules/widgets/var/darkBlueBin/topRight.png b/livesupport/modules/widgets/var/darkBlueBin/topRight.png new file mode 100644 index 000000000..ba5b8556c Binary files /dev/null and b/livesupport/modules/widgets/var/darkBlueBin/topRight.png differ