Instance::Instance(synfig::Canvas::Handle canvas):
synfigapp::Instance (canvas),
-// canvas_tree_store_ (Gtk::TreeStore::create(CanvasTreeModel())),
-// canvas_tree_store_ (Gtk::TreeStore::create()),
+ canvas_tree_store_ (Gtk::TreeStore::create(canvas_tree_model)),
history_tree_store_ (HistoryTreeStore::create(this)),
undo_status_(false),
redo_status_(false)
{
- CanvasTreeModel model;
- canvas_tree_store_=Gtk::TreeStore::create(model);
-
id_=instance_count_++;
// Connect up all the signals
)
);
- canvas_tree_store_=Gtk::TreeStore::create(canvas_tree_model);
-
refresh_canvas_tree();
}
Layer::Handle parent_layer(dynamic_cast<Layer*>(node));
if(parent_layer && parent_layer->get_canvas()->get_root()!=get_canvas())
{
+ //! \todo Fix big involving "Save As" with referenced compositions
string msg(strprintf(_("There is currently a bug when using \"SaveAs\"\n"
"on a composition that is being referenced by other\n"
"files that are currently open. Close these\n"
for(iter=children.begin();iter!=children.end();iter++)
insert_canvas(*(canvas_tree_store()->append(row.children())),*iter);
- }
-
- /*
- if(!canvas->value_node_list().empty())
- {
- Gtk::TreeRow valuenode_row = *(canvas_tree_store()->append(row.children()));
-
- valuenode_row[canvas_tree_model.label] = "<defs>";
- valuenode_row[canvas_tree_model.canvas] = canvas;
- valuenode_row[canvas_tree_model.is_canvas] = false;
- valuenode_row[canvas_tree_model.is_value_node] = false;
-
- synfig::ValueNodeList::iterator iter;
- synfig::ValueNodeList &value_node_list(canvas->value_node_list());
-
- for(iter=value_node_list.begin();iter!=value_node_list.end();iter++)
- insert_value_node(*(canvas_tree_store()->append(valuenode_row.children())),canvas,*iter);
- }
- */
-}
-
-/*
-void
-Instance::insert_value_node(Gtk::TreeRow row,Canvas::Handle canvas,etl::handle<synfig::ValueNode> value_node)
-{
- CanvasTreeModel canvas_tree_model;
- assert(value_node);
- assert(canvas);
-
- row[canvas_tree_model.id] = value_node->get_id();
- row[canvas_tree_model.name] = value_node->get_id();
- row[canvas_tree_model.label] = value_node->get_id();
- row[canvas_tree_model.canvas] = canvas;
- row[canvas_tree_model.value_node] = value_node;
- row[canvas_tree_model.is_canvas] = false;
- row[canvas_tree_model.is_value_node] = true;
- row[canvas_tree_model.icon] = Gtk::Button().render_icon(valuenode_icon(value_node),Gtk::ICON_SIZE_SMALL_TOOLBAR);
+ }
}
-*/
void
Instance::refresh_canvas_tree()
Gtk::Image* image(manage(new Gtk::Image()));
Gtk::Stock::lookup(get_action_stock_id(*iter),Gtk::ICON_SIZE_MENU,*image);
- /*
- if(iter->task=="raise")
- Gtk::Stock::lookup(Gtk::Stock::GO_UP,Gtk::ICON_SIZE_MENU,*image);
- else if(iter->task=="lower")
- Gtk::Stock::lookup(Gtk::Stock::GO_DOWN,Gtk::ICON_SIZE_MENU,*image);
- else if(iter->task=="move_top")
- Gtk::Stock::lookup(Gtk::Stock::GOTO_TOP,Gtk::ICON_SIZE_MENU,*image);
- else if(iter->task=="move_bottom")
- Gtk::Stock::lookup(Gtk::Stock::GOTO_BOTTOM,Gtk::ICON_SIZE_MENU,*image);
- else if(iter->task=="remove")
- Gtk::Stock::lookup(Gtk::Stock::DELETE,Gtk::ICON_SIZE_MENU,*image);
- else if(iter->task=="set_on")
- Gtk::Stock::lookup(Gtk::Stock::YES,Gtk::ICON_SIZE_MENU,*image);
- else if(iter->task=="set_off")
- Gtk::Stock::lookup(Gtk::Stock::NO,Gtk::ICON_SIZE_MENU,*image);
- else if(iter->task=="duplicate")
- Gtk::Stock::lookup(Gtk::Stock::COPY,Gtk::ICON_SIZE_MENU,*image);
- else if(iter->task=="remove")
- Gtk::Stock::lookup(Gtk::Stock::DELETE,Gtk::ICON_SIZE_MENU,*image);
- else
- {
- Gtk::Stock::lookup(Gtk::StockID("synfig-"+iter->name),Gtk::ICON_SIZE_MENU,*image) ||
- Gtk::Stock::lookup(Gtk::StockID("gtk-"+iter->task),Gtk::ICON_SIZE_MENU,*image) ||
- Gtk::Stock::lookup(Gtk::StockID("synfig-"+iter->task),Gtk::ICON_SIZE_MENU,*image);
- }
- */
menu->items().push_back(
Gtk::Menu_Helpers::ImageMenuElem(
iter->local_name,
Gtk::Image* image(manage(new Gtk::Image()));
Gtk::Stock::lookup(get_action_stock_id(*iter),Gtk::ICON_SIZE_MENU,*image);
-/* if(iter->task=="raise")
- Gtk::Stock::lookup(Gtk::Stock::GO_UP,Gtk::ICON_SIZE_MENU,*image);
- else if(iter->task=="lower")
- Gtk::Stock::lookup(Gtk::Stock::GO_DOWN,Gtk::ICON_SIZE_MENU,*image);
- else if(iter->task=="move_top")
- Gtk::Stock::lookup(Gtk::Stock::GOTO_TOP,Gtk::ICON_SIZE_MENU,*image);
- else if(iter->task=="move_bottom")
- Gtk::Stock::lookup(Gtk::Stock::GOTO_BOTTOM,Gtk::ICON_SIZE_MENU,*image);
- else if(iter->task=="remove")
- Gtk::Stock::lookup(Gtk::Stock::DELETE,Gtk::ICON_SIZE_MENU,*image);
- else if(iter->task=="set_on")
- Gtk::Stock::lookup(Gtk::Stock::YES,Gtk::ICON_SIZE_MENU,*image);
- else if(iter->task=="set_off")
- Gtk::Stock::lookup(Gtk::Stock::NO,Gtk::ICON_SIZE_MENU,*image);
- else if(iter->task=="duplicate")
- Gtk::Stock::lookup(Gtk::Stock::COPY,Gtk::ICON_SIZE_MENU,*image);
- else if(iter->task=="remove")
- Gtk::Stock::lookup(Gtk::Stock::DELETE,Gtk::ICON_SIZE_MENU,*image);
- else
- {
- Gtk::Stock::lookup(Gtk::StockID("synfig-"+iter->name),Gtk::ICON_SIZE_MENU,*image) ||
- Gtk::Stock::lookup(Gtk::StockID("gtk-"+iter->task),Gtk::ICON_SIZE_MENU,*image) ||
- Gtk::Stock::lookup(Gtk::StockID("synfig-"+iter->task),Gtk::ICON_SIZE_MENU,*image);
- }
-*/
menu->items().push_back(
Gtk::Menu_Helpers::ImageMenuElem(
iter->local_name,
{
Gtk::Image* image(manage(new Gtk::Image()));
Gtk::Stock::lookup(get_action_stock_id(*iter),Gtk::ICON_SIZE_MENU,*image);
-/* if(iter->task=="raise")
- Gtk::Stock::lookup(Gtk::Stock::GO_UP,Gtk::ICON_SIZE_MENU,*image);
- else if(iter->task=="lower")
- Gtk::Stock::lookup(Gtk::Stock::GO_DOWN,Gtk::ICON_SIZE_MENU,*image);
- else if(iter->task=="move_top")
- Gtk::Stock::lookup(Gtk::Stock::GOTO_TOP,Gtk::ICON_SIZE_MENU,*image);
- else if(iter->task=="move_bottom")
- Gtk::Stock::lookup(Gtk::Stock::GOTO_BOTTOM,Gtk::ICON_SIZE_MENU,*image);
- else if(iter->task=="remove")
- Gtk::Stock::lookup(Gtk::Stock::DELETE,Gtk::ICON_SIZE_MENU,*image);
- else if(iter->task=="set_on")
- Gtk::Stock::lookup(Gtk::Stock::YES,Gtk::ICON_SIZE_MENU,*image);
- else if(iter->task=="set_off")
- Gtk::Stock::lookup(Gtk::Stock::NO,Gtk::ICON_SIZE_MENU,*image);
- else if(iter->task=="duplicate")
- Gtk::Stock::lookup(Gtk::Stock::COPY,Gtk::ICON_SIZE_MENU,*image);
- else if(iter->task=="remove")
- Gtk::Stock::lookup(Gtk::Stock::DELETE,Gtk::ICON_SIZE_MENU,*image);
- else
- {
- Gtk::Stock::lookup(Gtk::StockID("synfig-"+iter->name),Gtk::ICON_SIZE_MENU,*image) ||
- Gtk::Stock::lookup(Gtk::StockID("gtk-"+iter->task),Gtk::ICON_SIZE_MENU,*image) ||
- Gtk::Stock::lookup(Gtk::StockID("synfig-"+iter->task),Gtk::ICON_SIZE_MENU,*image);
- }
-*/
+
menu->items().push_back(
Gtk::Menu_Helpers::ImageMenuElem(
iter->local_name,
filemenu->items().push_back(Gtk::Menu_Helpers::SeparatorElem());
filemenu->items().push_back(Gtk::Menu_Helpers::MenuElem(_("Panels"),*dock_dialogs));
- //filemenu->items().push_back(Gtk::Menu_Helpers::MenuElem(_("Canvas Browser..."),
- // sigc::mem_fun(studio::App::show_comp_view)));
- //filemenu->items().push_back(Gtk::Menu_Helpers::MenuElem(_("Gradient Editor..."),
- // sigc::mem_fun(show_dialog_gradient)));
- //filemenu->items().push_back(Gtk::Menu_Helpers::MenuElem(_("Tool Options"),
- // sigc::mem_fun(show_dialog_tool_options)));
- //filemenu->items().push_back(Gtk::Menu_Helpers::MenuElem(_("Colors..."),
- // sigc::mem_fun(show_dialog_color)));
- //filemenu->items().push_back(Gtk::Menu_Helpers::MenuElem(_("Color Palette..."),
- // sigc::mem_fun(show_dialog_palette)));
filemenu->items().push_back(Gtk::Menu_Helpers::MenuElem(_("Input Devices..."),
sigc::ptr_fun(&show_dialog_input)));
filemenu->items().push_back(Gtk::Menu_Helpers::MenuElem(_("Setup..."),
table1->set_col_spacings(0);
table1->attach(*menubar1, 0,1, 0,1, Gtk::FILL|Gtk::EXPAND, Gtk::SHRINK, 0, 0);
table1->attach(*file_buttons, 0,1, 1,2, Gtk::FILL|Gtk::EXPAND,Gtk::EXPAND|Gtk::FILL, 0, 0);
- //table1->attach(*manage(new Gtk::Label(_("Tools"))), 0, 1, 2, 3, Gtk::FILL|Gtk::EXPAND,Gtk::EXPAND|Gtk::FILL, 0, 0);
- table1->attach(*handle_tools, 0,1, 3,4, Gtk::FILL|Gtk::EXPAND,Gtk::EXPAND|Gtk::FILL, 0, 0);
- table1->attach(*handle_defaults, 0,1, 4,5, Gtk::FILL|Gtk::EXPAND,Gtk::EXPAND|Gtk::FILL, 0, 0);
+ table1->attach(*handle_tools, 0,1, 2,3, Gtk::FILL|Gtk::EXPAND,Gtk::EXPAND|Gtk::FILL, 0, 0);
+ table1->attach(*handle_defaults, 0,1, 3,4, Gtk::FILL|Gtk::EXPAND,Gtk::EXPAND|Gtk::FILL, 0, 0);
table1->show_all();