Ejemplo n.º 1
0
 public void Init(bool clip)
 {
     UseClipping = clip;
     First       = Last = null;
     Count       = 0;
 }
Ejemplo n.º 2
0
 public void Reset()
 {
     First = Last = null;
     Count = 0;
     Clip  = RectangleF.Null;
 }
Ejemplo n.º 3
0
        public void nk_build()
        {
            if (style.cursor_active == null)
            {
                style.cursor_active = style.cursors[NK_CURSOR_ARROW];
            }
            if (style.cursor_active != null && input.mouse.grabbed == 0 && style.cursor_visible != 0)
            {
                var mouse_bounds = new RectangleF();
                var cursor       = style.cursor_active;
                overlay.Init(false);
                nk_start_buffer(overlay);
                mouse_bounds.X      = input.mouse.pos.X - cursor.offset.X;
                mouse_bounds.Y      = input.mouse.pos.Y - cursor.offset.Y;
                mouse_bounds.Width  = cursor.size.X;
                mouse_bounds.Height = cursor.size.Y;
                overlay.DrawImage(mouse_bounds, cursor.img, nk_white);
            }

            var         node = Windows.First;
            CommandBase cmd  = null;

            for (; node != null;)
            {
                var next = node.Next;
                var it   = node.Value;
                if ((it.Flags & NK_WINDOW_HIDDEN) != 0 || it.Seq != seq)
                {
                    goto cont;
                }
                cmd = it.Buffer.Last;

                while (next != null &&
                       (next.Value.Buffer == null || next.Value.Buffer.Count == 0 ||
                        (next.Value.Flags & NK_WINDOW_HIDDEN) != 0))
                {
                    next = next.Next;
                }

                if (next != null)
                {
                    cmd.Next = next.Value.Buffer.First;
                }
cont:
                node = next;
            }

            node = Windows.First;

            while (node != null)
            {
                var next = node.Next;
                var it   = node.Value;
                if (it.Popup.Buffer.Buffer.Count == 0)
                {
                    goto skip;
                }

                var buf = it.Popup.Buffer.Buffer;
                cmd.Next = buf.First;
                cmd      = buf.Last;

                it.Popup.Buffer.Buffer.Count = 0;

skip:
                node = next;
            }

            if (cmd != null)
            {
                cmd.Next = overlay.Count > 0 ? overlay.First : null;
            }
        }