DrawPrefixLabel() 개인적인 메소드

private DrawPrefixLabel ( Rect position, GUIContent content, int controlID ) : void
position Rect
content GUIContent
controlID int
리턴 void
예제 #1
0
 internal static void HandlePrefixLabelInternal(Rect totalPosition, Rect labelPosition, GUIContent label, int id, GUIStyle style)
 {
   if (id == 0 && label != null)
   {
     EditorGUI.s_PrefixLabel.text = label.text;
     EditorGUI.s_PrefixLabel.image = label.image;
     EditorGUI.s_PrefixLabel.tooltip = label.tooltip;
     EditorGUI.s_PrefixTotalRect = totalPosition;
     EditorGUI.s_PrefixRect = labelPosition;
     EditorGUI.s_PrefixStyle = style;
   }
   else
   {
     if (Highlighter.searchMode == HighlightSearchMode.PrefixLabel || Highlighter.searchMode == HighlightSearchMode.Auto)
       Highlighter.Handle(totalPosition, label.text);
     switch (Event.current.type)
     {
       case EventType.MouseDown:
         if (Event.current.button == 0 && labelPosition.Contains(Event.current.mousePosition))
         {
           if (EditorGUIUtility.CanHaveKeyboardFocus(id))
             GUIUtility.keyboardControl = id;
           EditorGUIUtility.editingTextField = false;
           HandleUtility.Repaint();
           break;
         }
         break;
       case EventType.Repaint:
         ++labelPosition.width;
         style.DrawPrefixLabel(labelPosition, label, id);
         break;
     }
     EditorGUI.s_PrefixLabel.text = (string) null;
   }
 }
예제 #2
0
		internal static void HandlePrefixLabelInternal(Rect totalPosition, Rect labelPosition, GUIContent label, int id, GUIStyle style)
		{
			if (id == 0 && label != null)
			{
				EditorGUI.s_PrefixLabel.text = label.text;
				EditorGUI.s_PrefixLabel.image = label.image;
				EditorGUI.s_PrefixLabel.tooltip = label.tooltip;
				EditorGUI.s_PrefixTotalRect = totalPosition;
				EditorGUI.s_PrefixRect = labelPosition;
				EditorGUI.s_PrefixStyle = style;
				return;
			}
			if (Highlighter.searchMode == HighlightSearchMode.PrefixLabel || Highlighter.searchMode == HighlightSearchMode.Auto)
			{
				Highlighter.Handle(totalPosition, label.text);
			}
			EventType type = Event.current.type;
			if (type != EventType.MouseDown)
			{
				if (type == EventType.Repaint)
				{
					labelPosition.width += 1f;
					style.DrawPrefixLabel(labelPosition, label, id);
				}
			}
			else
			{
				if (Event.current.button == 0 && labelPosition.Contains(Event.current.mousePosition))
				{
					if (EditorGUIUtility.CanHaveKeyboardFocus(id))
					{
						GUIUtility.keyboardControl = id;
					}
					EditorGUIUtility.editingTextField = false;
					HandleUtility.Repaint();
				}
			}
			EditorGUI.s_PrefixLabel.text = null;
		}