added first version of huge play button in Live Mode (does not do anything yet)

This commit is contained in:
fgerlits 2005-05-05 16:25:57 +00:00
parent 8dfa5a9f54
commit 76939ade97
8 changed files with 95 additions and 22 deletions

View file

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: maroy $ Author : $Author: fgerlits $
Version : $Revision: 1.2 $ Version : $Revision: 1.3 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/widgets/include/LiveSupport/Widgets/ImageButton.h,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/widgets/include/LiveSupport/Widgets/ImageButton.h,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -59,8 +59,8 @@ namespace Widgets {
* The button is fixed in size, which is determined by the images used * The button is fixed in size, which is determined by the images used
* to represent it. * to represent it.
* *
* @author $Author: maroy $ * @author $Author: fgerlits $
* @version $Revision: 1.2 $ * @version $Revision: 1.3 $
*/ */
class ImageButton : public Gtk::Button class ImageButton : public Gtk::Button
{ {
@ -241,6 +241,19 @@ class ImageButton : public Gtk::Button
*/ */
virtual virtual
~ImageButton(void) throw (); ~ImageButton(void) throw ();
/**
* Return the passive image of this button.
* This is used by ZebraTreeView::addColumn(), but should be
* removed later.
*
* @return a pointer to the image.
*/
Glib::RefPtr<Gdk::Pixbuf>
getPassiveImage(void) throw ()
{
return passiveImage;
}
}; };

View file

@ -22,7 +22,7 @@
Author : $Author: fgerlits $ Author : $Author: fgerlits $
Version : $Revision: 1.17 $ Version : $Revision: 1.18 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/widgets/include/LiveSupport/Widgets/WidgetFactory.h,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/widgets/include/LiveSupport/Widgets/WidgetFactory.h,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -52,7 +52,6 @@
#include "LiveSupport/Widgets/ComboBoxText.h" #include "LiveSupport/Widgets/ComboBoxText.h"
#include "LiveSupport/Widgets/BlueBin.h" #include "LiveSupport/Widgets/BlueBin.h"
#include "LiveSupport/Widgets/EntryBin.h" #include "LiveSupport/Widgets/EntryBin.h"
#include "LiveSupport/Widgets/ZebraTreeView.h"
namespace LiveSupport { namespace LiveSupport {
@ -69,6 +68,7 @@ using namespace LiveSupport::Core;
/* =============================================================== data types */ /* =============================================================== data types */
class WhiteWindow; class WhiteWindow;
class ZebraTreeView;
/** /**
* A factory to provide access to LiveSupport Widgets. * A factory to provide access to LiveSupport Widgets.
@ -89,7 +89,7 @@ class WhiteWindow;
* </code></pre> * </code></pre>
* *
* @author $Author: fgerlits $ * @author $Author: fgerlits $
* @version $Revision: 1.17 $ * @version $Revision: 1.18 $
*/ */
class WidgetFactory : class WidgetFactory :
virtual public Configurable virtual public Configurable

View file

@ -22,7 +22,7 @@
Author : $Author: fgerlits $ Author : $Author: fgerlits $
Version : $Revision: 1.9 $ Version : $Revision: 1.10 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/widgets/include/LiveSupport/Widgets/ZebraTreeView.h,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/widgets/include/LiveSupport/Widgets/ZebraTreeView.h,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -50,6 +50,7 @@
#include <gtkmm/window.h> #include <gtkmm/window.h>
#include "LiveSupport/Core/Ptr.h" #include "LiveSupport/Core/Ptr.h"
#include "LiveSupport/Widgets/WidgetFactory.h"
#include "LiveSupport/Widgets/CornerImages.h" #include "LiveSupport/Widgets/CornerImages.h"
#include "LiveSupport/Widgets/ImageButton.h" #include "LiveSupport/Widgets/ImageButton.h"
#include "LiveSupport/Widgets/BlueBin.h" #include "LiveSupport/Widgets/BlueBin.h"
@ -91,7 +92,7 @@ using namespace LiveSupport::Core;
* 3) connected with a TreeModelColumn using set_renderer(). * 3) connected with a TreeModelColumn using set_renderer().
* *
* @author $Author: fgerlits $ * @author $Author: fgerlits $
* @version $Revision: 1.9 $ * @version $Revision: 1.10 $
*/ */
class ZebraTreeView : public Gtk::TreeView class ZebraTreeView : public Gtk::TreeView
{ {
@ -142,6 +143,21 @@ class ZebraTreeView : public Gtk::TreeView
const Gtk::TreeModelColumn<Glib::ustring>& modelColumn, const Gtk::TreeModelColumn<Glib::ustring>& modelColumn,
int minimumWidth = 0) int minimumWidth = 0)
throw (); throw ();
/**
* Add a button column to the TreeView.
*
* @param title the title of the column
* @param buttonType the type of button this view will display
* @param minimumWidth the minimum width of the column, in pixels
* (optional)
* @return the number of columns after adding this one
*/
int
appendColumn(const Glib::ustring& title,
WidgetFactory::ImageButtonType buttonType,
int minimumWidth = 0)
throw ();
}; };

View file

@ -22,7 +22,7 @@
Author : $Author: fgerlits $ Author : $Author: fgerlits $
Version : $Revision: 1.19 $ Version : $Revision: 1.20 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/widgets/src/WidgetFactory.cxx,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/widgets/src/WidgetFactory.cxx,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -36,9 +36,11 @@
#include <gtkmm/entry.h> #include <gtkmm/entry.h>
#include "LiveSupport/Widgets/Colors.h" #include "LiveSupport/Widgets/Colors.h"
#include "LiveSupport/Widgets/WidgetFactory.h" #include "LiveSupport/Widgets/ZebraTreeView.h"
#include "MessageWindow.h" #include "MessageWindow.h"
#include "LiveSupport/Widgets/WidgetFactory.h"
using namespace LiveSupport::Core; using namespace LiveSupport::Core;
using namespace LiveSupport::Widgets; using namespace LiveSupport::Widgets;

View file

@ -22,7 +22,7 @@
Author : $Author: fgerlits $ Author : $Author: fgerlits $
Version : $Revision: 1.9 $ Version : $Revision: 1.10 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/widgets/src/ZebraTreeView.cxx,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/widgets/src/ZebraTreeView.cxx,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -35,9 +35,7 @@
#include <iostream> #include <iostream>
#include "LiveSupport/Widgets/WidgetFactory.h"
#include "LiveSupport/Widgets/ZebraTreeModelColumnRecord.h" #include "LiveSupport/Widgets/ZebraTreeModelColumnRecord.h"
#include "LiveSupport/Widgets/ZebraCellRenderer.h"
#include "LiveSupport/Widgets/ZebraTreeView.h" #include "LiveSupport/Widgets/ZebraTreeView.h"
@ -108,6 +106,46 @@ ZebraTreeView :: appendColumn(
} }
/*------------------------------------------------------------------------------
* Add a button column to the TreeView.
*----------------------------------------------------------------------------*/
int
ZebraTreeView :: appendColumn(
const Glib::ustring & title,
WidgetFactory::ImageButtonType buttonType,
int minimumWidth)
throw ()
{
Ptr<WidgetFactory>::Ref wf = WidgetFactory::getInstance();
ImageButton * button = Gtk::manage(wf->createButton(
buttonType ));
Glib::RefPtr<Gdk::Pixbuf> passiveImage = button->getPassiveImage();
// a standard cell renderer
Gtk::CellRendererPixbuf* renderer
= Gtk::manage(new Gtk::CellRendererPixbuf);
// set the image of the renderer
renderer->property_pixbuf() = passiveImage;
// the constructor packs the renderer into the TreeViewColumn
Gtk::TreeViewColumn* viewColumn = Gtk::manage(new
Gtk::TreeViewColumn(title, *renderer) );
// this cell data function will do the blue-gray zebra stripes
viewColumn->set_cell_data_func(
*renderer,
sigc::mem_fun(*this, &ZebraTreeView::cellDataFunction) );
// set the minimum width of the column
if (minimumWidth) {
viewColumn->set_min_width(minimumWidth);
}
return append_column(*viewColumn);
}
/*------------------------------------------------------------------------------ /*------------------------------------------------------------------------------
* The callback function. * The callback function.
*----------------------------------------------------------------------------*/ *----------------------------------------------------------------------------*/

View file

@ -22,7 +22,7 @@
Author : $Author: fgerlits $ Author : $Author: fgerlits $
Version : $Revision: 1.6 $ Version : $Revision: 1.7 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/LiveModeWindow.cxx,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/LiveModeWindow.cxx,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -37,6 +37,7 @@
#include <stdexcept> #include <stdexcept>
#include "LiveSupport/Widgets/WidgetFactory.h" #include "LiveSupport/Widgets/WidgetFactory.h"
#include "LiveSupport/Widgets/ZebraTreeView.h"
#include "SchedulePlaylistWindow.h" #include "SchedulePlaylistWindow.h"
#include "LiveModeWindow.h" #include "LiveModeWindow.h"
@ -62,7 +63,7 @@ using namespace LiveSupport::GLiveSupport;
* Constructor. * Constructor.
*----------------------------------------------------------------------------*/ *----------------------------------------------------------------------------*/
LiveModeWindow :: LiveModeWindow (Ptr<GLiveSupport>::Ref gLiveSupport, LiveModeWindow :: LiveModeWindow (Ptr<GLiveSupport>::Ref gLiveSupport,
Ptr<ResourceBundle>::Ref bundle) Ptr<ResourceBundle>::Ref bundle)
throw () throw ()
: WhiteWindow(WidgetFactory::liveModeWindowTitleImage, : WhiteWindow(WidgetFactory::liveModeWindowTitleImage,
Colors::White, Colors::White,
@ -84,6 +85,7 @@ LiveModeWindow :: LiveModeWindow (Ptr<GLiveSupport>::Ref gLiveSupport,
// Add the TreeView's view columns: // Add the TreeView's view columns:
try { try {
treeView->appendColumn("", WidgetFactory::hugePlayButton, 82);
treeView->appendColumn(*getResourceUstring("titleColumnLabel"), treeView->appendColumn(*getResourceUstring("titleColumnLabel"),
modelColumns.titleColumn, 200); modelColumns.titleColumn, 200);
treeView->appendColumn(*getResourceUstring("creatorColumnLabel"), treeView->appendColumn(*getResourceUstring("creatorColumnLabel"),
@ -138,7 +140,7 @@ LiveModeWindow :: LiveModeWindow (Ptr<GLiveSupport>::Ref gLiveSupport,
// show // show
set_name("liveModeWindow"); set_name("liveModeWindow");
set_default_size(530, 300); set_default_size(610, 500);
set_modal(false); set_modal(false);
property_window_position().set_value(Gtk::WIN_POS_NONE); property_window_position().set_value(Gtk::WIN_POS_NONE);

View file

@ -22,7 +22,7 @@
Author : $Author: fgerlits $ Author : $Author: fgerlits $
Version : $Revision: 1.5 $ Version : $Revision: 1.6 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/LiveModeWindow.h,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/LiveModeWindow.h,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -72,7 +72,7 @@ using namespace LiveSupport::Widgets;
* playlists. * playlists.
* *
* @author $Author: fgerlits $ * @author $Author: fgerlits $
* @version $Revision: 1.5 $ * @version $Revision: 1.6 $
*/ */
class LiveModeWindow : public WhiteWindow, public LocalizedObject class LiveModeWindow : public WhiteWindow, public LocalizedObject
{ {
@ -85,7 +85,7 @@ class LiveModeWindow : public WhiteWindow, public LocalizedObject
* Lists one clip per row. * Lists one clip per row.
* *
* @author $Author: fgerlits $ * @author $Author: fgerlits $
* @version $Revision: 1.5 $ * @version $Revision: 1.6 $
*/ */
class ModelColumns : public ZebraTreeModelColumnRecord class ModelColumns : public ZebraTreeModelColumnRecord
{ {
@ -221,6 +221,7 @@ class LiveModeWindow : public WhiteWindow, public LocalizedObject
onRowDeleted(const Gtk::TreeModel::Path & path) throw () onRowDeleted(const Gtk::TreeModel::Path & path) throw ()
{ {
// std::cerr << "rows deleted: " << path.to_string() << ";\n"; // std::cerr << "rows deleted: " << path.to_string() << ";\n";
treeView->columns_autosize();
} }

View file

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: maroy $ Author : $Author: fgerlits $
Version : $Revision: 1.13 $ Version : $Revision: 1.14 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/ScratchpadWindow.cxx,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/ScratchpadWindow.cxx,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -37,6 +37,7 @@
#include <stdexcept> #include <stdexcept>
#include "LiveSupport/Widgets/WidgetFactory.h" #include "LiveSupport/Widgets/WidgetFactory.h"
#include "LiveSupport/Widgets/ZebraTreeView.h"
#include "SchedulePlaylistWindow.h" #include "SchedulePlaylistWindow.h"
#include "ScratchpadWindow.h" #include "ScratchpadWindow.h"