diff --git a/livesupport/src/modules/widgets/etc/Makefile.in b/livesupport/src/modules/widgets/etc/Makefile.in index 4f5d5c775..a94441f4b 100644 --- a/livesupport/src/modules/widgets/etc/Makefile.in +++ b/livesupport/src/modules/widgets/etc/Makefile.in @@ -147,7 +147,8 @@ WIDGETS_LIB_OBJS = ${TMP_DIR}/ImageButton.o \ ${TMP_DIR}/ZebraCellRenderer.o \ ${TMP_DIR}/Colors.o \ ${TMP_DIR}/MessageWindow.o \ - ${TMP_DIR}/DialogWindow.o + ${TMP_DIR}/DialogWindow.o \ + ${TMP_DIR}/ScrolledWindow.o TEST_EXE_OBJS = ${TMP_DIR}/TestWindow.o \ ${TMP_DIR}/main.o diff --git a/livesupport/src/modules/widgets/include/LiveSupport/Widgets/Colors.h b/livesupport/src/modules/widgets/include/LiveSupport/Widgets/Colors.h index b1171cab0..f916e8282 100644 --- a/livesupport/src/modules/widgets/include/LiveSupport/Widgets/Colors.h +++ b/livesupport/src/modules/widgets/include/LiveSupport/Widgets/Colors.h @@ -77,7 +77,8 @@ class Colors LightBlue, BrightBlue, Blue, DarkBlue, Gray, SlateGray, MediumBlueGray, DarkGray, Orange, - MasterPanelCenterBlue, LiveModeRowBlue } ColorName; + MasterPanelCenterBlue, LiveModeRowBlue, + WindowBackground = White } ColorName; private: /** diff --git a/livesupport/src/modules/widgets/include/LiveSupport/Widgets/ScrolledWindow.h b/livesupport/src/modules/widgets/include/LiveSupport/Widgets/ScrolledWindow.h new file mode 100644 index 000000000..82ce945f6 --- /dev/null +++ b/livesupport/src/modules/widgets/include/LiveSupport/Widgets/ScrolledWindow.h @@ -0,0 +1,102 @@ +/*------------------------------------------------------------------------------ + + 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$ + Version : $Revision$ + Location : $URL$ + +------------------------------------------------------------------------------*/ +#ifndef LiveSupport_Widgets_ScrolledWindow_h +#define LiveSupport_Widgets_ScrolledWindow_h + +#ifndef __cplusplus +#error This is a C++ include file +#endif + + +/* ============================================================ include files */ + +#ifdef HAVE_CONFIG_H +#include "configure.h" +#endif + +#include + +#include "LiveSupport/Widgets/Colors.h" + + +namespace LiveSupport { +namespace Widgets { + +using namespace LiveSupport::Core; + +/* ================================================================ constants */ + + +/* =================================================================== macros */ + + +/* =============================================================== data types */ + +/** + * A subclass of Gtk::ScrolledWindow. The only difference is that the + * background color is hard-coded to be LiveSupport::Widgets::Colors::White. + * + * @author $Author$ + * @version $Revision$ + */ +class ScrolledWindow : public Gtk::ScrolledWindow +{ + protected: + /** + * Handle the realize event. + */ + virtual void + on_realize() throw (); + + + public: + /** + * Constructor. + */ + ScrolledWindow() throw (); + + /** + * A virtual destructor. + */ + virtual + ~ScrolledWindow(void) throw (); +}; + + +/* ================================================= external data structures */ + + +/* ====================================================== function prototypes */ + + +} // namespace Widgets +} // namespace LiveSupport + +#endif // LiveSupport_Widgets_ScrolledWindow_h + diff --git a/livesupport/src/modules/widgets/src/ScrolledWindow.cxx b/livesupport/src/modules/widgets/src/ScrolledWindow.cxx new file mode 100644 index 000000000..f1bc62c83 --- /dev/null +++ b/livesupport/src/modules/widgets/src/ScrolledWindow.cxx @@ -0,0 +1,85 @@ +/*------------------------------------------------------------------------------ + + 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$ + Version : $Revision$ + Location : $URL$ + +------------------------------------------------------------------------------*/ + +/* ============================================================ include files */ + +#ifdef HAVE_CONFIG_H +#include "configure.h" +#endif + +#include + +#include "LiveSupport/Widgets/WidgetFactory.h" +#include "LiveSupport/Widgets/ScrolledWindow.h" + + +using namespace LiveSupport::Core; +using namespace LiveSupport::Widgets; + +/* =================================================== local data structures */ + + +/* ================================================ local constants & macros */ + + +/* =============================================== local function prototypes */ + + +/* ============================================================= module code */ + +/*------------------------------------------------------------------------------ + * Constructor. + *----------------------------------------------------------------------------*/ +ScrolledWindow :: ScrolledWindow(void) throw () + : Gtk::ScrolledWindow() +{ +} + + +/*------------------------------------------------------------------------------ + * Destructor. + *----------------------------------------------------------------------------*/ +ScrolledWindow :: ~ScrolledWindow(void) throw () +{ +} + + +/*------------------------------------------------------------------------------ + * Handle the realize event. + *----------------------------------------------------------------------------*/ +void +ScrolledWindow :: on_realize() throw () +{ + Gdk::Color bgColor = Colors::getColor(Colors::WindowBackground); + Widget * child = get_child(); + child->modify_bg(Gtk::STATE_NORMAL, bgColor); + + Gtk::ScrolledWindow::on_realize(); +} + diff --git a/livesupport/src/products/gLiveSupport/src/UploadFileWindow.cxx b/livesupport/src/products/gLiveSupport/src/UploadFileWindow.cxx index 617592e3e..c48458031 100644 --- a/livesupport/src/products/gLiveSupport/src/UploadFileWindow.cxx +++ b/livesupport/src/products/gLiveSupport/src/UploadFileWindow.cxx @@ -187,12 +187,12 @@ UploadFileWindow :: UploadFileWindow (Ptr::Ref gLiveSupport, musicAlignment->add(*musicTable); talkAlignment->add(*talkTable); - Gtk::ScrolledWindow * mainScrolledWindow - = Gtk::manage(new Gtk::ScrolledWindow()); - Gtk::ScrolledWindow * musicScrolledWindow - = Gtk::manage(new Gtk::ScrolledWindow()); - Gtk::ScrolledWindow * talkScrolledWindow - = Gtk::manage(new Gtk::ScrolledWindow()); + ScrolledWindow * mainScrolledWindow + = Gtk::manage(new ScrolledWindow()); + ScrolledWindow * musicScrolledWindow + = Gtk::manage(new ScrolledWindow()); + ScrolledWindow * talkScrolledWindow + = Gtk::manage(new ScrolledWindow()); mainScrolledWindow->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); diff --git a/livesupport/src/products/gLiveSupport/src/UploadFileWindow.h b/livesupport/src/products/gLiveSupport/src/UploadFileWindow.h index 8aaf23f99..43f6727f9 100644 --- a/livesupport/src/products/gLiveSupport/src/UploadFileWindow.h +++ b/livesupport/src/products/gLiveSupport/src/UploadFileWindow.h @@ -46,7 +46,6 @@ #include #include #include -#include #include "LiveSupport/Core/Ptr.h" #include "LiveSupport/Core/LocalizedObject.h" @@ -55,6 +54,7 @@ #include "LiveSupport/Widgets/ComboBoxText.h" #include "LiveSupport/Widgets/Notebook.h" #include "LiveSupport/Widgets/WhiteWindow.h" +#include "LiveSupport/Widgets/ScrolledWindow.h" #include "GLiveSupport.h" #include "MasterPanelUserInfoWidget.h"