public void Dispose()
        {
            texture   = null;
            onClicked = null;
            guiColor  = null;

            var disposing = this;

            Pool.Dispose(ref disposing);
        }
Exemple #2
0
        public void Dispose()
        {
            onClicked                 = null;
            onRightClicked            = null;
            texture                   = null;
            guiColor                  = null;
            overrideCalculatePosition = null;

            var disposing = this;

            Pool.Dispose(ref disposing);
        }
        private void Setup(HeaderPart headerPart, bool drawsSelectionRect, bool drawsMouseoverRect, string tooltip, OnHeaderPartClicked onPartClicked, OnHeaderPartClicked onPartRightClicked, bool isSelectable)
        {
            part = headerPart;
            rect = default(Rect);
            drawSelectionRect = drawsSelectionRect;
            drawMouseoverRect = drawsMouseoverRect;
            onClicked         = onPartClicked;
            onRightClicked    = onPartRightClicked;
            selectable        = isSelectable;

            label.image   = null;
            label.tooltip = tooltip;
        }
Exemple #4
0
        private void Setup(HeaderPart headerPart, bool drawsSelectionRect, bool drawsMouseoverRect, [CanBeNull] Texture drawTexture, string tooltip, [CanBeNull] OnHeaderPartClicked onPartClicked, [CanBeNull] OnHeaderPartClicked onPartRightClicked, bool isSelectable)
        {
            part = headerPart;
            rect = default(Rect);
            drawSelectionRect = drawsSelectionRect;
            drawMouseoverRect = drawsMouseoverRect;
            texture           = drawTexture;
            onClicked         = onPartClicked;
            onRightClicked    = onPartRightClicked;
            selectable        = isSelectable;

            label.image   = drawTexture;
            label.tooltip = tooltip == null ? "" : tooltip;
        }
Exemple #5
0
        private void Setup(HeaderPart headerPart, bool drawsSelectionRect, bool drawsMouseoverRect, string tooltip, [CanBeNull] OnHeaderPartClicked onPartClicked, [CanBeNull] OnHeaderPartClicked onPartRightClicked, bool isSelectable, CalculatePosition setOverrideCalculatePosition)
        {
            part = headerPart;
            rect = default(Rect);
            drawSelectionRect         = drawsSelectionRect;
            drawMouseoverRect         = drawsMouseoverRect;
            onClicked                 = onPartClicked;
            onRightClicked            = onPartRightClicked;
            selectable                = isSelectable;
            overrideCalculatePosition = setOverrideCalculatePosition;

            label.image   = null;
            label.tooltip = tooltip == null ? "" : tooltip;
        }
Exemple #6
0
        public static HeaderPartDrawer Create([NotNull] Texture icon, [NotNull] OnHeaderPartClicked onPartClicked, string tooltip = "", bool selectable = true)
        {
            Debug.Assert(icon != null);
            Debug.Assert(onPartClicked != null);

            HeaderPartDrawer result;

            if (!Pool.TryGet(out result))
            {
                result = new HeaderPartDrawer();
            }

            NthCustomHeaderButton++;
            if (NthCustomHeaderButton >= 10)
            {
                NthCustomHeaderButton = 0;
            }
            var headerPart = (HeaderPart)(NthCustomHeaderButton + ((int)HeaderPart.CustomHeaderButton1));

            result.Setup(headerPart, true, true, icon, tooltip, onPartClicked, onPartClicked, selectable);
            return(result);
        }
Exemple #7
0
        public static HeaderPartDrawer Create(HeaderPart headerPart, bool drawSelectionRect, bool drawMouseoverRect, [CanBeNull] Texture drawTexture, string tooltip, OnHeaderPartClicked onPartClicked, OnHeaderPartClicked onPartRightClicked = null, bool selectable = true)
        {
            HeaderPartDrawer result;

            if (!Pool.TryGet(out result))
            {
                result = new HeaderPartDrawer();
            }
            result.Setup(headerPart, drawSelectionRect, drawMouseoverRect, drawTexture, tooltip, onPartClicked, onPartRightClicked, selectable);
            return(result);
        }
Exemple #8
0
        public static HeaderPartDrawer Create(HeaderPart headerPart, bool drawSelectionRect, bool drawMouseoverRect, string tooltip, OnHeaderPartClicked onPartClicked, OnHeaderPartClicked onPartRightClicked = null, bool selectable = true, CalculatePosition overrideCalculatePosition = null)
        {
            HeaderPartDrawer result;

            if (!Pool.TryGet(out result))
            {
                result = new HeaderPartDrawer();
            }

            result.Setup(headerPart, drawSelectionRect, drawMouseoverRect, tooltip, onPartClicked, onPartRightClicked, selectable, overrideCalculatePosition);
            return(result);
        }