상속: MonoBehaviour
 void Reset()
 {
     if (paintbrush == null)
     {
         paintbrush = GetComponentInParent <Paintbrush>();
     }
 }
예제 #2
0
        public WinClassicTerminal(bool readOnly)
        {
            InitializeComponent();

            // Paint the classic borders
            btnCopy.Paint     += (sender, args) => Paintbrush.PaintClassicBorders(sender, args, 2);
            btnFont.Paint     += (sender, args) => Paintbrush.PaintClassicBorders(sender, args, 2);
            btnMark.Paint     += (sender, args) => Paintbrush.PaintClassicBorders(sender, args, 2);
            btnNothing.Paint  += (sender, args) => Paintbrush.PaintClassicBorders(sender, args, 2);
            btnPaste.Paint    += (sender, args) => Paintbrush.PaintClassicBorders(sender, args, 2);
            btnSettings.Paint += (sender, args) => Paintbrush.PaintClassicBorders(sender, args, 2);
            sizeSel.Paint     += (sender, args) => Paintbrush.PaintClassicBorders(sender, args, 2);

            // Set the default index to "Auto"
            sizeSel.SelectedIndex = 0;

            // Set the font and append the prefix text
            cmdPrompt.Font = new Font(TitleScreen.pfc.Families[1], 12F, FontStyle.Regular);

            cmdPrompt.BringToFront();

            if (readOnly)
            {
                actionPanel.Hide();
                cmdPrompt.ReadOnly = true;
            }
            else
            {
                cmdPrompt.AppendText("\nMicrosoft<R> Windows 95\n   <C>Copyright Microsoft Corp 1981-1995.\n\n");
                cmdPrompt.AppendText(prefix);
            }
        }
        public WinClassicTimeDistorter(string currentYear, string yearToTravel, int counter, Action action = null)
        {
            InitializeComponent();

            btnGo.Paint     += (sender, args) => Paintbrush.PaintClassicBorders(sender, args, 2);
            lblYear.Text     = currentYear;
            lblDestYear.Text = yearToTravel;
            _action          = action;
            _counter         = counter;
        }
예제 #4
0
        private void taskbar_Paint(object sender, PaintEventArgs e)
        {
            var gfx = e.Graphics;

            gfx.Clear(currentTheme.threeDObjectsColor);

            var _lightBack = Paintbrush.GetLightFromColor(currentTheme.threeDObjectsColor);

            gfx.DrawLine(new Pen(_lightBack), 0, 1, taskbar.Width, 1);
        }
예제 #5
0
    public void EquipBrush(Paintbrush brushToEquip)
    {
        if (equippedBrush != null)
        {
            Destroy(equippedBrush.gameObject);
        }

        equippedBrush = Instantiate(brushToEquip, brushHold.position, brushHold.rotation) as Paintbrush;
        equippedBrush.transform.parent = brushHold;
    }
예제 #6
0
        private void left_Paint(object sender, PaintEventArgs e)
        {
            var gfx = e.Graphics;

            gfx.Clear(SaveSystem.currentTheme.threeDObjectsColor);

            var _lightBack = Paintbrush.GetLightFromColor(SaveSystem.currentTheme.threeDObjectsColor);

            gfx.DrawLine(new Pen(_lightBack), 1, 0, 1, left.Height);
        }
예제 #7
0
        public TitleScreen()
        {
            InitializeComponent();
            this.startmenu.Paint += (sender, args) => Paintbrush.PaintClassicBorders(sender, args, 2);
            SeizureWarning sw = new SeizureWarning();

            sw.Size = programContent.Size;
            programContent.Controls.Add(sw);
            sw.BringToFront();
        }
예제 #8
0
        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);

            var textboxcolor = Color.Silver;

            if (SaveSystem.currentTheme != null)
            {
                textboxcolor = SaveSystem.currentTheme.windowColor;
            }

            if (SaveSystem.currentTheme != null)
            {
                BackColor = SaveSystem.currentTheme.threeDObjectsColor;
            }
            else
            {
                BackColor = Color.White;
            }

            var _lightBack = Paintbrush.GetLightFromColor(textboxcolor);
            var _darkBack  = Paintbrush.GetDarkFromColor(textboxcolor);

            if (SaveSystem.currentTheme != null)
            {
                Font = SaveSystem.currentTheme.buttonFont;
            }
            else
            {
                Font = new Font("Microsoft Sans Serif", 8.25F, FontStyle.Regular);
            }

            var g = e.Graphics;

            g.Clear(BackColor);

            g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.SingleBitPerPixelGridFit;
            if (UseSystemPasswordChar)
            {
                g.DrawString(new string('●', Text.Length), Font, Brushes.Black, 3, 3);
            }
            else
            {
                g.DrawString(Text, Font, Brushes.Black, 3, 3);
            }

            g.DrawLine(new Pen(_darkBack), 0, 0, Width - 2, 0);
            g.DrawLine(new Pen(_lightBack), Width - 1, 0, Width - 1, Height - 1);
            g.DrawLine(new Pen(_lightBack), 0, Height - 1, Width - 1, Height - 1);
            g.DrawLine(new Pen(_darkBack), 0, 0, 0, Height - 2);
            g.DrawLine(Pens.Black, 1, 1, Width - 3, 1);
            g.DrawLine(Pens.Black, 1, 1, 1, Height - 3);
            g.DrawLine(new Pen(textboxcolor), 1, Height - 2, Width - 2, Height - 2);
            g.DrawLine(new Pen(textboxcolor), Width - 2, Height - 2, Width - 2, 1);
        }
예제 #9
0
 public _12padams1998()
 {
     InitializeComponent();
     button1.Paint += (s, args) => Paintbrush.PaintClassicBorders(s, args, 2);
     button2.Paint += (s, args) => Paintbrush.PaintClassicBorders(s, args, 2);
     button3.Paint += (s, args) => Paintbrush.PaintClassicBorders(s, args, 2);
     button4.Paint += (s, args) => Paintbrush.PaintClassicBorders(s, args, 2);
     button5.Paint += (s, args) => Paintbrush.PaintClassicBorders(s, args, 2);
     button6.Paint += (s, args) => Paintbrush.PaintClassicBorders(s, args, 2);
     button7.Paint += (s, args) => Paintbrush.PaintClassicBorders(s, args, 2);
 }
예제 #10
0
        private void right_Paint(object sender, PaintEventArgs e)
        {
            var gfx = e.Graphics;

            gfx.Clear(SaveSystem.currentTheme.threeDObjectsColor);

            var _darkBack = Paintbrush.GetDarkFromColor(SaveSystem.currentTheme.threeDObjectsColor);

            gfx.DrawLine(Pens.Black, 3, 0, 3, bottom.Width);
            gfx.DrawLine(new Pen(_darkBack), 2, 0, 2, bottom.Width);
        }
예제 #11
0
 public TitleScreen()
 {
     InitializeComponent();
     this.startmenu.Paint += (sender, args) => Paintbrush.PaintClassicBorders(sender, args, 2);
     if (!File.Exists(Path.Combine(DataDirectory, "o.k")))
     {
         SeizureWarning sw = new SeizureWarning();
         sw.Size = programContent.Size;
         programContent.Controls.Add(sw);
         sw.BringToFront();
     }
 }
예제 #12
0
        private void toprightcorner_Paint(object sender, PaintEventArgs e)
        {
            var gfx = e.Graphics;

            gfx.Clear(SaveSystem.currentTheme.threeDObjectsColor);

            var _lightBack = Paintbrush.GetLightFromColor(SaveSystem.currentTheme.threeDObjectsColor);
            var _darkBack  = Paintbrush.GetDarkFromColor(SaveSystem.currentTheme.threeDObjectsColor);

            gfx.DrawLine(new Pen(_lightBack), 0, 1, 1, 1);
            gfx.DrawLine(new Pen(_darkBack), 2, 1, 2, 3);
            gfx.DrawLine(Pens.Black, 3, 0, 3, 3);
        }
예제 #13
0
 public void Repaint(Paintbrush.brushType t)
 {
     switch (t) {
     case Paintbrush.brushType.accept:
         SetType(type.accept);
         break;
     case Paintbrush.brushType.reject:
         SetType (type.reject);
         break;
     case Paintbrush.brushType.start:
         SetStart();
         break;
     }
 }
예제 #14
0
        private void clockPanel_Paint(object sender, PaintEventArgs e)
        {
            var gfx = e.Graphics;

            gfx.Clear(currentTheme.threeDObjectsColor);

            var _lightBack = Paintbrush.GetLightFromColor(currentTheme.threeDObjectsColor);
            var _darkBack  = Paintbrush.GetDarkFromColor(currentTheme.threeDObjectsColor);

            gfx.DrawLine(new Pen(_lightBack), 0, 1, clockPanel.Width, 1);
            gfx.DrawLine(new Pen(_darkBack), 0, 24, 0, 4);
            gfx.DrawLine(new Pen(_darkBack), 61, 4, 0, 4);
            gfx.DrawLine(new Pen(_lightBack), 62, 4, 62, 25);
            gfx.DrawLine(new Pen(_lightBack), 0, 25, 62, 25);
        }
예제 #15
0
 public MineBestTimes()
 {
     InitializeComponent();
     foreach (Control c in Controls)
     {
         if (c is Button)
         {
             c.Font   = new Font(TitleScreen.pfc.Families[0], 16F, FontStyle.Bold, GraphicsUnit.Point, ((byte)(0)));
             c.Paint += (sender, args) => Paintbrush.PaintClassicBorders(sender, args, 2);
         }
         else
         {
             c.Font = new Font(TitleScreen.pfc.Families[0], 16F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0)));
         }
     }
 }
예제 #16
0
        private void startmenu_Paint(object sender, PaintEventArgs e)
        {
            var gfx = e.Graphics;

            gfx.Clear(currentTheme.threeDObjectsColor);

            var _lightBack = Paintbrush.GetLightFromColor(currentTheme.threeDObjectsColor);
            var _darkBack  = Paintbrush.GetDarkFromColor(currentTheme.threeDObjectsColor);

            gfx.DrawLine(Pens.Black, 0, startmenu.Height - 1, startmenu.Width - 1, startmenu.Height - 1);
            gfx.DrawLine(Pens.Black, startmenu.Width - 1, startmenu.Height - 1, startmenu.Width - 1, 0);
            gfx.DrawLine(new Pen(_darkBack), 1, startmenu.Height - 2, startmenu.Width - 2, startmenu.Height - 2);
            gfx.DrawLine(new Pen(_darkBack), startmenu.Width - 2, 1, startmenu.Width - 2, startmenu.Height - 2);
            gfx.DrawLine(new Pen(_lightBack), 1, startmenu.Height - 3, 1, 1);
            gfx.DrawLine(new Pen(_lightBack), startmenu.Width - 3, 1, 1, 1);
        }
예제 #17
0
        public Infobox95(InfoboxType type, InfoboxButtons btns)
        {
            InitializeComponent();
            button1.Paint += (sender, args) => Paintbrush.PaintClassicBorders(sender, args, 2);
            button2.Paint += (sender, args) => Paintbrush.PaintClassicBorders(sender, args, 2);
            button3.Paint += (sender, args) => Paintbrush.PaintClassicBorders(sender, args, 2);

            switch (type)
            {
            case InfoboxType.Info:
                pictureBox1.Image = Properties.Resources.Win95Info;
                SoundPlayer spa = new SoundPlayer(SaveSystem.currentTheme.asteriskSound);
                spa.Play();
                break;

            case InfoboxType.Question:
                pictureBox1.Image = Properties.Resources.Win95Question;
                SoundPlayer spq = new SoundPlayer(SaveSystem.currentTheme.questionSound);
                spq.Play();
                break;

            case InfoboxType.Warning:
                pictureBox1.Image = Properties.Resources.Win95Warning;
                SoundPlayer spw = new SoundPlayer(SaveSystem.currentTheme.exclamationSound);
                spw.Play();
                break;

            case InfoboxType.Error:
                pictureBox1.Image = Properties.Resources.Win95Error;
                SoundPlayer spe = new SoundPlayer(SaveSystem.currentTheme.critStopSound);
                spe.Play();
                break;
            }

            btnStatus = (int)btns;
            switch (btns)
            {
            case InfoboxButtons.OK:
                button1.Text = "OK";
                button2.Hide();
                button3.Hide();
                break;
            }
        }
예제 #18
0
 public WinClassicMinesweeper()
 {
     InitializeComponent();
     labelBombs.Font = new Font(TitleScreen.pfc.Families[2], 15, GraphicsUnit.Point);
     labelTime.Font  = new Font(TitleScreen.pfc.Families[2], 15, GraphicsUnit.Point);
     panel2.Paint   += (sender, args) => Paintbrush.PaintClassicBordersIndented(sender, args, 3);
     panel3.Paint   += (sender, args) => Paintbrush.PaintClassicBorders(sender, args, 3);
     panel4.Paint   += (sender, args) => Paintbrush.PaintClassicBordersIndented(sender, args, 2);
     foreach (ToolStripMenuItem item in menuStrip1.Items)
     {
         item.Font                  = new Font(TitleScreen.pfc.Families[0], 16F, FontStyle.Regular);
         item.BackColor             = Color.Silver;
         item.BackgroundImage       = Properties.Resources.sliversilver;
         item.BackgroundImageLayout = ImageLayout.Center;
         item.DisplayStyle          = ToolStripItemDisplayStyle.Text;
     }
     toolStripSeparator1.Paint += Paintbrush.ExtendedToolStripSeparator_Paint;
     toolStripSeparator2.Paint += Paintbrush.ExtendedToolStripSeparator_Paint;
     toolStripSeparator3.Paint += Paintbrush.ExtendedToolStripSeparator_Paint;
     toolStripSeparator4.Paint += Paintbrush.ExtendedToolStripSeparator_Paint;
     toolStripSeparator5.Paint += Paintbrush.ExtendedToolStripSeparator_Paint;
 }
예제 #19
0
        private void panel1_Paint(object sender, PaintEventArgs e)
        {
            if (SaveSystem.currentTheme != null)
            {
                BackColor = SaveSystem.currentTheme.threeDObjectsColor;
            }
            else
            {
                BackColor = Color.Silver;
            }

            var _lightBack = Paintbrush.GetLightFromColor(BackColor);
            var _darkBack  = Paintbrush.GetDarkFromColor(BackColor);

            var g = e.Graphics;

            g.Clear(BackColor);

            g.FillRectangle(Brushes.Black, new Rectangle(0, 0, Width, Height));
            g.FillRectangle(new SolidBrush(_lightBack), new Rectangle(0, 0, Width - 1, Height - 1));
            g.FillRectangle(new SolidBrush(_darkBack), new Rectangle(1, 1, Width - 2, Height - 2));
            g.FillRectangle(new SolidBrush(BackColor), new Rectangle(1, 1, Width - 3, Height - 3));
        }
예제 #20
0
 public WinClassicCalculator()
 {
     InitializeComponent();
     txtNumbers.Paint += (sender, args) => Paintbrush.PaintClassicBordersIndented(sender, args, 2);
 }
예제 #21
0
        public ClassicDropDown()
        {
            InitializeComponent();


            try
            {
                // Draw the border

                this.Paint += new PaintEventHandler((object sender, PaintEventArgs e) =>
                {
                    // Update a bunch of variables!
                    textBox1.Font = Font;

                    if (SaveSystem.currentTheme != null)
                    {
                        textBox1.BackColor = SaveSystem.currentTheme.threeDObjectsColor;
                        BackColor          = SaveSystem.currentTheme.threeDObjectsColor;

                        textboxcolor = SaveSystem.currentTheme.windowColor;

                        _lightBack = Paintbrush.GetLightFromColor(textboxcolor);
                        _darkBack  = Paintbrush.GetDarkFromColor(textboxcolor);
                    }
                    else
                    {
                        textBox1.BackColor = Color.White;
                        BackColor          = Color.White;
                    }
                });



                tborder.Paint += new PaintEventHandler((object sender, PaintEventArgs e) =>
                {
                    e.Graphics.DrawLine(new Pen(_darkBack), 0, 0, tborder.Width, 0);
                    e.Graphics.DrawLine(Pens.Black, 0, 1, tborder.Width, 1);
                });

                lborder.Paint += new PaintEventHandler((object sender, PaintEventArgs e) =>
                {
                    e.Graphics.DrawLine(new Pen(_darkBack), 0, 0, 0, Height);
                    e.Graphics.DrawLine(Pens.Black, 1, 0, 1, Height);
                });

                rborder.Paint += new PaintEventHandler((object sender, PaintEventArgs e) =>
                {
                    e.Graphics.DrawLine(new Pen(_lightBack), 0, 0, 0, Height - 1);
                    e.Graphics.DrawLine(new Pen(textboxcolor), 1, 0, 1, Height - 1);
                });

                bborder.Paint += new PaintEventHandler((object sender, PaintEventArgs e) =>
                {
                    e.Graphics.DrawLine(new Pen(_lightBack), 0, 0, Width - 1, 0);
                    e.Graphics.DrawLine(new Pen(textboxcolor), 0, 1, Width - 2, 1);
                });

                tborder.Invalidate();
                lborder.Invalidate();
                rborder.Invalidate();
                bborder.Invalidate();
            }
            catch { }
        }
예제 #22
0
        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);

            if (SaveSystem.currentTheme != null && AdaptBackColorWithTheme)
            {
                BackColor = SaveSystem.currentTheme.threeDObjectsColor;
            }

            if (AdaptForeColorWithTheme)
            {
                if (SaveSystem.currentTheme != null)
                {
                    ForeColor = SaveSystem.currentTheme.threeDObjectsTextColor;
                }
                else
                {
                    ForeColor = Color.Black;
                }
            }

            if (AdaptFontWithTheme)
            {
                if (SaveSystem.currentTheme != null)
                {
                    Font = SaveSystem.currentTheme.buttonFont;
                }
                else
                {
                    Font = new Font("Microsoft Sans Serif", 8.25F, FontStyle.Regular);
                }
            }

            _lightBack = Paintbrush.GetLightFromColor(BackColor);
            _darkBack  = Paintbrush.GetDarkFromColor(BackColor);

            var g = e.Graphics;

            g.Clear(BackColor);

            g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.SingleBitPerPixelGridFit;
            StringFormat sf = new StringFormat();

            sf.Alignment     = StringAlignment.Center;
            sf.LineAlignment = StringAlignment.Center;
            sf.HotkeyPrefix  = System.Drawing.Text.HotkeyPrefix.Show;

            if (_pressing && Enabled)
            {
                g.FillRectangle(new SolidBrush(_lightBack), new Rectangle(0, 0, Width, Height));
                g.FillRectangle(Brushes.Black, new Rectangle(0, 0, Width - 1, Height - 1));
                g.FillRectangle(new SolidBrush(_darkBack), new Rectangle(1, 1, Width - 2, Height - 2));
                g.FillRectangle(new SolidBrush(BackColor), new Rectangle(2, 2, Width - 3, Height - 3));

                g.DrawString(Text, Font, new SolidBrush(ForeColor), new Rectangle(2, 2, Width - 3, Height - 3), sf);
            }
            else
            {
                g.FillRectangle(Brushes.Black, new Rectangle(0, 0, Width, Height));
                g.FillRectangle(new SolidBrush(_lightBack), new Rectangle(0, 0, Width - 1, Height - 1));
                g.FillRectangle(new SolidBrush(_darkBack), new Rectangle(1, 1, Width - 2, Height - 2));
                g.FillRectangle(new SolidBrush(BackColor), new Rectangle(1, 1, Width - 3, Height - 3));

                if (Enabled)
                {
                    g.DrawString(Text, Font, new SolidBrush(ForeColor), new Rectangle(1, 1, Width - 3, Height - 3), sf);
                }
                else
                {
                    g.DrawString(Text, Font, new SolidBrush(_darkBack), new Rectangle(1, 1, Width - 3, Height - 3), sf);
                }
            }
        }