added title specification for WhiteWindow

This commit is contained in:
maroy 2005-02-09 14:46:31 +00:00
parent a8981fb962
commit 45309db5ef
3 changed files with 13 additions and 9 deletions

View File

@ -22,7 +22,7 @@
Author : $Author: maroy $ Author : $Author: maroy $
Version : $Revision: 1.2 $ Version : $Revision: 1.3 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/widgets/include/LiveSupport/Widgets/WhiteWindow.h,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/widgets/include/LiveSupport/Widgets/WhiteWindow.h,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -69,7 +69,7 @@ using namespace LiveSupport::Core;
* A container holding exactly one child, habing a light blue border to it. * A container holding exactly one child, habing a light blue border to it.
* *
* @author $Author: maroy $ * @author $Author: maroy $
* @version $Revision: 1.2 $ * @version $Revision: 1.3 $
*/ */
class WhiteWindow : public Gtk::Window class WhiteWindow : public Gtk::Window
{ {
@ -233,10 +233,12 @@ class WhiteWindow : public Gtk::Window
/** /**
* Constructor. * Constructor.
* *
* @param title the title of the window.
* @param backgroundColor the RGB value for the background color. * @param backgroundColor the RGB value for the background color.
* @param cornerImages the corner images. * @param cornerImages the corner images.
*/ */
WhiteWindow(unsigned int backgroundColor, WhiteWindow(Glib::ustring title,
unsigned int backgroundColor,
Ptr<CornerImages>::Ref cornerImages) Ptr<CornerImages>::Ref cornerImages)
throw (); throw ();

View File

@ -22,7 +22,7 @@
Author : $Author: maroy $ Author : $Author: maroy $
Version : $Revision: 1.6 $ Version : $Revision: 1.7 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/widgets/src/TestWindow.cxx,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/widgets/src/TestWindow.cxx,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -57,7 +57,8 @@ using namespace LiveSupport::Widgets;
*----------------------------------------------------------------------------*/ *----------------------------------------------------------------------------*/
TestWindow :: TestWindow (void) TestWindow :: TestWindow (void)
throw () throw ()
: WhiteWindow(0xffffff, : WhiteWindow("test window",
0xffffff,
WidgetFactory::getInstance()->getWhiteWindowCorners()) WidgetFactory::getInstance()->getWhiteWindowCorners())
{ {
Ptr<WidgetFactory>::Ref widgetFactory = WidgetFactory::getInstance(); Ptr<WidgetFactory>::Ref widgetFactory = WidgetFactory::getInstance();

View File

@ -22,7 +22,7 @@
Author : $Author: maroy $ Author : $Author: maroy $
Version : $Revision: 1.2 $ Version : $Revision: 1.3 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/widgets/src/WhiteWindow.cxx,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/widgets/src/WhiteWindow.cxx,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -56,7 +56,8 @@ using namespace LiveSupport::Widgets;
/*------------------------------------------------------------------------------ /*------------------------------------------------------------------------------
* Constructor. * Constructor.
*----------------------------------------------------------------------------*/ *----------------------------------------------------------------------------*/
WhiteWindow :: WhiteWindow(unsigned int backgroundColor, WhiteWindow :: WhiteWindow(Glib::ustring title,
unsigned int backgroundColor,
Ptr<CornerImages>::Ref cornerImages) Ptr<CornerImages>::Ref cornerImages)
throw () throw ()
: Gtk::Window(Gtk::WINDOW_TOPLEVEL) : Gtk::Window(Gtk::WINDOW_TOPLEVEL)
@ -77,14 +78,14 @@ WhiteWindow :: WhiteWindow(unsigned int backgroundColor,
colormap->alloc_color(bgColor); colormap->alloc_color(bgColor);
// set the window title // set the window title
title.reset(new Gtk::Label("Window Title")); this->title.reset(new Gtk::Label(title));
titleAlignment.reset(new Gtk::Alignment(Gtk::ALIGN_LEFT, titleAlignment.reset(new Gtk::Alignment(Gtk::ALIGN_LEFT,
Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER,
0, 0)); 0, 0));
titleEventBox.reset(new Gtk::EventBox()); titleEventBox.reset(new Gtk::EventBox());
titleEventBox->set_visible_window(); titleEventBox->set_visible_window();
titleEventBox->modify_bg(Gtk::STATE_NORMAL, bgColor); titleEventBox->modify_bg(Gtk::STATE_NORMAL, bgColor);
titleAlignment->add(*title); titleAlignment->add(*this->title);
titleEventBox->add(*titleAlignment); titleEventBox->add(*titleAlignment);
layout->attach(*titleEventBox, 0, 1, 0, 1, Gtk::FILL, Gtk::SHRINK); layout->attach(*titleEventBox, 0, 1, 0, 1, Gtk::FILL, Gtk::SHRINK);