Esempio n. 1
0
 public CMDFramePalette(CMDPaletteItem window, CMDPaletteItem text,
                        CMDFrameButtonPalette closeButton)
 {
     WindowColor      = window;
     TextColor        = text;
     CloseButtonColor = closeButton;
 }
Esempio n. 2
0
 public CMDFramePalette(CMDPaletteItem window, CMDPaletteItem text, 
     CMDFrameButtonPalette closeButton)
 {
     WindowColor = window;
     TextColor = text;
     CloseButtonColor = closeButton;
 }
Esempio n. 3
0
 public CMDWindowPalette(CMDPaletteItem window, CMDPaletteItem text,
                         CMDFrameButtonPalette closeButton, CMDFrameButtonPalette minimizeButton,
                         CMDFrameButtonPalette maximizeButton)
     : base(window, text, closeButton)
 {
     MinimizeButtonColor = minimizeButton;
     MaximizeButtonColor = maximizeButton;
 }
Esempio n. 4
0
        /// <summary>
        /// Draw a maximize button for a window
        /// </summary>
        /// <param name="palette"></param>
        /// <param name="location"></param>
        public static void DrawMaximizeButton(CMDFrameButtonPalette palette, Point location)
        {
            Console.BackgroundColor = palette.SiteColor.Background;
            Console.ForegroundColor = palette.SiteColor.Foreground;

            Console.SetCursorPosition(location.X, location.Y);
            Console.Write("[");
            Console.SetCursorPosition(location.X + 2, location.Y);
            Console.Write("]");

            Console.BackgroundColor = palette.ContentColor.Background;
            Console.ForegroundColor = palette.ContentColor.Foreground;

            Console.SetCursorPosition(location.X + 1, location.Y);
            Console.Write("■");
        }
Esempio n. 5
0
        /// <summary>
        /// Draw a text line with a mnemonic
        /// </summary>
        /// <param name="palette"></param>
        /// <param name="align"></param>
        /// <param name="text"></param>
        /// <param name="location"></param>
        /// <param name="width"></param>
        /*public static void DrawText(CMDMnemonicPalette palette, TextAlignment align, String text, Point location, int width)
        {
            Console.ForegroundColor = palette.MainColor.Foreground;
            Console.BackgroundColor = palette.MainColor.Background;

            int x = 0;

            switch (align)
            {
                case TextAlignment.TopLeft:
                    x = location.X;
                    break;
                case TextAlignment.Center:
                    x = location.X + (width / 2) - (text.Length / 2);
                    break;
                case TextAlignment.BottomRight:
                    x = location.X + width - text.Length;
                    break;
                default:
                    throw new NotImplementedException();
            }

            Console.CursorLeft = x;
            Console.CursorTop = location.Y;

            foreach (char c in text)
            {
                if (c == '&')
                {
                    Console.BackgroundColor = palette.MnemonicColor.Background;
                    Console.ForegroundColor = palette.MnemonicColor.Foreground;
                }
                else
                {
                    Console.Write(c);

                    if ((Console.BackgroundColor != palette.MainColor.Background) ||
                        (Console.ForegroundColor != palette.MainColor.Foreground))
                    {
                        Console.BackgroundColor = palette.MainColor.Background;
                        Console.ForegroundColor = palette.MainColor.Foreground;
                    }
                }
            }
        }*/
        /// <summary>
        /// Draw a text line
        /// </summary>
        /// <param name="palette"></param>
        /// <param name="align"></param>
        /// <param name="text"></param>
        /// <param name="location"></param>
        /// <param name="width"></param>
        /*public static void DrawText(CMDPaletteItem palette, TextAlignment align, String text, Point location, int width)
        {
            DrawText(new CMDMnemonicPalette(palette, palette), align, text, location, width);
        }*/
        /// <summary>
        /// Draw a close button for a window
        /// </summary>
        /// <param name="palette"></param>
        /// <param name="location"></param>
        public static void DrawCloseButton(CMDFrameButtonPalette palette, Point location)
        {
            Console.BackgroundColor = palette.SiteColor.Background;
            Console.ForegroundColor = palette.SiteColor.Foreground;

            Console.SetCursorPosition(location.X, location.Y);
            Console.Write("[");
            Console.SetCursorPosition(location.X + 2, location.Y);
            Console.Write("]");

            Console.BackgroundColor = palette.ContentColor.Background;
            Console.ForegroundColor = palette.ContentColor.Foreground;

            Console.SetCursorPosition(location.X + 1, location.Y);
            Console.Write("X");
        }
Esempio n. 6
0
 public CMDWindowPalette(CMDPaletteItem window, CMDPaletteItem text, 
     CMDFrameButtonPalette closeButton, CMDFrameButtonPalette minimizeButton,
     CMDFrameButtonPalette maximizeButton)
     : base(window, text, closeButton)
 {
     MinimizeButtonColor = minimizeButton;
     MaximizeButtonColor = maximizeButton;
 }