private void Init(Rect activatorRect, PopupWindowContent windowContent, PopupLocationHelper.PopupLocation[] locationPriorityOrder) { this.m_WindowContent = windowContent; this.m_WindowContent.editorWindow = (EditorWindow)this; this.m_ActivatorRect = GUIUtility.GUIToScreenRect(activatorRect); this.m_LastWantedSize = windowContent.GetWindowSize(); this.m_LocationPriorityOrder = locationPriorityOrder; Vector2 vector2 = windowContent.GetWindowSize() + new Vector2(this.m_BorderWidth * 2f, this.m_BorderWidth * 2f); this.position = PopupLocationHelper.GetDropDownRect(this.m_ActivatorRect, vector2, vector2, (ContainerWindow)null, this.m_LocationPriorityOrder); this.ShowPopup(); this.Repaint(); }
private void FitWindowToContent() { Vector2 wantedSize = m_WindowContent.GetWindowSize(); if (m_LastWantedSize != wantedSize) { m_LastWantedSize = wantedSize; Vector2 windowSize = wantedSize + new Vector2(2 * m_BorderWidth, 2 * m_BorderWidth); Rect screenRect = PopupLocationHelper.GetDropDownRect(m_ActivatorRect, windowSize, windowSize, null, m_LocationPriorityOrder); m_Pos = screenRect; minSize = maxSize = new Vector2(screenRect.width, screenRect.height); } }
void Init(Rect activatorRect, PopupWindowContent windowContent, PopupLocationHelper.PopupLocation[] locationPriorityOrder) { m_WindowContent = windowContent; m_WindowContent.editorWindow = this; m_ActivatorRect = GUIUtility.GUIToScreenRect(activatorRect); m_LastWantedSize = windowContent.GetWindowSize(); m_LocationPriorityOrder = locationPriorityOrder; Vector2 windowSize = windowContent.GetWindowSize() + new Vector2(m_BorderWidth * 2, m_BorderWidth * 2); position = PopupLocationHelper.GetDropDownRect(m_ActivatorRect, windowSize, windowSize, null, m_LocationPriorityOrder); ShowPopup(); Repaint(); }
private void FitWindowToContent() { Vector2 windowSize = this.m_WindowContent.GetWindowSize(); if (this.m_LastWantedSize != windowSize) { this.m_LastWantedSize = windowSize; Vector2 vector = windowSize + new Vector2(2f * this.m_BorderWidth, 2f * this.m_BorderWidth); Rect dropDownRect = PopupLocationHelper.GetDropDownRect(this.m_ActivatorRect, vector, vector, null, this.m_LocationPriorityOrder); this.m_Pos = dropDownRect; Vector2 vector2 = new Vector2(dropDownRect.width, dropDownRect.height); base.maxSize = vector2; base.minSize = vector2; } }
internal Rect GetDropDownRect(Rect buttonRect, Vector2 minSize, Vector2 maxSize) { return(PopupLocationHelper.GetDropDownRect(buttonRect, minSize, maxSize, this)); }
internal Rect GetDropDownRect(Rect buttonRect, Vector2 minSize, Vector2 maxSize, PopupLocation[] locationPriorityOrder) { return(PopupLocationHelper.GetDropDownRect(buttonRect, minSize, maxSize, this, locationPriorityOrder)); }
public static Rect GetDropDownRect(Rect buttonRect, Vector2 minSize, Vector2 maxSize, ContainerWindow popupContainerWindow) { return(PopupLocationHelper.GetDropDownRect(buttonRect, minSize, maxSize, popupContainerWindow, null)); }