Example #1
0
        private void OnRender(object sender, double timeDelta)
        {
            caretBlinkTimer += timeDelta;

            GLDraw.Fill(ref skin.BorderColor);
            GLDraw.FillRect(ref background, ref skin.BackgroundColor);

            if (selectionStart.Index != cursorPosition.Index)
            {
                var start = selectionStart.Index < cursorPosition.Index ? selectionStart : cursorPosition;
                var end   = selectionStart.Index < cursorPosition.Index ? cursorPosition : selectionStart;
                if (Math.Abs(selectionStart.Position.Y - cursorPosition.Position.Y) < 0.0001f)
                {
                    GLDraw.FillRect(
                        new Rectangle(
                            Inner.X + (int)start.Position.X,
                            Inner.Y + (int)start.Position.Y,
                            (int)(end.Position.X - start.Position.X),
                            (int)skin.Font.LineSpacing),
                        ref skin.SelectionColor);
                }
                else
                {
                    int y    = Inner.Y + (int)start.Position.Y;
                    int ymax = Inner.Y + (int)end.Position.Y;
                    GLDraw.FillRect(new Rectangle(Inner.X + (int)start.Position.X, y, Inner.Width - (int)start.Position.X, (int)skin.Font.LineSpacing), ref skin.SelectionColor);
                    y += (int)skin.Font.LineSpacing;
                    GLDraw.FillRect(new Rectangle(Inner.X, y, InnerWidth, ymax - y), ref skin.SelectionColor);
                    GLDraw.FillRect(new Rectangle(Inner.X, ymax, (int)end.Position.X, (int)skin.Font.LineSpacing), ref skin.SelectionColor);
                }
            }

            GLDraw.Text(textProcessed, Inner, ref skin.Color);

            if (enabled)
            {
                if (HasFocus && caretBlinkTimer < caretBlinkInterval)
                {
                    GLDraw.FillRect(
                        new Rectangle(
                            Inner.X + (int)cursorPosition.Position.X,
                            Inner.Y + (int)cursorPosition.Position.Y,
                            1, (int)skin.Font.LineSpacing), ref skin.Color);
                }
                else if (caretBlinkTimer > caretBlinkInterval * 2.0)
                {
                    caretBlinkTimer -= caretBlinkInterval * 2.0;
                }
            }
        }
Example #2
0
 private void OnRender(object sender, double timeDelta)
 {
     GLDraw.Fill(ref skin.BackgroundColor);
     GLDraw.FillRect(Inner, ref skin.KnobColor);
 }
Example #3
0
 private void OnRender(object sender, double timeDelta)
 {
     GLDraw.Fill(ref skin.BorderColor);
     GLDraw.FillRect(Inner, ref skin.BackgroundColor);
     GLDraw.Text(titleProcessed, ref moveClickRegion, ref skin.Color);
 }
Example #4
0
 private void OnRender(object sender, double timeDelta)
 {
     GLDraw.Fill(ref skin.BorderColor);
     GLDraw.FillRect(Inner, ref skin.BackgroundColor);
     GLDraw.Text(textProcessed, Inner, ref skin.Color);
 }
Example #5
0
 private void OnRender(object sender, double timeDelta)
 {
     GLDraw.Fill(ref skin.BackgroundColor);
     GLDraw.Text(textProcessed, Inner, ref skin.Color);
     //GLDraw.Line(Inner.Left, Inner.Bottom, Inner.Right, Inner.Bottom, ref skin.Color); // very ugly on windows : /
 }
Example #6
0
 private void OnRender(object sender, double timeDelta)
 {
     GLDraw.Fill(ref skin.BorderColor);
     GLDraw.FillRect(ref background, ref skin.BackgroundColor);
 }