void MPix::EditorToolbox::LoadTool( shared_ptr<EditorTool> tool, int id) { tool->Chosen(); tool_name->setString(tool->GetName()); if (current_tool) { auto c = current_tool->Childs(); if (c) { for (auto t : *c ) { auto tt = tools[t.second]; tt->Hide(); } } } current_tool = tool; auto c = current_tool->Childs(); if (c) { for (auto t : *c ) { auto tt = tools[t.second]; tt->Show(t.first); } } if (current_tool->onSelected(p_editor_layer)) { CloseToolbox(); last_used = id; } }