private void LoadPropertiesForSelection() { m_PropertyView = null; if (m_ActionMapsTree.GetSelectedRow() != null) { var row = m_ActionMapsTree.GetSelectedRow(); if (row != null) { m_ActionsTree.actionMapProperty = m_ActionMapsTree.GetSelectedRow().elementProperty; m_ActionsTree.Reload(); } } if (m_ActionsTree.HasSelection() && m_ActionsTree.GetSelection().Count == 1) { var p = m_ActionsTree.GetSelectedRow(); if (p != null && p.hasProperties) { m_PropertyView = p.GetPropertiesView(() => { Apply(); LoadPropertiesForSelection(); }, m_PickerTreeViewState, m_InputActionWindowToolbar); } } }
private void LoadPropertiesForSelection() { m_BindingPropertyView = null; m_ActionPropertyView = null; // Column #1: Load selected action map. if (m_ActionMapsTree.GetSelectedRow() != null) { var row = m_ActionMapsTree.GetSelectedRow(); if (row != null) { m_ActionsTree.actionMapProperty = m_ActionMapsTree.GetSelectedRow().elementProperty; m_ActionsTree.Reload(); } } // Column #2: Load selected action or binding. if (m_ActionsTree.HasSelection() && m_ActionsTree.GetSelection().Count == 1) { var item = m_ActionsTree.GetSelectedRow(); if (item is BindingTreeItem) { // Grab the action for the binding and see if we have an expected control layout // set on it. Pass that on to the control picking machinery. var isCompositeTreeItem = item is CompositeTreeItem; var actionItem = (isCompositeTreeItem ? item.parent.parent : item.parent) as ActionTreeItem; Debug.Assert(actionItem != null); // Show properties for binding. m_BindingPropertyView = new InputBindingPropertiesView( item.elementProperty, change => { Apply(); }, m_PickerTreeViewState, m_InputActionWindowToolbar, item.expectedControlLayout); // For composite groups, don't show the binding path and control scheme section, // but show composite parameters instead. if (item is CompositeGroupTreeItem) { m_BindingPropertyView.isCompositeBinding = true; } } if (item is ActionTreeItem) { var actionItem = item as ActionTreeItem; Debug.Assert(actionItem != null); // Show properties for binding. m_ActionPropertyView = new InputActionPropertiesView( item.elementProperty, Apply); } } }
void BeginRename() { if (m_Tree != null && m_Tree.HasFocus()) { m_Tree.BeginRename(m_Tree.GetSelectedRow()); } if (m_ActionMapsTree != null && m_ActionMapsTree.HasFocus()) { m_ActionMapsTree.BeginRename(m_ActionMapsTree.GetSelectedRow()); } if (m_ActionsTree != null && m_ActionsTree.HasFocus()) { m_ActionsTree.BeginRename(m_ActionsTree.GetSelectedRow()); } }