static private Internal_DisplayPopupMenu ( |
||
position | ||
menuItemPath | string | |
context | Object | |
contextUserData | int | |
return | void |
public static void DisplayPopupMenu(Rect position, string menuItemPath, MenuCommand command) { if (menuItemPath == "CONTEXT" || menuItemPath == "CONTEXT/" || menuItemPath == "CONTEXT\\") { bool flag = false; if (command == null) { flag = true; } if (command != null && command.context == null) { flag = true; } if (flag) { Debug.LogError("DisplayPopupMenu: invalid arguments: using CONTEXT requires a valid MenuCommand object. If you want a custom context menu then try using the GenericMenu."); return; } } Vector2 vector = GUIUtility.GUIToScreenPoint(new Vector2(position.x, position.y)); position.x = vector.x; position.y = vector.y; EditorUtility.Internal_DisplayPopupMenu(position, menuItemPath, (command != null) ? command.context : null, (command != null) ? command.userData : 0); EditorUtility.ResetMouseDown(); }
private void DoLayoutDropDown(Rect rect) { if (EditorGUI.DropdownButton(rect, GUIContent.Temp(Toolbar.lastLoadedLayoutName), FocusType.Passive, "DropDown")) { Vector2 vector = GUIUtility.GUIToScreenPoint(new Vector2(rect.x, rect.y)); rect.x = vector.x; rect.y = vector.y; EditorUtility.Internal_DisplayPopupMenu(rect, "Window/Layouts", this, 0); } }
void DoLayoutDropDown(Rect rect) { // Layout DropDown if (EditorGUI.DropdownButton(rect, GUIContent.Temp(lastLoadedLayoutName), FocusType.Passive, Styles.dropdown)) { Vector2 temp = GUIUtility.GUIToScreenPoint(new Vector2(rect.x, rect.y)); rect.x = temp.x; rect.y = temp.y; EditorUtility.Internal_DisplayPopupMenu(rect, "Window/Layouts", this, 0); } }
private void DoLayoutDropDown(Rect rect) { if (!EditorGUI.ButtonMouseDown(rect, GUIContent.Temp(Toolbar.lastLoadedLayoutName), FocusType.Passive, (GUIStyle)"DropDown")) { return; } Vector2 screenPoint = GUIUtility.GUIToScreenPoint(new Vector2(rect.x, rect.y)); rect.x = screenPoint.x; rect.y = screenPoint.y; EditorUtility.Internal_DisplayPopupMenu(rect, "Window/Layouts", (Object)this, 0); }
private void DoLayoutDropDown() { Rect rect = GUILayoutUtility.GetRect(Toolbar.s_LayerContent, "DropDown"); if (EditorGUI.ButtonMouseDown(rect, GUIContent.Temp(Toolbar.lastLoadedLayoutName), FocusType.Passive, "DropDown")) { Vector2 vector = GUIUtility.GUIToScreenPoint(new Vector2(rect.x, rect.y)); rect.x = vector.x; rect.y = vector.y; EditorUtility.Internal_DisplayPopupMenu(rect, "Window/Layouts", this, 0); } GUILayout.EndHorizontal(); }