2008-04-12 22:15:07 +02:00
|
|
|
/*
|
2015-05-29 04:44:58 +02:00
|
|
|
TimelinePanel - Dockable panel to hold the main timeline view
|
2010-12-17 23:28:49 +01:00
|
|
|
|
2008-04-12 22:15:07 +02:00
|
|
|
Copyright (C) Lumiera.org
|
2016-10-26 18:43:55 +02:00
|
|
|
2016, Hermann Vosseler <Ichthyostega@web.de>
|
2010-12-17 23:28:49 +01:00
|
|
|
|
2008-04-12 22:15:07 +02:00
|
|
|
This program is free software; you can redistribute it and/or
|
|
|
|
|
modify it under the terms of the GNU General Public License as
|
2010-12-17 23:28:49 +01:00
|
|
|
published by the Free Software Foundation; either version 2 of
|
|
|
|
|
the License, or (at your option) any later version.
|
|
|
|
|
|
2008-04-12 22:15:07 +02:00
|
|
|
This program 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.
|
2010-12-17 23:28:49 +01:00
|
|
|
|
2008-04-12 22:15:07 +02:00
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
2010-12-17 23:28:49 +01:00
|
|
|
|
2008-04-12 22:15:07 +02:00
|
|
|
* *****************************************************/
|
|
|
|
|
|
2008-11-22 17:34:49 +01:00
|
|
|
|
2016-10-26 18:43:55 +02:00
|
|
|
/** @file timeline-panel.cpp
|
|
|
|
|
** Implementation of dockable timeline container.
|
|
|
|
|
**
|
2016-10-26 19:33:00 +02:00
|
|
|
** @todo as of 10/2016 this is WIP-WIP-WIP : canvas widgets experiment
|
|
|
|
|
** @todo build a new timeline widget, connected to the UI-Bus
|
2016-10-26 18:43:55 +02:00
|
|
|
** @see timeline-widget.hpp
|
|
|
|
|
**
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
2010-12-27 05:50:40 +01:00
|
|
|
#include "gui/gtk-lumiera.hpp"
|
2015-05-29 04:44:58 +02:00
|
|
|
#include "gui/panel/timeline-panel.hpp"
|
2008-04-12 22:15:07 +02:00
|
|
|
|
2016-10-26 19:33:00 +02:00
|
|
|
//#include "gui/workspace/workspace-window.hpp"
|
2015-01-06 14:37:26 +01:00
|
|
|
#include "gui/ui-bus.hpp"
|
2016-10-27 22:57:46 +02:00
|
|
|
#include "lib/format-string.hpp"
|
|
|
|
|
#include "lib/format-cout.hpp"
|
2011-10-11 21:39:20 +02:00
|
|
|
|
2016-10-26 19:33:00 +02:00
|
|
|
//#include "lib/util.hpp"
|
2008-11-22 17:34:49 +01:00
|
|
|
|
2008-08-16 23:06:46 +02:00
|
|
|
|
2008-05-22 20:19:04 +02:00
|
|
|
|
2016-10-27 22:57:46 +02:00
|
|
|
using util::_Fmt;
|
2016-10-26 19:33:00 +02:00
|
|
|
//using std::shared_ptr;
|
|
|
|
|
//using std::weak_ptr;
|
|
|
|
|
//using util::contains;
|
2016-10-27 04:15:20 +02:00
|
|
|
using sigc::mem_fun;
|
2016-10-27 22:57:46 +02:00
|
|
|
using std::cout;
|
|
|
|
|
using std::endl;
|
2011-05-16 08:38:01 +02:00
|
|
|
|
2008-04-12 22:15:07 +02:00
|
|
|
|
2015-05-29 04:44:58 +02:00
|
|
|
namespace gui {
|
|
|
|
|
namespace panel {
|
2008-09-12 21:55:54 +02:00
|
|
|
|
|
|
|
|
|
2015-05-29 04:44:58 +02:00
|
|
|
|
|
|
|
|
TimelinePanel::TimelinePanel (workspace::PanelManager& panelManager,
|
|
|
|
|
Gdl::DockItem& dockItem)
|
|
|
|
|
: Panel(panelManager, dockItem, getTitle(), getStockID())
|
2016-10-27 04:15:20 +02:00
|
|
|
, twoParts_(Gtk::ORIENTATION_VERTICAL)
|
|
|
|
|
, buttons_()
|
|
|
|
|
, button_1_()
|
|
|
|
|
, button_2_()
|
|
|
|
|
, frame_("Gtk::Layout Experiments")
|
|
|
|
|
, scroller_()
|
2008-10-07 22:17:29 +02:00
|
|
|
{
|
2016-10-27 04:15:20 +02:00
|
|
|
twoParts_.pack_start(buttons_, Gtk::PACK_SHRINK);
|
|
|
|
|
twoParts_.pack_start(frame_);
|
|
|
|
|
|
|
|
|
|
buttons_.add(button_1_);
|
|
|
|
|
buttons_.add(button_2_);
|
|
|
|
|
buttons_.set_layout(Gtk::BUTTONBOX_START);
|
|
|
|
|
|
|
|
|
|
button_1_.set_label("Experiment _1");
|
|
|
|
|
button_1_.signal_clicked().connect(
|
|
|
|
|
mem_fun(*this, &TimelinePanel::experiment_1));
|
|
|
|
|
|
|
|
|
|
button_2_.set_label("Experiment _2");
|
|
|
|
|
button_2_.signal_clicked().connect(
|
|
|
|
|
mem_fun(*this, &TimelinePanel::experiment_2));
|
|
|
|
|
|
|
|
|
|
frame_.add(scroller_);
|
|
|
|
|
frame_.set_border_width(5);
|
|
|
|
|
|
|
|
|
|
scroller_.set_shadow_type(Gtk::SHADOW_NONE);
|
2016-10-27 22:57:46 +02:00
|
|
|
scroller_.set_border_width(10);
|
|
|
|
|
|
|
|
|
|
chldEx_ = Gtk::manage(new ChildEx);
|
|
|
|
|
scroller_.add(*chldEx_);
|
2016-10-27 04:15:20 +02:00
|
|
|
|
|
|
|
|
this->add(twoParts_);
|
|
|
|
|
this->show_all();
|
2008-10-07 22:17:29 +02:00
|
|
|
}
|
|
|
|
|
|
2015-05-29 04:44:58 +02:00
|
|
|
const char*
|
|
|
|
|
TimelinePanel::getTitle()
|
|
|
|
|
{
|
|
|
|
|
return _("Timeline");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const gchar*
|
|
|
|
|
TimelinePanel::getStockID()
|
|
|
|
|
{
|
|
|
|
|
return "panel_timeline";
|
|
|
|
|
}
|
2008-11-22 17:34:49 +01:00
|
|
|
|
2015-05-29 04:44:58 +02:00
|
|
|
|
2016-10-27 04:15:20 +02:00
|
|
|
void
|
|
|
|
|
TimelinePanel::experiment_1()
|
|
|
|
|
{
|
|
|
|
|
frame_.set_label("Experiment 1...");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
TimelinePanel::experiment_2()
|
|
|
|
|
{
|
|
|
|
|
frame_.set_label("Experiment 2...");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2015-05-29 04:44:58 +02:00
|
|
|
|
2016-10-27 22:57:46 +02:00
|
|
|
/* === Support for Investigation === */
|
|
|
|
|
|
|
|
|
|
namespace {
|
|
|
|
|
_Fmt childID("Chld-%02d");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
uint ChildEx::childNo = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ChildEx::ChildEx()
|
|
|
|
|
: Gtk::Button(string (childID % childNo++))
|
|
|
|
|
{
|
|
|
|
|
signal_clicked().connect(
|
|
|
|
|
mem_fun(*this, &ChildEx::onClicked));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
ChildEx::onClicked()
|
|
|
|
|
{
|
|
|
|
|
cout << "|=="<<get_label()<<endl;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-05-29 04:44:58 +02:00
|
|
|
}} // namespace gui::panel
|