void OnValidateCommandEvent(ValidateCommandEvent evt) { if (!textInputField.hasFocus) { return; } textInputField.SyncTextEngine(); m_Changed = false; switch (evt.commandName) { case EventCommandNames.Cut: if (!editorEngine.hasSelection || textInputField.isReadOnly) { return; } break; case EventCommandNames.Copy: if (!editorEngine.hasSelection) { return; } break; case EventCommandNames.Paste: if (!editorEngine.CanPaste() || textInputField.isReadOnly) { return; } break; case EventCommandNames.SelectAll: break; case EventCommandNames.Delete: if (textInputField.isReadOnly) { return; } break; case EventCommandNames.UndoRedoPerformed: // TODO: ????? editor.text = text; --> see EditorGUI's DoTextField break; } evt.StopPropagation(); }
void OnValidateCommandEvent(ValidateCommandEvent evt) { if (!textElement.edition.hasFocus) { return; } m_Changed = false; switch (evt.commandName) { // Handled in TextSelectingManipulator case EventCommandNames.Copy: case EventCommandNames.SelectAll: return; case EventCommandNames.Cut: if (!textElement.selection.HasSelection()) { return; } break; case EventCommandNames.Paste: if (!editingUtilities.CanPaste()) { return; } break; case EventCommandNames.Delete: break; case EventCommandNames.UndoRedoPerformed: // TODO: ????? editor.text = text; --> see EditorGUI's DoTextField break; } evt.StopPropagation(); }
private void OnValidateCommandEvent(ValidateCommandEvent evt) { bool flag = !base.textInputField.hasFocus; if (!flag) { base.textInputField.SyncTextEngine(); this.m_Changed = false; string commandName = evt.commandName; string text = commandName; if (text != null) { if (!(text == "Cut")) { if (!(text == "Copy")) { if (!(text == "Paste")) { if (!(text == "SelectAll")) { if (!(text == "Delete")) { if (!(text == "UndoRedoPerformed")) { } } else { bool isReadOnly = base.textInputField.isReadOnly; if (isReadOnly) { return; } } } } else { bool flag2 = !base.editorEngine.CanPaste() || base.textInputField.isReadOnly; if (flag2) { return; } } } else { bool flag3 = !base.editorEngine.hasSelection; if (flag3) { return; } } } else { bool flag4 = !base.editorEngine.hasSelection || base.textInputField.isReadOnly; if (flag4) { return; } } } evt.StopPropagation(); } }