-/*! ========================================================================
-** Synfig
-** Template File
-** $Id: compview.cpp,v 1.1.1.1 2005/01/07 03:34:36 darco Exp $
+/* === S Y N F I G ========================================================= */
+/*! \file compview.cpp
+** \brief writeme
**
-** Copyright (c) 2002 Robert B. Quattlebaum Jr.
+** $Id$
**
-** This software and associated documentation
-** are CONFIDENTIAL and PROPRIETARY property of
-** the above-mentioned copyright holder.
+** \legal
+** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
**
-** You may not copy, print, publish, or in any
-** other way distribute this software without
-** a prior written agreement with
-** the copyright holder.
+** This package 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.
+**
+** This package 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.
+** \endlegal
**
** === N O T E S ===========================================================
**
#define COLUMNID_JUMP (787584)
#define ColumnID int
-
+
/* === G L O B A L S ======================================================= */
/* === P R O C E D U R E S ================================================= */
notebook->append_page(*create_canvas_tree(),"Canvases");
notebook->append_page(*create_action_tree(),"History");
-
+
/*
App::signal_instance_created().connect(sigc::mem_fun(*this,&studio::CompView::new_instance));
App::signal_instance_deleted().connect(sigc::mem_fun(*this,&studio::CompView::delete_instance));
App::signal_instance_selected().connect(sigc::mem_fun(*this,&studio::CompView::set_selected_instance_signal));
-
+
table->show_all();
add(*table);
//#ifdef NDEBUG
// column->add_attribute(icon_cellrenderer->property_pixbuf(), canvas_tree_model.icon);
//#endif
-
+
canvas_tree->append_column(*column);
}
canvas_tree->set_rules_hint();
Gtk::CellRendererToggle* toggle_cr = Gtk::manage( new Gtk::CellRendererToggle() );
toggle_cr->signal_toggled().connect(sigc::mem_fun(*this, &studio::CompView::on_action_toggle) );
-
+
column->pack_start(*toggle_cr); //false = don't expand.
column->add_attribute(toggle_cr->property_active(),history_tree_model.is_active);
column->set_resizable();
column->set_clickable();
-
+
action_tree->append_column(*column);
}
/*{
Gtk::TreeView::Column* column = Gtk::manage( new Gtk::TreeView::Column("Canvas") );
Gtk::CellRendererText *text_cr=Gtk::manage(new Gtk::CellRendererText());
text_cr->property_foreground()=Glib::ustring("#7f7f7f");
-
+
column->pack_start(*text_cr);
column->add_attribute(text_cr->property_text(),history_tree_model.canvas_id);
column->add_attribute(text_cr->property_foreground_set(),history_tree_model.is_redo);
-
+
action_tree->append_column(*column);
}*/
{
Gtk::CellRendererText* cell_renderer_jump=Gtk::manage(new Gtk::CellRendererText());
column->pack_start(*cell_renderer_jump,true);
-
+
cell_renderer_jump->property_text()="(JMP)";
cell_renderer_jump->property_foreground()="#003a7f";
-
+
column->set_resizable();
column->set_clickable();
-
+
column->set_sort_column_id(COLUMNID_JUMP);
action_tree->append_column(*column);
Gtk::CellRendererText *text_cr=Gtk::manage(new Gtk::CellRendererText());
text_cr->property_foreground()=Glib::ustring("#7f7f7f");
-
+
//column->pack_start(history_tree_model.icon, false); //false = don't expand.
column->pack_start(*text_cr);
column->add_attribute(text_cr->property_text(),history_tree_model.name);
column->add_attribute(text_cr->property_foreground_set(),history_tree_model.is_redo);
-
+
action_tree->append_column(*column);
}
-
+
action_tree->set_rules_hint();
// action_tree->signal_row_activated().connect(sigc::mem_fun(*this,&CompView::on_row_activate));
action_tree->signal_event().connect(sigc::mem_fun(*this,&CompView::on_action_event));
Gtk::Button* clear_redo_button(manage(new Gtk::Button(_("Clear Redo"))));
clear_redo_button->signal_pressed().connect(sigc::mem_fun(*this,&studio::CompView::clear_redo));
-
+
Gtk::Table* table(manage(new Gtk::Table()));
table->attach(*scrolledwindow, 0, 2, 0,1, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
table->attach(*clear_button, 0, 1, 1,2, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK, 0, 0);
table->attach(*clear_redo_button, 1, 2, 1,2, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK, 0, 0);
-
+
table->show_all();
-
+
return table;
}
CompView::clear_history()
{
if(selected_instance && App::dialog_yes_no(_("Clear History"), _("You will not be able to undo any changes that you have made!\nAre you sure you want to clear the undo stack?")))
- {
+ {
selected_instance->clear_undo_stack();
}
}
CompView::clear_redo()
{
if(selected_instance && App::dialog_yes_no(_("Clear History"), _("You will not be able to redo any changes that you have made!\nAre you sure you want to clear the redo stack?")))
- {
+ {
selected_instance->clear_redo_stack();
}
}
else
instance_selector->set_history(0);
- set_selected_instance_(x);
+ set_selected_instance_(x);
}
void
{
if(studio::App::shutdown_in_progress)
return;
-
+
assert(instance);
-
+
etl::loose_handle<studio::Instance> loose_instance(instance);
-
+
instance->synfigapp::Instance::signal_filename_changed().connect(sigc::mem_fun(*this,&CompView::refresh_instances));
instance->synfigapp::Instance::signal_filename_changed().connect(
sigc::bind<etl::loose_handle<studio::Instance> >(
loose_instance
)
);
-
+
{
std::string name=basename(instance->get_file_name());
)
) break;
const Gtk::TreeRow row = *(action_tree->get_model()->get_iter(path));
-
+
//signal_user_click()(event->button.button,row,(ColumnID)column->get_sort_column_id());
if((ColumnID)column->get_sort_column_id()==COLUMNID_JUMP)
{
}
}
}
-
+
case GDK_BUTTON_RELEASE:
break;
default:
synfigapp::Action::ParamList param_list;
param_list.add("canvas",synfig::Canvas::Handle(get_selected_canvas()));
param_list.add("canvas_interface",get_selected_instance()->find_canvas_interface(get_selected_canvas()));
- get_selected_instance()->find_canvas_view(get_selected_canvas())->add_actions_to_menu(&menu, param_list,synfigapp::Action::CATEGORY_CANVAS);
+ get_selected_instance()->find_canvas_view(get_selected_canvas())->add_actions_to_menu(&menu, param_list,synfigapp::Action::CATEGORY_CANVAS);
menu.popup(0,0);
menu.show();
break;
studio::HistoryTreeStore::Model history_tree_model;
Gtk::TreePath path(path_string);
-
+
const Gtk::TreeRow row = *(selected_instance->history_tree_store()->get_iter(path));
handle<synfigapp::Action::Undoable> action=row[history_tree_model.action];
-
+
selected_instance->synfigapp::Instance::set_action_status(action,!action->is_active());
}