Esempio n. 1
0
        public frmMain()
        {
            CultureInfo customCulture = (CultureInfo)Thread.CurrentThread.CurrentCulture.Clone();

            customCulture.NumberFormat.NumberDecimalSeparator = ".";
            Thread.CurrentThread.CurrentCulture = customCulture;

            InitializeComponent();
            InitializeButtonCountComponent();
            InitializeStartStopRecHotkeyComponent();

            kpscolors[0].kps      = 5;
            kpscolors[0].color    = Color.FromArgb(255, 0, 190, 255);
            kpscolors[0].smoothen = false;
            kpscolors[1].kps      = 10;
            kpscolors[1].color    = Color.FromArgb(255, 248, 0, 0);
            kpscolors[1].smoothen = false;
            kpscolorscount        = 2;

            FontHandler.labels.Add(lblKps);
            //FontHandler.labels.Add(lblTotal);

            tmrProcess.Interval = 1;

            pnlInfo.MouseUp    += f_MouseUp;
            pnlInfo.MouseDown  += f_MouseDown;
            pnlInfo.MouseMove  += f_MouseMove;
            lblTotal.MouseUp   += f_MouseUp;
            lblTotal.MouseDown += f_MouseDown;
            lblTotal.MouseMove += f_MouseMove;
            lblKps.MouseUp     += f_MouseUp;
            lblKps.MouseDown   += f_MouseDown;
            lblKps.MouseMove   += f_MouseMove;
            pnlKeys.MouseUp    += f_MouseUp;
            pnlKeys.MouseDown  += f_MouseDown;
            pnlKeys.MouseMove  += f_MouseMove;

            kpsHandler = new KpsHandler(lblKps, lblTotal);
            btns       = new KpsButton[MAX_BUTTONS];
            for (int i = 0; i < MAX_BUTTONS; i++)
            {
                KpsButton n = new KpsButton(i);
                n.settingChangedEvent += n_settingChangedEvent;
                pnlKeys.Controls.Add(n);
                btns[i] = n;
            }
            SetButtonCount(INITIAL_BUTTONS);

            loadSettings();
            if (FontHandler.currentFont == null)
            {
                FontHandler.resetFont();
            }
            OnColorsUpdated();
        }
Esempio n. 2
0
 private void LoadFont(string fontfam, string fontsize, string bold)
 {
     if (fontfam.Length == 0 || fontsize.Length == 0 || bold.Length == 0)
     {
         return;
     }
     try {
         Font f = new Font(fontfam, float.Parse(fontsize), bold == "y" ? FontStyle.Bold : FontStyle.Regular);
         FontHandler.changeFont(f);
     } catch (Exception) {}
 }
Esempio n. 3
0
 private void changeFontToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try {
         if (fontDialog.ShowDialog() == DialogResult.OK)
         {
             FontHandler.changeFont(fontDialog.Font);
             settingsModified = true;
         }
     } catch (Exception ex) {
         MessageBox.Show(ex.ToString(), ex.Message);
     }
 }
Esempio n. 4
0
 private void resetFontToolStripMenuItem_Click(object sender, EventArgs e)
 {
     FontHandler.resetFont();
     settingsModified = true;
 }