Ejemplo n.º 1
0
def apply_placement_tool_set(view, item_type, handle_index):
    def unset_placement_tool(gesture, offset_x, offset_y):
        apply_default_tool_set(view)

    view.remove_all_controllers()
    tool = placement_tool(view, factory(view, item_type), handle_index)
    tool.connect("drag-end", unset_placement_tool)
    view.add_controller(scroll_tool(view))
    view.add_controller(zoom_tool(view))
    view.add_controller(view_focus_tool(view))
    view.add_controller(tool)
Ejemplo n.º 2
0
def apply_default_tool_set(view):
    view.remove_all_controllers()
    view.add_controller(item_tool(view))
    view.add_controller(segment_tool(view))
    view.add_controller(scroll_tool(view))
    view.add_controller(zoom_tool(view))
    view.add_controller(view_focus_tool(view))

    view.add_controller(rubberband_tool(view, rubberband_state(view)))
    view.add_controller(hover_tool(view))
    return rubberband_state
Ejemplo n.º 3
0
def apply_placement_tool_set(view, item_factory, modeling_language,
                             event_manager, handle_index):
    view.remove_all_controllers()
    view.add_controller(view_focus_tool(view))
    view.add_controller(*transactional_tool(
        placement_tool(view, item_factory, event_manager, handle_index),
        event_manager=event_manager,
    ))
    view.add_controller(drop_zone_tool(view, item_factory.item_class))
    view.add_controller(scroll_tool(view))
    view.add_controller(zoom_tool(view))
    view.add_controller(shortcut_tool(view, modeling_language, event_manager))
Ejemplo n.º 4
0
def apply_default_tool_set(view, modeling_language, event_manager,
                           rubberband_state):
    """The default tool set."""
    view.remove_all_controllers()
    view.add_controller(hover_tool(view))
    view.add_controller(*transactional_tool(
        segment_tool(view), item_tool(view), event_manager=event_manager))
    view.add_controller(*text_edit_tools(view))
    view.add_controller(rubberband_tool(view, rubberband_state))
    view.add_controller(scroll_tool(view))
    view.add_controller(zoom_tool(view))
    view.add_controller(view_focus_tool(view))
    view.add_controller(shortcut_tool(view, modeling_language, event_manager))