示例#1
0
        public override void Draw()
        {
            if (state != WindowState.minimized)
            {
                DrawWindow();

                for (int xx = 0; xx < xCount; xx++)
                {
                    for (int yy = 0; yy < yCount; yy++)
                    {
                        int i = xx + (yy * xCount);
                        if (output[i] != null)
                        {
                            int dx = x + 8 + (xx * (Fonts.FONT_MONO.characterWidth + Graphics2D.FONT_SPACING));
                            int dy = y + 28 + (yy * (Fonts.FONT_MONO.characterHeight + 1));
                            Graphics2D.DrawChar(dx, dy, output[i].character, output[i].foreColor, Fonts.FONT_MONO);
                        }
                    }
                }

                if (cursor)
                {
                    int cx = x + 8, cy = y + 28;
                    if (cursorX > 0)
                    {
                        cx = x + 8 + (cursorX * (Fonts.FONT_MONO.characterWidth + Graphics2D.FONT_SPACING));
                    }
                    if (cursorY > 0)
                    {
                        cy = y + 28 + (cursorY * (Fonts.FONT_MONO.characterHeight + 1));
                    }
                    Graphics2D.DrawChar(cx, cy, '_', Color.white, Fonts.FONT_MONO);
                }
            }
        }
示例#2
0
        public override void Draw()
        {
            // get style colors
            uint bg = style.C_BG;
            uint fg = style.C_TEXT;
            uint bord = style.C_BORDER;
            uint bordOuter = style.C_BORDER_OUTER;
            uint bordInner = style.C_BORDER_INNER;
            uint fgShadow = style.C_TEXT_SHADOW;
            uint fgHover = style.C_TEXT_HOVER;
            uint fgDown = style.C_TEXT_DOWN;
            uint dis = style.C_DISABLED;
            uint shadow = style.C_SHADOW;
            uint hov = style.C_HOVER;
            uint dwn = style.C_DOWN;

            // get style sizes
            int bordSize = style.SIZE_BORDER;
            int shadowSize = style.SIZE_SHADOW;
            int fgShadowSize = style.SIZE_TEXT_SHADOW;
            int borderStyle = style.BORDER_STYLE;

            // draw bg
            Graphics2D.FillRectangle(bounds, bg);

            // draw border
            Graphics2D.DrawRectangle(bounds, bordSize, bord);

            // text
            if (text.Length > 0)
            {
                if (!passwordFilter) { Graphics2D.DrawString(x + 4, y + (height / 2) - 4, text, fg, Fonts.FONT_MONO); }
                else
                {
                    int sx = x + 4;
                    for (int i = 0; i < text.Length; i++)
                    {
                        Graphics2D.DrawChar(sx, y + (height / 2) - 4, '*', fg, Fonts.FONT_MONO);
                        sx += Fonts.FONT_MONO.characterWidth + Graphics2D.FONT_SPACING;
                    }
                }
            }

            if (cursor)
            {
                int xadd = textW;
                if (text.Length == 0) { xadd = 2; }
                Graphics2D.DrawChar(x + xadd + 2, y + (height / 2) - 4, '|', fg, Fonts.FONT_MONO);
            }
        }
示例#3
0
        public override void Draw()
        {
            // draw bg
            Graphics2D.FillRectangle(bounds, Color.gray32);

            // draw input indicator
            tick++;
            if (tick > 40)
            {
                if (!MSPS2.moving && KBPS2.currentKey == null)
                {
                    inCol = Color.white;
                }
                tick = 0;
            }

            if (MSPS2.moving && KBPS2.currentKey == null)
            {
                inCol = Color.orange;
            }
            if (!MSPS2.moving && KBPS2.currentKey != null)
            {
                inCol = Color.limeGreen;
            }
            if (MSPS2.moving && KBPS2.currentKey != null)
            {
                inCol = Color.teal;
            }

            Graphics2D.DrawChar(width - 84, 7, '!', inCol, Fonts.FONT_SYMBOLS);

            // draw running apps
            int xx = 26, yy = 2, ww = 76, hh = 18;

            for (int i = 0; i < ProcessManager.windows.Count; i++)
            {
                Window proc = ProcessManager.windows[i];

                int tw = Fonts.FONT_MONO.StringWidth(proc.name) + 16;
                if (ww < tw)
                {
                    ww = tw;
                }
                Rectangle btn = new Rectangle(xx, yy, ww, hh);
                uint      ic  = Color.silver;

                if (btn.Contains(MSPS2.position))
                {
                    ic = Color.darkOrange;
                    if (MSPS2.state == Cosmos.System.MouseState.Left && proc.minimizeBox)
                    {
                        if (!btnClick)
                        {
                            if (ProcessManager.selWindowID != proc.id)
                            {
                                ProcessManager.selWindowID = proc.id;
                            }
                            else
                            {
                                if (proc.state != WindowState.minimized)
                                {
                                    proc.SetState(WindowState.minimized);
                                }
                                else
                                {
                                    proc.SetState(proc.prevState);
                                }
                            }

                            btnClick = true;
                        }
                        ic = Color.brown;
                    }
                }
                if (MSPS2.state == Cosmos.System.MouseState.None)
                {
                    btnClick = false;
                }
                // draw btn
                Graphics2D.DrawRectangle(btn, 1, ic);

                string txt = ProcessManager.windows[i].title;
                if (txt.Length > 9)
                {
                    txt = txt.Substring(0, 7) + "..";
                }

                Graphics2D.DrawString(xx + 8, yy + 4, ProcessManager.windows[i].title, ic, Fonts.FONT_MONO);

                // inc pos
                xx += ww + 4;
            }
        }