Beispiel #1
0
        static void Main(string[] args)
        {
            ExceptionManager.RegisterHandler();
            Tools.TimingBase.TimeFromApplicationStartup();

            Logger.Start();
            GitHub.InitUpdate();
            UsageStats.LoadFile();
            CustomButtons.LoadFile();
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            System.Globalization.CultureInfo ci = Settings.GetObject <System.Globalization.CultureInfo>("User Language", null);
            if (ci != null)
            {
                Thread.CurrentThread.CurrentUICulture = ci;
            }
            Tools.TaskScheduler.SetClockResolution(1);             //use a fast clock
            //Application.SetCompatibleTextRenderingDefault(false);

            Application.Run(new MainForm(args));

            GrblEmulator.WebSocketEmulator.Stop();
            Autotrace.CleanupTmpFolder();

            ComWrapper.ComLogger.StopLog();
            Logger.Stop();
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            Tools.TimingBase.TimeFromApplicationStartup();

            foreach (string arg in args)
            {
                GrblCore.WriteComLog = GrblCore.WriteComLog || arg == "comlog";
            }

            Logger.Start();
            GitHub.CleanupOldVersion();
            UsageStats.LoadFile();
            CustomButtons.LoadFile();
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            System.Globalization.CultureInfo ci = (System.Globalization.CultureInfo)Settings.GetObject("User Language", null);
            if (ci != null)
            {
                System.Threading.Thread.CurrentThread.CurrentUICulture = ci;
            }

            Tools.TaskScheduler.SetClockResolution(1);             //use a fast clock
            Application.Run(new MainForm());
            GrblEmulator.WebSocketEmulator.Stop();
            Autotrace.CleanupTmpFolder();
            Logger.Stop();
        }
Beispiel #3
0
 private void importCustomButtonsToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (CustomButtons.Import())
     {
         RefreshCustomButtons();
         CustomButtons.SaveFile();
     }
 }
Beispiel #4
0
 public void ImportButton(string filename = null)
 {
     if (CustomButtons.Import(ParentForm, filename))
     {
         RefreshCustomButtons();
         CustomButtons.SaveFile();
     }
 }
Beispiel #5
0
 private void RemoveButton_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show(Strings.BoxDeleteCustomButtonText, Strings.BoxDeleteCustomButtonTitle, MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
     {
         CustomButtons.Remove(CustomButton);
         CustomButtons.SaveFile();
         form.RefreshCustomButtons();
     }
 }
Beispiel #6
0
        private void BtnCreate_Click(object sender, EventArgs e)
        {
            if (TBGCode.Text.Trim().Length == 0)
            {
                System.Windows.Forms.MessageBox.Show(Strings.BoxCustomButtonPleaseGCodeText, Strings.BoxCustomButtonPleaseToolTipTitle, MessageBoxButtons.OK, MessageBoxIcon.Error);
                TBGCode.Focus();
                return;
            }

            if (TBGCode2.Visible && TBGCode2.Text.Trim().Length == 0)
            {
                System.Windows.Forms.MessageBox.Show(Strings.BoxCustomButtonPleaseGCodeText, Strings.BoxCustomButtonPleaseToolTipTitle, MessageBoxButtons.OK, MessageBoxIcon.Error);
                TBGCode2.Focus();
                return;
            }

            if (TbToolTip.Text.Trim().Length == 0)
            {
                System.Windows.Forms.MessageBox.Show(Strings.BoxCustomButtonPleaseToolTipText, Strings.BoxCustomButtonPleaseToolTipTitle, MessageBoxButtons.OK, MessageBoxIcon.Error);
                TbToolTip.Focus();
                return;
            }

            if (inedit == null)
            {
                CustomButton cb = new CustomButton();
                cb.ButtonType  = (CustomButton.ButtonTypes)CbByttonType.SelectedItem;
                cb.GCode       = TBGCode.Text;
                cb.GCode2      = TBGCode2.Text;
                cb.Image       = BTOpenImage.Image;
                cb.Caption     = TbCaption.Text;
                cb.ToolTip     = TbToolTip.Text;
                cb.EnableStyle = (CustomButton.EnableStyles)CbEStyles.SelectedItem;
                CustomButtons.Add(cb);
            }
            else
            {
                inedit.GCode       = TBGCode.Text;
                inedit.GCode2      = TBGCode2.Text;
                inedit.Image       = BTOpenImage.Image;
                inedit.Caption     = TbCaption.Text;
                inedit.ToolTip     = TbToolTip.Text;
                inedit.EnableStyle = (CustomButton.EnableStyles)CbEStyles.SelectedItem;
                inedit.ButtonType  = (CustomButton.ButtonTypes)CbByttonType.SelectedItem;
            }

            CustomButtons.SaveFile();

            Close();
        }
        private void BtnCreate_Click(object sender, EventArgs e)
        {
            if (inedit == null)
            {
                CustomButton cb = new CustomButton();
                cb.GCode       = TBGCode.Text;
                cb.Image       = BTOpenImage.Image;
                cb.ToolTip     = TbToolTip.Text;
                cb.EnableStyle = (CustomButton.EnableStyles)CbEStyles.SelectedItem;
                CustomButtons.Add(cb);
            }
            else
            {
                inedit.GCode       = TBGCode.Text;
                inedit.Image       = BTOpenImage.Image;
                inedit.ToolTip     = TbToolTip.Text;
                inedit.EnableStyle = (CustomButton.EnableStyles)CbEStyles.SelectedItem;
            }

            CustomButtons.SaveFile();

            Close();
        }
Beispiel #8
0
 private void exportCustomButtonsToolStripMenuItem_Click(object sender, EventArgs e)
 {
     CustomButtons.Export();
 }
Beispiel #9
0
 private void CustomButtonArea_OrderChanged(int oldindex, int newindex)
 {
     CustomButtons.Reorder(oldindex, newindex);
     RefreshCustomButtons();
 }
Beispiel #10
0
 private void RemoveButton_Click(object sender, EventArgs e)
 {
     CustomButtons.Remove(CustomButton);
     CustomButtons.SaveFile();
     form.RefreshCustomButtons();
 }