Ejemplo n.º 1
0
        private void saveButton_Click(object sender, EventArgs e)
        {
            if (this.runCheckBox.CheckState == CheckState.Checked)
            {
                UtilHelps.AddWhenStart();
            }
            else
            {
                UtilHelps.RemoveWhenStart();
            }

            //DrawTools.DrawSettings.Quality = this.trackBar1.Value;
            DrawTools.DrawSettings.LastUsedColor    = (Color)this.colorComboBox.SelectedItem;
            DrawTools.DrawSettings.LastUsedPenWidth = (int)this.penWidthComboBox.SelectedItem;
            DrawTools.DrawSettings.LastUsedTextSize = (int)this.textsizeComboBox.SelectedItem;

            DrawTools.DrawSettings.Save();

            Config.KeyCode    = Hotkey2.KeyCodeToString(((Keys)hotKeyComboBox.SelectedItem));
            Config.ShiftKey   = shiftCheckBox.Checked;
            Config.ControlKey = controlCheckBox.Checked;
            Config.AltKey     = altCheckBox.Checked;
            Config.WindowsKey = windowsCheckBox.Checked;
            Config.Save();

            ProxyForm.Instance.AppContext.ShowBalloonTip();

            this.Hide();
        }
Ejemplo n.º 2
0
        private void InitializeUIControls()
        {
            InitHotkey();

            this.runCheckBox.CheckState = UtilHelps.HasAddToStart() ? CheckState.Checked : CheckState.Unchecked;

            for (int i = 8; i <= 20; i++)
            {
                this.textsizeComboBox.Items.Add(i);

                if (i == DrawTools.DrawSettings.DefaultTextSize)
                {
                    this.textsizeComboBox.SelectedItem = i;
                }
            }

            for (int i = 1; i <= 3; i++)
            {
                this.penWidthComboBox.Items.Add(i);

                if (i == DrawTools.DrawSettings.DefaultPenWidth)
                {
                    this.penWidthComboBox.SelectedItem = i;
                }
            }


            this.colors = new Color[] {
                Color.FromArgb(255, 0, 0, 0),
                Color.FromArgb(255, 128, 0, 0),
                Color.FromArgb(255, 128, 128, 128),
                Color.FromArgb(255, 128, 128, 0),
                Color.FromArgb(255, 128, 0, 128),
                Color.FromArgb(255, 0, 128, 0),
                Color.FromArgb(255, 0, 0, 128),
                Color.FromArgb(255, 0, 128, 128),

                Color.FromArgb(255, 255, 255, 255),
                Color.FromArgb(255, 192, 192, 192),
                Color.FromArgb(255, 255, 0, 0),
                Color.FromArgb(255, 255, 255, 0),
                Color.FromArgb(255, 255, 0, 255),
                Color.FromArgb(255, 0, 255, 0),
                Color.FromArgb(255, 0, 0, 255),
                Color.FromArgb(255, 0, 255, 255)
            };

            foreach (Color c in colors)
            {
                this.colorComboBox.Items.Add(c);

                if (c.ToArgb() == DrawTools.DrawSettings.DefaultColor.ToArgb())
                {
                    this.colorComboBox.SelectedItem = c;
                    this.colorComboBox.BackColor    = c;
                }
            }
        }
        /// <summary>
        /// This class should be created and passed into Application.Run( ... )
        /// </summary>
        public CoolShotApplicationContext()
        {
            InitializeContext();

            if (UtilHelps.IsFirstRunApp())
            {
                UtilHelps.AddWhenStart();
            }
        }