diff --git a/livesupport/modules/widgets/etc/Makefile.in b/livesupport/modules/widgets/etc/Makefile.in index 457b2ceb1..52cf26a2c 100644 --- a/livesupport/modules/widgets/etc/Makefile.in +++ b/livesupport/modules/widgets/etc/Makefile.in @@ -21,7 +21,7 @@ # # # Author : $Author: fgerlits $ -# Version : $Revision: 1.10 $ +# Version : $Revision: 1.11 $ # Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/widgets/etc/Makefile.in,v $ # # @configure_input@ @@ -117,7 +117,8 @@ WIDGETS_LIB_OBJS = ${TMP_DIR}/ImageButton.o \ ${TMP_DIR}/ComboBoxText.o \ ${TMP_DIR}/Notebook.o \ ${TMP_DIR}/WidgetFactory.o \ - ${TMP_DIR}/ZebraTreeView.o + ${TMP_DIR}/ZebraTreeView.o \ + ${TMP_DIR}/Colors.o TEST_EXE_OBJS = ${TMP_DIR}/TestWindow.o \ ${TMP_DIR}/main.o diff --git a/livesupport/modules/widgets/include/LiveSupport/Widgets/BlueBin.h b/livesupport/modules/widgets/include/LiveSupport/Widgets/BlueBin.h index 7ab4bdd20..3c4fbbb4f 100644 --- a/livesupport/modules/widgets/include/LiveSupport/Widgets/BlueBin.h +++ b/livesupport/modules/widgets/include/LiveSupport/Widgets/BlueBin.h @@ -21,8 +21,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Author : $Author: maroy $ - Version : $Revision: 1.5 $ + Author : $Author: fgerlits $ + Version : $Revision: 1.6 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/widgets/include/LiveSupport/Widgets/BlueBin.h,v $ ------------------------------------------------------------------------------*/ @@ -44,6 +44,7 @@ #include "LiveSupport/Core/Ptr.h" #include "LiveSupport/Widgets/CornerImages.h" +#include "LiveSupport/Widgets/Colors.h" namespace LiveSupport { @@ -62,8 +63,8 @@ using namespace LiveSupport::Core; /** * A container holding exactly one child, habing a light blue border to it. * - * @author $Author: maroy $ - * @version $Revision: 1.5 $ + * @author $Author: fgerlits $ + * @version $Revision: 1.6 $ */ class BlueBin : public Gtk::Bin { @@ -221,7 +222,7 @@ class BlueBin : public Gtk::Bin * @param backgroundColor the RGB value for the background color. * @param cornerImages the corner images. */ - BlueBin(unsigned int backgroundColor, + BlueBin(Colors::ColorName backgroundColor, Ptr::Ref cornerImages) throw (); diff --git a/livesupport/modules/widgets/include/LiveSupport/Widgets/Colors.h b/livesupport/modules/widgets/include/LiveSupport/Widgets/Colors.h new file mode 100644 index 000000000..97b3fa29d --- /dev/null +++ b/livesupport/modules/widgets/include/LiveSupport/Widgets/Colors.h @@ -0,0 +1,116 @@ +/*------------------------------------------------------------------------------ + + Copyright (c) 2004 Media Development Loan Fund + + This file is part of the LiveSupport project. + http://livesupport.campware.org/ + To report bugs, send an e-mail to bugs@campware.org + + LiveSupport is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + LiveSupport is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with LiveSupport; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + + Author : $Author: fgerlits $ + Version : $Revision: 1.1 $ + Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/widgets/include/LiveSupport/Widgets/Colors.h,v $ + +------------------------------------------------------------------------------*/ +#ifndef LiveSupport_Widgets_Colors_h +#define LiveSupport_Widgets_Colors_h + +#ifndef __cplusplus +#error This is a C++ include file +#endif + + +/* ============================================================ include files */ + +#ifdef HAVE_CONFIG_H +#include "configure.h" +#endif + +#include +#include + +#include "gdkmm/color.h" +#include "gdkmm/colormap.h" + + +namespace LiveSupport { +namespace Widgets { + +/* ================================================================ constants */ + + +/* =================================================================== macros */ + + +/* =============================================================== data types */ + +/** + * A helper class to hold all the standard colors used by the LiveSupport GUI. + * + * @author $Author: fgerlits $ + * @version $Revision: 1.1 $ + */ +class Colors +{ + public: + /** + * The names of the colors. + */ + typedef enum { White, Black, + LightBlue, BrightBlue, Blue, DarkBlue, + Gray, SlateGray, MediumBlueGray, DarkGray, + Orange, + MasterPanelCenterBlue, LiveModeRowBlue } ColorName; + + private: + /** + * The vector holding the colors. + */ + static std::map colors; + + /** + * This loads the colors. + */ + static void + initialize(void) throw (); + + /** + * Whether we have been initialized yet. + */ + bool + static initialized; + + public: + /** + * Get a color by its name. + */ + static const Gdk::Color& + getColor(const ColorName&) throw (); +}; + + +/* ================================================= external data structures */ + + +/* ====================================================== function prototypes */ + + +} // namespace Widgets +} // namespace LiveSupport + +#endif // LiveSupport_Widgets_Colors_h + diff --git a/livesupport/modules/widgets/include/LiveSupport/Widgets/EntryBin.h b/livesupport/modules/widgets/include/LiveSupport/Widgets/EntryBin.h index b5c1a43f5..9b39bf406 100644 --- a/livesupport/modules/widgets/include/LiveSupport/Widgets/EntryBin.h +++ b/livesupport/modules/widgets/include/LiveSupport/Widgets/EntryBin.h @@ -21,8 +21,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Author : $Author: maroy $ - Version : $Revision: 1.2 $ + Author : $Author: fgerlits $ + Version : $Revision: 1.3 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/widgets/include/LiveSupport/Widgets/EntryBin.h,v $ ------------------------------------------------------------------------------*/ @@ -44,6 +44,7 @@ #include "LiveSupport/Core/Ptr.h" #include "LiveSupport/Widgets/CornerImages.h" +#include "LiveSupport/Widgets/Colors.h" #include "LiveSupport/Widgets/BlueBin.h" @@ -63,8 +64,8 @@ using namespace LiveSupport::Core; /** * A container, holding a Gtk::Entry as its only child. * - * @author $Author: maroy $ - * @version $Revision: 1.2 $ + * @author $Author: fgerlits $ + * @version $Revision: 1.3 $ */ class EntryBin : public BlueBin { @@ -82,7 +83,7 @@ class EntryBin : public BlueBin * @param backgroundColor the RGB value for the background color. * @param cornerImages the corner images. */ - EntryBin(unsigned int backgroundColor, + EntryBin(Colors::ColorName backgroundColor, Ptr::Ref cornerImages) throw (); diff --git a/livesupport/modules/widgets/include/LiveSupport/Widgets/WhiteWindow.h b/livesupport/modules/widgets/include/LiveSupport/Widgets/WhiteWindow.h index 1e38bde10..efcbfd4f1 100644 --- a/livesupport/modules/widgets/include/LiveSupport/Widgets/WhiteWindow.h +++ b/livesupport/modules/widgets/include/LiveSupport/Widgets/WhiteWindow.h @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.7 $ + Version : $Revision: 1.8 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/widgets/include/LiveSupport/Widgets/WhiteWindow.h,v $ ------------------------------------------------------------------------------*/ @@ -49,6 +49,7 @@ #include "LiveSupport/Core/Ptr.h" #include "LiveSupport/Widgets/CornerImages.h" +#include "LiveSupport/Widgets/Colors.h" #include "LiveSupport/Widgets/ImageButton.h" #include "LiveSupport/Widgets/BlueBin.h" @@ -70,7 +71,7 @@ using namespace LiveSupport::Core; * A container holding exactly one child, habing a light blue border to it. * * @author $Author: fgerlits $ - * @version $Revision: 1.7 $ + * @version $Revision: 1.8 $ */ class WhiteWindow : public Gtk::Window { @@ -269,12 +270,12 @@ class WhiteWindow : public Gtk::Window * Constructor. * * @param title the title of the window. - * @param backgroundColor the RGB value for the background color. + * @param backgroundColor the background color. * @param cornerImages the corner images. * @param resizable true if the user can resize the window. */ WhiteWindow(Glib::ustring title, - unsigned int backgroundColor, + Colors::ColorName backgroundColor, Ptr::Ref cornerImages, bool resizable = true) throw (); diff --git a/livesupport/modules/widgets/include/LiveSupport/Widgets/ZebraTreeView.h b/livesupport/modules/widgets/include/LiveSupport/Widgets/ZebraTreeView.h index e90d17885..a5935c55d 100644 --- a/livesupport/modules/widgets/include/LiveSupport/Widgets/ZebraTreeView.h +++ b/livesupport/modules/widgets/include/LiveSupport/Widgets/ZebraTreeView.h @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.1 $ + Version : $Revision: 1.2 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/widgets/include/LiveSupport/Widgets/ZebraTreeView.h,v $ ------------------------------------------------------------------------------*/ @@ -72,7 +72,7 @@ using namespace LiveSupport::Core; * A list of items, in rows colored alternately grey and light blue. * * @author $Author: fgerlits $ - * @version $Revision: 1.1 $ + * @version $Revision: 1.2 $ */ class ZebraTreeView : public Gtk::TreeView { @@ -100,6 +100,12 @@ class ZebraTreeView : public Gtk::TreeView */ virtual ~ZebraTreeView(void) throw (); + + /** + * Color the columns blue. + */ + void + colorBlue(void) throw (); }; diff --git a/livesupport/modules/widgets/src/BlueBin.cxx b/livesupport/modules/widgets/src/BlueBin.cxx index b8fcf8628..deab95860 100644 --- a/livesupport/modules/widgets/src/BlueBin.cxx +++ b/livesupport/modules/widgets/src/BlueBin.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.7 $ + Version : $Revision: 1.8 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/widgets/src/BlueBin.cxx,v $ ------------------------------------------------------------------------------*/ @@ -54,7 +54,7 @@ using namespace LiveSupport::Widgets; /*------------------------------------------------------------------------------ * Constructor. *----------------------------------------------------------------------------*/ -BlueBin :: BlueBin(unsigned int backgroundColor, +BlueBin :: BlueBin(Colors::ColorName backgroundColor, Ptr::Ref cornerImages) throw () { @@ -64,13 +64,7 @@ BlueBin :: BlueBin(unsigned int backgroundColor, child = 0; - bgColor = Gdk::Color(); - 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); + bgColor = Colors::getColor(backgroundColor); } diff --git a/livesupport/modules/widgets/src/Colors.cxx b/livesupport/modules/widgets/src/Colors.cxx new file mode 100644 index 000000000..bb026b5a1 --- /dev/null +++ b/livesupport/modules/widgets/src/Colors.cxx @@ -0,0 +1,131 @@ +/*------------------------------------------------------------------------------ + + Copyright (c) 2004 Media Development Loan Fund + + This file is part of the LiveSupport project. + http://livesupport.campware.org/ + To report bugs, send an e-mail to bugs@campware.org + + LiveSupport is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + LiveSupport is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with LiveSupport; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + + Author : $Author: fgerlits $ + Version : $Revision: 1.1 $ + Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/widgets/src/Colors.cxx,v $ + +------------------------------------------------------------------------------*/ + +/* ============================================================ include files */ + +#ifdef HAVE_CONFIG_H +#include "configure.h" +#endif + +#include + +#include "gtkmm/widget.h" + +#include "LiveSupport/Widgets/Colors.h" + + +using namespace LiveSupport::Widgets; + +/* =================================================== local data structures */ + + +/* ================================================ local constants & macros */ + +/** + * The vector holding the colors. + */ +std::map Colors :: colors; + +/** + * Clear the "initialized" flag. + */ +bool Colors :: initialized = false; + + +/* =============================================== local function prototypes */ + + +/* ============================================================= module code */ + +/*------------------------------------------------------------------------------ + * Load the colors. + *----------------------------------------------------------------------------*/ +void +Colors :: initialize(void) throw () +{ + Gdk::Color whiteColor ("#ffffff"); + Gdk::Color blackColor ("#000000"); + Gdk::Color lightBlueColor ("#cfdee7"); + Gdk::Color brightBlueColor ("#6fb0ff"); + Gdk::Color blueColor ("#9ebadb"); + Gdk::Color darkBlueColor ("#688597"); + Gdk::Color grayColor ("#eaeaea"); + Gdk::Color slateGrayColor ("#c7cdd3"); + Gdk::Color mediumBlueGrayColor ("#97bacf"); + Gdk::Color darkGrayColor ("#5a5a5a"); + Gdk::Color orangeColor ("#ff4b00"); + Gdk::Color masterPanelCenterBlueColor ("#99cdff"); + Gdk::Color liveModeRowBlueColor ("#cde0f1"); + + Glib::RefPtr colormap = Gtk::Widget::get_default_colormap(); + colormap->alloc_color(whiteColor); + colormap->alloc_color(blackColor); + colormap->alloc_color(lightBlueColor); + colormap->alloc_color(brightBlueColor); + colormap->alloc_color(blueColor); + colormap->alloc_color(darkBlueColor); + colormap->alloc_color(grayColor); + colormap->alloc_color(slateGrayColor); + colormap->alloc_color(mediumBlueGrayColor); + colormap->alloc_color(darkGrayColor); + colormap->alloc_color(orangeColor); + colormap->alloc_color(masterPanelCenterBlueColor); + colormap->alloc_color(liveModeRowBlueColor); + + colors[White] = whiteColor; + colors[Black] = blackColor; + colors[LightBlue] = lightBlueColor; + colors[BrightBlue] = brightBlueColor; + colors[Blue] = blueColor; + colors[DarkBlue] = darkBlueColor; + colors[Gray] = grayColor; + colors[SlateGray] = slateGrayColor; + colors[MediumBlueGray] = mediumBlueGrayColor; + colors[DarkGray] = darkGrayColor; + colors[Orange] = orangeColor; + colors[MasterPanelCenterBlue] = masterPanelCenterBlueColor; + colors[LiveModeRowBlue] = liveModeRowBlueColor; + + initialized = true; +} + + +/*------------------------------------------------------------------------------ + * Get a color by its name. + *----------------------------------------------------------------------------*/ +const Gdk::Color& +Colors :: getColor(const ColorName& name) throw () +{ + if (!initialized) { + initialize(); + } + + return colors[name]; +} + diff --git a/livesupport/modules/widgets/src/ComboBoxText.cxx b/livesupport/modules/widgets/src/ComboBoxText.cxx index e5dd3ffa9..b96ccf1b9 100644 --- a/livesupport/modules/widgets/src/ComboBoxText.cxx +++ b/livesupport/modules/widgets/src/ComboBoxText.cxx @@ -21,8 +21,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Author : $Author: maroy $ - Version : $Revision: 1.3 $ + Author : $Author: fgerlits $ + Version : $Revision: 1.4 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/widgets/src/ComboBoxText.cxx,v $ ------------------------------------------------------------------------------*/ @@ -33,6 +33,7 @@ #include "configure.h" #endif +#include "LiveSupport/Widgets/Colors.h" #include "LiveSupport/Widgets/ComboBoxText.h" @@ -68,10 +69,7 @@ ComboBoxText :: ComboBoxText(Glib::RefPtr leftImage, label->set_parent(*this); // specify a white background - Gdk::Color bgColor = Gdk::Color(); - bgColor.set_rgb(0xffff, 0xffff, 0xffff); - Glib::RefPtr colormap = get_default_colormap(); - colormap->alloc_color(bgColor); + Gdk::Color bgColor = Colors::getColor(Colors::White); menu.reset(new Gtk::Menu()); menu->modify_bg(Gtk::STATE_NORMAL, bgColor); diff --git a/livesupport/modules/widgets/src/EntryBin.cxx b/livesupport/modules/widgets/src/EntryBin.cxx index 25435bb77..37b86f813 100644 --- a/livesupport/modules/widgets/src/EntryBin.cxx +++ b/livesupport/modules/widgets/src/EntryBin.cxx @@ -21,8 +21,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Author : $Author: maroy $ - Version : $Revision: 1.2 $ + Author : $Author: fgerlits $ + Version : $Revision: 1.3 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/widgets/src/EntryBin.cxx,v $ ------------------------------------------------------------------------------*/ @@ -54,7 +54,7 @@ using namespace LiveSupport::Widgets; /*------------------------------------------------------------------------------ * Constructor. *----------------------------------------------------------------------------*/ -EntryBin :: EntryBin(unsigned int backgroundColor, +EntryBin :: EntryBin(Colors::ColorName backgroundColor, Ptr::Ref cornerImages) throw () : BlueBin(backgroundColor, cornerImages) diff --git a/livesupport/modules/widgets/src/ImageButton.cxx b/livesupport/modules/widgets/src/ImageButton.cxx index 5adab4ac9..fa33becdb 100644 --- a/livesupport/modules/widgets/src/ImageButton.cxx +++ b/livesupport/modules/widgets/src/ImageButton.cxx @@ -21,8 +21,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Author : $Author: maroy $ - Version : $Revision: 1.4 $ + Author : $Author: fgerlits $ + Version : $Revision: 1.5 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/widgets/src/ImageButton.cxx,v $ ------------------------------------------------------------------------------*/ @@ -33,6 +33,7 @@ #include "configure.h" #endif +#include "LiveSupport/Widgets/Colors.h" #include "LiveSupport/Widgets/ImageButton.h" @@ -220,10 +221,7 @@ ImageButton :: on_realize() throw () unset_flags(Gtk::NO_WINDOW); set_window(gdkWindow); - Gdk::Color bgColor; - bgColor.set_rgb(0xffff, 0xffff, 0xffff); - Glib::RefPtr colormap = get_default_colormap(); - colormap->alloc_color(bgColor); + Gdk::Color bgColor = Colors::getColor(Colors::White); modify_bg(Gtk::STATE_NORMAL, bgColor); // make the widget receive expose events diff --git a/livesupport/modules/widgets/src/TestWindow.cxx b/livesupport/modules/widgets/src/TestWindow.cxx index 1b8f9a9db..b660ad16b 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.12 $ + Author : $Author: fgerlits $ + Version : $Revision: 1.13 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/widgets/src/TestWindow.cxx,v $ ------------------------------------------------------------------------------*/ @@ -36,6 +36,7 @@ #include #include "LiveSupport/Widgets/WidgetFactory.h" +#include "LiveSupport/Widgets/Colors.h" #include "TestWindow.h" @@ -58,7 +59,7 @@ using namespace LiveSupport::Widgets; TestWindow :: TestWindow (void) throw () : WhiteWindow("test window", - 0xffffff, + Colors::White, WidgetFactory::getInstance()->getWhiteWindowCorners()) { Ptr::Ref widgetFactory = WidgetFactory::getInstance(); @@ -88,7 +89,7 @@ TestWindow :: TestWindow (void) notebook->appendPage(*entryBin, "third page"); // create a blue container - blueBin = Gtk::manage(widgetFactory->createDarkBlueBin()); + blueBin = Gtk::manage(widgetFactory->createBlueBin()); // create and set up the layout layout = Gtk::manage(new Gtk::Table()); diff --git a/livesupport/modules/widgets/src/WhiteWindow.cxx b/livesupport/modules/widgets/src/WhiteWindow.cxx index 9f099bfcf..2f058cac7 100644 --- a/livesupport/modules/widgets/src/WhiteWindow.cxx +++ b/livesupport/modules/widgets/src/WhiteWindow.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.8 $ + Version : $Revision: 1.9 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/widgets/src/WhiteWindow.cxx,v $ ------------------------------------------------------------------------------*/ @@ -57,7 +57,7 @@ using namespace LiveSupport::Widgets; * Constructor. *----------------------------------------------------------------------------*/ WhiteWindow :: WhiteWindow(Glib::ustring title, - unsigned int backgroundColor, + Colors::ColorName backgroundColor, Ptr::Ref cornerImages, bool resizable) throw () @@ -72,13 +72,7 @@ WhiteWindow :: WhiteWindow(Glib::ustring title, layout = Gtk::manage(new Gtk::Table()); // create the background color, as it is needed by the event box - Gdk::Color bgColor = Gdk::Color(); - 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); + Gdk::Color bgColor = Colors::getColor(backgroundColor); // set the window title this->title = Gtk::manage(new Gtk::Label(title)); diff --git a/livesupport/modules/widgets/src/WidgetFactory.cxx b/livesupport/modules/widgets/src/WidgetFactory.cxx index 0fcce81ac..fd1759229 100644 --- a/livesupport/modules/widgets/src/WidgetFactory.cxx +++ b/livesupport/modules/widgets/src/WidgetFactory.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.11 $ + Version : $Revision: 1.12 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/widgets/src/WidgetFactory.cxx,v $ ------------------------------------------------------------------------------*/ @@ -35,8 +35,9 @@ #include -#include "LiveSupport/Widgets/WidgetFactory.h" +#include "LiveSupport/Widgets/Colors.h" +#include "LiveSupport/Widgets/WidgetFactory.h" using namespace LiveSupport::Core; using namespace LiveSupport::Widgets; @@ -275,7 +276,7 @@ WidgetFactory :: createComboBoxText(void) throw () BlueBin * WidgetFactory :: createBlueBin(void) throw () { - return new BlueBin(0xcfdee7, blueBinImages); + return new BlueBin(Colors::LightBlue, blueBinImages); } @@ -285,7 +286,7 @@ WidgetFactory :: createBlueBin(void) throw () BlueBin * WidgetFactory :: createDarkBlueBin(void) throw () { - return new BlueBin(0x99cdff, darkBlueBinImages); + return new BlueBin(Colors::MasterPanelCenterBlue, darkBlueBinImages); } @@ -295,7 +296,7 @@ WidgetFactory :: createDarkBlueBin(void) throw () EntryBin * WidgetFactory :: createEntryBin(void) throw () { - return new EntryBin(0xcfdfe7, entryBinImages); + return new EntryBin(Colors::LightBlue, entryBinImages); } diff --git a/livesupport/modules/widgets/src/ZebraTreeView.cxx b/livesupport/modules/widgets/src/ZebraTreeView.cxx index 4f75495b9..70cc7291b 100644 --- a/livesupport/modules/widgets/src/ZebraTreeView.cxx +++ b/livesupport/modules/widgets/src/ZebraTreeView.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.1 $ + Version : $Revision: 1.2 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/widgets/src/ZebraTreeView.cxx,v $ ------------------------------------------------------------------------------*/ @@ -66,7 +66,22 @@ ZebraTreeView :: ZebraTreeView(Glib::RefPtr treeModel) /*------------------------------------------------------------------------------ * Destructor. *----------------------------------------------------------------------------*/ -ZebraTreeView :: ~ZebraTreeView(void) throw () +ZebraTreeView :: ~ZebraTreeView(void) throw () { } + +/*------------------------------------------------------------------------------ + * Color the table blue. + *----------------------------------------------------------------------------*/ +void +ZebraTreeView :: colorBlue(void) throw () +{ + Gdk::Color bgColor = Colors::getColor(Colors::LightBlue); + + for (int i = 0; i < get_columns().size(); i++) { + Gtk::CellRenderer* renderer = get_column_cell_renderer(i); + renderer->property_cell_background_gdk() = bgColor; +// renderer->property_cell_background_set() = false; + } +} diff --git a/livesupport/products/gLiveSupport/src/DjBagWindow.cxx b/livesupport/products/gLiveSupport/src/DjBagWindow.cxx index cd6a61123..4e48bcea8 100644 --- a/livesupport/products/gLiveSupport/src/DjBagWindow.cxx +++ b/livesupport/products/gLiveSupport/src/DjBagWindow.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.11 $ + Version : $Revision: 1.12 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/Attic/DjBagWindow.cxx,v $ ------------------------------------------------------------------------------*/ @@ -65,7 +65,7 @@ DjBagWindow :: DjBagWindow (Ptr::Ref gLiveSupport, Ptr::Ref bundle) throw () : WhiteWindow("", - 0xffffff, + Colors::White, WidgetFactory::getInstance()->getWhiteWindowCorners()), LocalizedObject(bundle) { @@ -125,6 +125,9 @@ DjBagWindow :: DjBagWindow (Ptr::Ref gLiveSupport, std::cerr << e.what() << std::endl; } + // color the columns blue + treeView->colorBlue(); + // register the signal handler for treeview entries being clicked treeView->signal_button_press_event().connect_notify(sigc::mem_fun(*this, &DjBagWindow::onEntryClicked)); diff --git a/livesupport/products/gLiveSupport/src/DjBagWindow.h b/livesupport/products/gLiveSupport/src/DjBagWindow.h index af732d6af..e4c320916 100644 --- a/livesupport/products/gLiveSupport/src/DjBagWindow.h +++ b/livesupport/products/gLiveSupport/src/DjBagWindow.h @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.9 $ + Version : $Revision: 1.10 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/Attic/DjBagWindow.h,v $ ------------------------------------------------------------------------------*/ @@ -71,7 +71,7 @@ using namespace LiveSupport::Widgets; * playlists. * * @author $Author: fgerlits $ - * @version $Revision: 1.9 $ + * @version $Revision: 1.10 $ */ class DjBagWindow : public WhiteWindow, public LocalizedObject { @@ -83,7 +83,7 @@ class DjBagWindow : public WhiteWindow, public LocalizedObject * Lists one clip per row. * * @author $Author: fgerlits $ - * @version $Revision: 1.9 $ + * @version $Revision: 1.10 $ */ class ModelColumns : public Gtk::TreeModel::ColumnRecord { @@ -138,7 +138,7 @@ class DjBagWindow : public WhiteWindow, public LocalizedObject /** * The tree view, now only showing rows. */ - Gtk::TreeView * treeView; + ZebraTreeView * treeView; /** * The tree model, as a GTK reference. diff --git a/livesupport/products/gLiveSupport/src/LoginWindow.cxx b/livesupport/products/gLiveSupport/src/LoginWindow.cxx index 5604aac8e..ad29da250 100644 --- a/livesupport/products/gLiveSupport/src/LoginWindow.cxx +++ b/livesupport/products/gLiveSupport/src/LoginWindow.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.10 $ + Version : $Revision: 1.11 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/LoginWindow.cxx,v $ ------------------------------------------------------------------------------*/ @@ -64,7 +64,7 @@ LoginWindow :: LoginWindow (Ptr::Ref gLiveSupport, Ptr::Ref bundle) throw () : WhiteWindow("", - 0xffffff, + Colors::White, WidgetFactory::getInstance()->getWhiteWindowCorners(), false), LocalizedObject(bundle) diff --git a/livesupport/products/gLiveSupport/src/MasterPanelWindow.cxx b/livesupport/products/gLiveSupport/src/MasterPanelWindow.cxx index 90bf02bd0..d0a98bacc 100644 --- a/livesupport/products/gLiveSupport/src/MasterPanelWindow.cxx +++ b/livesupport/products/gLiveSupport/src/MasterPanelWindow.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.14 $ + Version : $Revision: 1.15 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/MasterPanelWindow.cxx,v $ ------------------------------------------------------------------------------*/ @@ -144,10 +144,7 @@ MasterPanelWindow :: MasterPanelWindow (Ptr::Ref gLiveSupport, add(*layout); // set the background to white - bgColor = Gdk::Color(); - bgColor.set_rgb(0xffff, 0xffff, 0xffff); - Glib::RefPtr colormap = get_default_colormap(); - colormap->alloc_color(bgColor); + bgColor = Colors::getColor(Colors::White); modify_bg(Gtk::STATE_NORMAL, bgColor); // set the size and location of the window, according to the screen size diff --git a/livesupport/products/gLiveSupport/src/UploadFileWindow.cxx b/livesupport/products/gLiveSupport/src/UploadFileWindow.cxx index 89e9a1d92..07e48e349 100644 --- a/livesupport/products/gLiveSupport/src/UploadFileWindow.cxx +++ b/livesupport/products/gLiveSupport/src/UploadFileWindow.cxx @@ -21,8 +21,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Author : $Author: maroy $ - Version : $Revision: 1.5 $ + Author : $Author: fgerlits $ + Version : $Revision: 1.6 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/UploadFileWindow.cxx,v $ ------------------------------------------------------------------------------*/ @@ -66,7 +66,7 @@ UploadFileWindow :: UploadFileWindow (Ptr::Ref gLiveSupport, Ptr::Ref bundle) throw () : WhiteWindow("", - 0xffffff, + Colors::White, WidgetFactory::getInstance()->getWhiteWindowCorners()), LocalizedObject(bundle) {