UpdateSuspendedString() public method

public UpdateSuspendedString ( bool force ) : void
force bool
return void
示例#1
0
        protected override void DrawIconAndLabel(Rect rect, TreeViewItem item, string label, bool selected, bool focused, bool useBoldFont, bool isPinging)
        {
            if (!isPinging)
            {
                float contentIndent = this.GetContentIndent(item);
                rect.x     += contentIndent;
                rect.width -= contentIndent;
            }
            AudioMixerItem item2 = item as AudioMixerItem;

            if (item2 != null)
            {
                GUIStyle style = !useBoldFont ? TreeViewGUI.s_Styles.lineStyle : TreeViewGUI.s_Styles.lineBoldStyle;
                style.padding.left = (int)((base.k_IconWidth + base.iconTotalPadding) + base.k_SpaceBetweenIconAndText);
                style.Draw(rect, label, false, false, selected, focused);
                item2.UpdateSuspendedString(false);
                if (item2.labelWidth <= 0f)
                {
                    item2.labelWidth = style.CalcSize(GUIContent.Temp(label)).x;
                }
                Rect position = rect;
                position.x += item2.labelWidth + 8f;
                EditorGUI.BeginDisabledGroup(true);
                style.Draw(position, item2.infoText, false, false, false, false);
                EditorGUI.EndDisabledGroup();
                if (base.iconOverlayGUI != null)
                {
                    Rect rect3 = rect;
                    rect3.width = base.k_IconWidth + base.iconTotalPadding;
                    base.iconOverlayGUI(item, rect3);
                }
            }
        }
        protected override void OnContentGUI(Rect rect, int row, TreeViewItem item, string label, bool selected, bool focused, bool useBoldFont, bool isPinging)
        {
            if (Event.current.type != EventType.Repaint)
            {
                return;
            }

            if (!isPinging)
            {
                // The rect is assumed indented and sized after the content when pinging
                float indent = GetContentIndent(item);
                rect.x     += indent;
                rect.width -= indent;
            }

            AudioMixerItem mixerItem = item as AudioMixerItem;

            if (mixerItem == null)
            {
                return;
            }

            GUIStyle lineStyle = useBoldFont ? Styles.lineBoldStyle : Styles.lineStyle;

            // Draw text
            lineStyle.padding.left = (int)(k_IconWidth + iconTotalPadding + k_SpaceBetweenIconAndText);
            lineStyle.Draw(rect, label, false, false, selected, focused);

            // Draw info text
            mixerItem.UpdateSuspendedString(false);
            const float minSpaceBetween = 8f;

            if (mixerItem.labelWidth <= 0)
            {
                mixerItem.labelWidth = lineStyle.CalcSize(GUIContent.Temp(label)).x;   // only calc once
            }
            Rect infoRect = rect;

            infoRect.x += mixerItem.labelWidth + minSpaceBetween;
            using (new EditorGUI.DisabledScope(true))
            {
                lineStyle.Draw(infoRect, mixerItem.infoText, false, false, false, false);
            }

            // TODO Icon overlay (RCS)
            if (iconOverlayGUI != null)
            {
                Rect iconOverlayRect = rect;
                iconOverlayRect.width = k_IconWidth + iconTotalPadding;
                iconOverlayGUI(item, iconOverlayRect);
            }
        }
        protected override void DrawIconAndLabel(Rect rect, TreeViewItem item, string label, bool selected, bool focused, bool useBoldFont, bool isPinging)
        {
            if (!isPinging)
            {
                float contentIndent = this.GetContentIndent(item);
                rect.x     += contentIndent;
                rect.width -= contentIndent;
            }
            AudioMixerItem audioMixerItem = item as AudioMixerItem;

            if (audioMixerItem == null)
            {
                return;
            }
            GUIStyle guiStyle = !useBoldFont ? TreeViewGUI.s_Styles.lineStyle : TreeViewGUI.s_Styles.lineBoldStyle;

            guiStyle.padding.left = (int)((double)this.k_IconWidth + (double)this.iconTotalPadding + (double)this.k_SpaceBetweenIconAndText);
            guiStyle.Draw(rect, label, false, false, selected, focused);
            audioMixerItem.UpdateSuspendedString(false);
            if ((double)audioMixerItem.labelWidth <= 0.0)
            {
                audioMixerItem.labelWidth = guiStyle.CalcSize(GUIContent.Temp(label)).x;
            }
            Rect position = rect;

            position.x += audioMixerItem.labelWidth + 8f;
            EditorGUI.BeginDisabledGroup(true);
            guiStyle.Draw(position, audioMixerItem.infoText, false, false, false, false);
            EditorGUI.EndDisabledGroup();
            if (this.iconOverlayGUI == null)
            {
                return;
            }
            Rect rect1 = rect;

            rect1.width = this.k_IconWidth + this.iconTotalPadding;
            this.iconOverlayGUI(item, rect1);
        }
        protected override void DrawIconAndLabel(Rect rect, TreeViewItem item, string label, bool selected, bool focused, bool useBoldFont, bool isPinging)
        {
            if (!isPinging)
            {
                float contentIndent = this.GetContentIndent(item);
                rect.x     += contentIndent;
                rect.width -= contentIndent;
            }
            AudioMixerItem audioMixerItem = item as AudioMixerItem;

            if (audioMixerItem == null)
            {
                return;
            }
            GUIStyle gUIStyle = (!useBoldFont) ? TreeViewGUI.s_Styles.lineStyle : TreeViewGUI.s_Styles.lineBoldStyle;

            gUIStyle.padding.left = (int)(this.k_IconWidth + base.iconTotalPadding + this.k_SpaceBetweenIconAndText);
            gUIStyle.Draw(rect, label, false, false, selected, focused);
            audioMixerItem.UpdateSuspendedString(false);
            if (audioMixerItem.labelWidth <= 0f)
            {
                audioMixerItem.labelWidth = gUIStyle.CalcSize(GUIContent.Temp(label)).x;
            }
            Rect position = rect;

            position.x += audioMixerItem.labelWidth + 8f;
            using (new EditorGUI.DisabledScope(true))
            {
                gUIStyle.Draw(position, audioMixerItem.infoText, false, false, false, false);
            }
            if (base.iconOverlayGUI != null)
            {
                Rect arg = rect;
                arg.width = this.k_IconWidth + base.iconTotalPadding;
                base.iconOverlayGUI(item, arg);
            }
        }