Subclassed Gtk::ScrolledWindow to make the background white;

seems like a stupid solution, but at least it works.
This fixes #1501.
This commit is contained in:
fgerlits 2005-10-07 12:50:05 +00:00
parent 39b1a24e17
commit 5b7f03dce9
6 changed files with 198 additions and 9 deletions

View file

@ -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

View file

@ -77,7 +77,8 @@ class Colors
LightBlue, BrightBlue, Blue, DarkBlue,
Gray, SlateGray, MediumBlueGray, DarkGray,
Orange,
MasterPanelCenterBlue, LiveModeRowBlue } ColorName;
MasterPanelCenterBlue, LiveModeRowBlue,
WindowBackground = White } ColorName;
private:
/**

View file

@ -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 <gtkmm/scrolledwindow.h>
#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

View file

@ -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 <iostream>
#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();
}

View file

@ -187,12 +187,12 @@ UploadFileWindow :: UploadFileWindow (Ptr<GLiveSupport>::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);

View file

@ -46,7 +46,6 @@
#include <gtkmm/alignment.h>
#include <gtkmm/box.h>
#include <gtkmm/window.h>
#include <gtkmm/scrolledwindow.h>
#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"