private void importCustomButtonsToolStripMenuItem_Click(object sender, EventArgs e) { if (CustomButtons.Import()) { RefreshCustomButtons(); CustomButtons.SaveFile(); } }
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(); } }
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.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.ToolTip = TbToolTip.Text; inedit.EnableStyle = (CustomButton.EnableStyles)CbEStyles.SelectedItem; inedit.ButtonType = (CustomButton.ButtonTypes)CbByttonType.SelectedItem; } CustomButtons.SaveFile(); Close(); }
static void Main(string[] args) { Tools.TimingBase.TimeFromApplicationStartup(); 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(); }
private void exportCustomButtonsToolStripMenuItem_Click(object sender, EventArgs e) { CustomButtons.Export(); }
private void CustomButtonArea_OrderChanged(int oldindex, int newindex) { CustomButtons.Reorder(oldindex, newindex); RefreshCustomButtons(); }