예제 #1
0
 private void OnRender(object sender, double timeDelta)
 {
     GLDraw.FillRect(ref outerBox, ref skin.BorderColor);
     GLDraw.FillRect(ref innerBox, ref skin.BackgroundColor);
     if (_checked)
     {
         GLDraw.FillRect(new Rectangle(innerBox.X + skin.Border.Left, innerBox.Y + skin.Border.Top,
                                       innerBox.Width - skin.Border.Horizontal, innerBox.Height - skin.Border.Vertical), ref skin.BorderColor);
     }
     GLDraw.Text(textProcessed, Inner, ref skin.Color);
 }
예제 #2
0
파일: GLTextBox.cs 프로젝트: rainrcn/GLGUI
        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;
                }
            }
        }
예제 #3
0
파일: GLSlider.cs 프로젝트: rainrcn/GLGUI
 private void OnRender(object sender, double timeDelta)
 {
     GLDraw.Fill(ref skin.BackgroundColor);
     GLDraw.FillRect(Inner, ref skin.KnobColor);
 }
예제 #4
0
 private void OnRender(object sender, double timeDelta)
 {
     GLDraw.FillRect(ref splitterRect, ref skin.BackgroundColor);
 }
예제 #5
0
파일: GLForm.cs 프로젝트: rainrcn/GLGUI
 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);
 }
예제 #6
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);
 }
예제 #7
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 : /
 }
예제 #8
0
 private void OnRender(object sender, double timeDelta)
 {
     GLDraw.Fill(ref skin.BorderColor);
     GLDraw.FillRect(ref background, ref skin.BackgroundColor);
 }