public override bool ValidateChildren() { if (NameEdit.Text.IsValidName() == false) { Resources.EnterValidName.ShowError(); MainTabControl.SelectTab(GeneralTabPage); NameEdit.Focus(); return(false); } if (string.IsNullOrWhiteSpace(RequestUriEdit.Text)) { Resources.RequestUriCannotBeNullOrWhiteSpace.ShowError(); MainTabControl.SelectTab(GeneralTabPage); RequestUriEdit.Focus(); return(false); } if (string.IsNullOrWhiteSpace(MethodEdit.Text)) { Resources.SelectMethod.ShowError(); MainTabControl.SelectTab(GeneralTabPage); MethodEdit.Focus(); return(false); } if (DataSchemaEdit.ValidateChildren() == false) { MainTabControl.SelectTab(DataSchemaTabPage); DataSchemaEdit.Focus(); return(false); } return(true); }
public void CreateTabOpenFile(string fileToOpen) { var fileParts = fileToOpen.Split('\\'); var tabText = fileParts[fileParts.Count() - 1]; MainTabControl.TabPages.Add(new TabPage(tabText) { Name = fileToOpen }); MainTabControl.SuspendLayout(); MainTabControl.TabPages[fileToOpen].Controls.Add(DashGlobal.EditorHelper.CreateEditor(fileToOpen)); MainTabControl.ResumeLayout(); MainTabControl.SelectTab(fileToOpen); DashGlobal.SetWindowTitle(fileToOpen); Main.Lang = DashGlobal.FilesHelper.GetLangFromFile(fileToOpen); DashGlobal.EditorHelper.ActiveEditor.OpenFile(fileToOpen); MainTabControl.TabPages[fileToOpen].Tag = new FileInfo() { Dirty = false, CrcHash = "TODO" }; DashGlobal.EditorHelper.PerformSyntaxHighlighting(null, Main.Lang, true); }
private void NetworkDefinitionView_MouseUp(object sender,MouseEventArgs e) { CanTreeTag canTreeTag = (CanTreeTag)NetworkDefinitionView.SelectedNode.Tag; if (e.Button == MouseButtons.Left) { switch (canTreeTag.NodeType) { case CanTreeTag.BUS: case CanTreeTag.NODE: MainTabControl.SelectTab(1); break; case CanTreeTag.MESSAGE: MainTabControl.SelectTab(0); break; case CanTreeTag.SIGNAL: MainTabControl.SelectTab(0); break; default: break; } } if (e.Button == MouseButtons.Right) { switch (canTreeTag.NodeType) { case CanTreeTag.BUS: BusMenuStrip.Show(NetworkDefinitionView,e.Location); break; case CanTreeTag.NODE: NodeMenuStrip.Show(NetworkDefinitionView,e.Location); break; case CanTreeTag.MESSAGE: MessageMenuStrip.Show(NetworkDefinitionView,e.Location); break; case CanTreeTag.SIGNAL: SignalMenuStrip.Show(NetworkDefinitionView,e.Location); break; default: break; } } }
public override bool ValidateChildren() { if (string.IsNullOrWhiteSpace(DataTypeEdit.Text)) { Resources.SelectDataType.ShowError(); MainTabControl.SelectTab(GeneralTabPage); DataTypeEdit.Focus(); return(false); } if (NameEdit.Text.IsValidName() == false) { Resources.EnterValidName.ShowError(); MainTabControl.SelectTab(GeneralTabPage); NameEdit.Focus(); return(false); } if (AvailableValuesEdit.ValidateChildren() == false) { MainTabControl.SelectTab(AvailableValuesTabPage); AvailableValuesEdit.Focus(); return(false); } if (DefaultValuesEdit.ValidateChildren() == false) { MainTabControl.SelectTab(DefaultValuesTabPage); DefaultValuesEdit.Focus(); return(false); } return(true); }
private void AsynchSocketSeverUIFormBaseFrame_Shown(object sender, EventArgs e) { if (nSocketServiceTypeID == SocketServiceTypeID.lockServer) { FormateCheckBox.Checked = true; FormateCheckBox.Enabled = false; } else { FormateCheckBox.Enabled = false; } //AutoRepairGroupBox.Enabled = false; MainTabControl.SelectTab(2); AlgorithmcomboBox.SelectedIndex = 0; if (LocalIPAdressSelectIndex > -1) { LocalHostIPListcomboBox.SelectedIndex = LocalIPAdressSelectIndex; buttonServerStart_Click(null, null); } //--------------------- ShownFinallyInit(); }
public override bool ValidateChildren() { if (NameEdit.Text.IsValidName() == false) { Resources.EnterValidName.ShowError(); MainTabControl.SelectTab(GeneralTabPage); NameEdit.Focus(); return(false); } if (string.IsNullOrWhiteSpace(ConnectionStringEdit.Text)) { Resources.ConnectionStringCannotBeNullOrWhiteSpace.ShowError(); MainTabControl.SelectTab(GeneralTabPage); ConnectionStringEdit.Focus(); return(false); } if (string.IsNullOrWhiteSpace(SelectCommandEdit.Text)) { Resources.SelectCommandCannotBeNullOrWhiteSpace.ShowError(); MainTabControl.SelectTab(GeneralTabPage); SelectCommandEdit.Focus(); return(false); } if (DataSchemaEdit.ValidateChildren() == false) { MainTabControl.SelectTab(DataSchemaTabPage); DataSchemaEdit.Focus(); return(false); } return(true); }
private void ProcessListView_MouseDoubleClick(object sender, MouseEventArgs e) { Int32.TryParse(DataBox.Text, out _dataSize); if (_dataSize == 0) { _dataSize = 4; } if (hasValue) { if (!Int32.TryParse(StartValueBox.Text, out _searchValue)) { MessageBox.Show("Failed to Parse Search Value"); return; } } else { _searchValue = 0; } this.Cursor = Cursors.WaitCursor; PID = (int)ProcessListView.SelectedItems[0].Tag; if (hasValue) { MemoryScan.ConditionalScan((ulong)PID, _dataSize, (UInt32)_searchValue); } else { MemoryScan.UnconditionalScan((ulong)PID, _dataSize); } MainTabControl.SelectTab(1); SearchInitialized = true; PopulateMatches(); this.Cursor = Cursors.Default; }
public void CreateNewTab(string FileName, ProjectFile projectFile = null, bool PopulateTreeView = false) { if (!MainTabControl.TabPages.ContainsKey(FileName)) { MainTabControl.TabPages.Add(new TabPage(FileName) { Name = FileName, Tag = projectFile }); MainTabControl.SuspendLayout(); bool add = true; FastColoredTextBox workspace = FrostbyteCore.Workspace.CreateWorkspace(); if (projectFile != null) { try { workspace.Text = File.ReadAllText(projectFile.GetLocation(FrostbyteCore.MainForm.project)); add = workspace.Text.Length == 0; new Syntax(workspace, projectFile.getFileType()); } catch { } } else { new Syntax(workspace, FileType.UNKNOWN); } if (add && Properties.Settings.Default.TopFileComment.Length > 0) { string comment = Properties.Settings.Default.TopFileComment; ProjectMeta meta = new ProjectMeta(FrostbyteCore.MainForm.project, FileName); foreach (string replace in meta.variables.Keys) { comment = comment.Replace(replace, meta.variables[replace]); } workspace.Text = comment + '\n' + workspace.Text; } MainTabControl.TabPages[FileName].Controls.Add(workspace); MainTabControl.ResumeLayout(); MainTabControl.SelectTab(FileName); } else { MainTabControl.SelectedTab = MainTabControl.TabPages[FileName]; } FrostbyteCore.MainForm.toolStripStatusLabel1.Text = FrostbyteCore.Tabs.MainTabControl.SelectedTab.Name; FrostbyteCore.MainForm.toolStripStatusLabel2.Text = "Current Length: " + FrostbyteCore.Workspace.GetActiveWorkspace().Text.Length.ToString(); if (PopulateTreeView) { FrostbyteCore.TreeViewer.PopulateTreeView(); } }
private void ShowRegionDetails(AwsRegionLocations region) { currentRegionBeingViewed = region; MainTabControl.SelectTab(1); RegionNameLabel.Text = controlRegionDictionary[region].RegionDetails.Name; RefreshWorkers(region); }
public void Add(CslaObjectInfo mainObject, CslaObjectInfo secondaryObject) { try { _associativeEntities.Add(mainObject, secondaryObject); } catch (Exception ex) { MessageBox.Show(ex.Message, "Object Relations Builder", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } MainTabControl.SelectTab(2); listEntities3.SelectedItems.Clear(); listEntities3.SelectedItem = listEntities3.Items[listEntities3.Items.Count - 1]; }
/// <summary> /// enter one of these package, product, supplier, customer, sale, setting /// </summary> /// <param name="inputIndicate"> </param> private void PageSectionIndicate(string inputIndicate) { // set everything to false then regulate PackageSection = ProductSection = SupplierSection = CustomerSection = SalesSection = SettingSection = false; // setting all btnIndicator to invinsible uxBtnIndicatorCus.Visible = uxBtnIndicatorPac.Visible = uxBtnIndicatorPro.Visible = uxBtnIndicatorSup.Visible = uxBtnIndicatorSal.Visible = uxBtnIndicatorSet.Visible = false; switch (inputIndicate.ToLower()) { case "package": uxBtnIndicatorPac.Visible = PackageSection = true; MainTabControl.SelectTab(PackageTab); break; case "product": uxBtnIndicatorPro.Visible = ProductSection = true; MainTabControl.SelectTab(ProductTab); break; case "supplier": uxBtnIndicatorSup.Visible = SupplierSection = true; MainTabControl.SelectTab(SuppliersTab); break; case "customer": uxBtnIndicatorCus.Visible = CustomerSection = true; MainTabControl.SelectTab(CustomersTab); break; case "sale": uxBtnIndicatorSal.Visible = SalesSection = true; MainTabControl.SelectTab(SalesTab); break; case "setting": uxBtnIndicatorSet.Visible = SettingSection = true; MainTabControl.SelectTab(SettingsTab); break; } }
/// <summary> /// 添加TabPage /// </summary> /// <param name="str"></param> /// <param name="myForm"></param> public void Add_TabPage(string str, Form myForm) { if (tabControlCheckHave(this.MainTabControl, str)) { return; } else { MainTabControl.TabPages.Add(str); MainTabControl.SelectTab(MainTabControl.TabPages.Count - 1); myForm.FormBorderStyle = FormBorderStyle.None; myForm.Dock = DockStyle.Fill; myForm.TopLevel = false; myForm.Show(); myForm.Parent = MainTabControl.SelectedTab; } }
public void CreateBlankTab(FileType fileType = FileType.Sqf, string filename = "New File") { var cleanName = filename + MainTabControl.TabPages.Count; MainTabControl.TabPages.Add(new TabPage(filename) { Name = cleanName }); MainTabControl.SuspendLayout(); MainTabControl.TabPages[cleanName].Controls.Add(DashGlobal.EditorHelper.CreateEditor()); MainTabControl.TabPages[cleanName].Tag = new FileInfo() { Dirty = false }; MainTabControl.ResumeLayout(); MainTabControl.SelectTab(cleanName); }
public override bool ValidateChildren() { if (NameEdit.Text.IsValidName() == false) { Resources.EnterValidName.ShowError(); MainTabControl.SelectTab(GeneralTabPage); NameEdit.Focus(); return(false); } if (DataSchemaEdit.ValidateChildren() == false) { MainTabControl.SelectTab(DataSchemaTabPage); DataSchemaEdit.Focus(); return(false); } return(true); }
public void CloseTab(TabPage tab) { var tabCount = MainTabControl.TabPages.Count; bool closingCurrentTab = (MainTabControl.SelectedTab == tab); var closingTabId = MainTabControl.SelectedIndex; // Break out if no tab selected if (tab == null) { return; } if (!closingCurrentTab) { return; } // Don't close if the file hasn't been changed from default if (tabCount == 1 && tab.Controls[0].Text == string.Empty) { return; } var tag = MainTabControl.SelectedTab.Tag as FileInfo; if (tag.Dirty) { DialogResult message = MessageBox.Show("This file has been modified. Do you want to save it?", "Save file?", MessageBoxButtons.YesNo); if (message == DialogResult.Yes) { // TODO -- Add call to filesHelper.SaveFile() to save the file or save as if it hasn't yet been saved return; } } if (closingTabId == (tabCount - 1)) { if (MainTabControl.TabPages.Count == 1) { MainTabControl.TabPages.Remove(tab); CreateBlankTab(FileType.Other); DashGlobal.SetWindowTitle("{new file}"); DashGlobal.EditorHelper.ActiveEditor.Focus(); return; } // If we're closing the last tab in the list, select the tab to the left MainTabControl.SelectTab(MainTabControl.TabPages[closingTabId - 1]); } else { // Select the right-most tab MainTabControl.SelectTab(MainTabControl.TabPages[closingTabId + 1]); } // Close the tab MainTabControl.TabPages.Remove(tab); if (MainTabControl.TabPages.Count == 0) { CreateBlankTab(FileType.Other); DashGlobal.SetWindowTitle("{new file}"); } DashGlobal.EditorHelper.ActiveEditor.Focus(); }
private void mainToolStrip_ItemClicked(object sender, ToolStripItemClickedEventArgs e) { switch (e.ClickedItem.Name) { case "tsOrderButton": var jobID = 0; var supplierID = 0; NewOrderDialog diag = new NewOrderDialog(_context); if (diag.ShowDialog() == DialogResult.OK) { jobID = diag.JobNumber; supplierID = diag.SupplierID; var order = _ordersService.NewDefault(LoggedOnUserID, supplierID, jobID); _ordersService.Add(order); // Purchase Order Page MainTabControl.TabPages.Add(PageFactory.GetNewTabPage(_context, PageFactory.TabPageType.PurchaseOrderPage, order.OrderNum)); } break; /// My Orders -------+ case "tsMyOrders": TabPage myOrdersTab = PageFactory.GetNewTabPage(_context, PageFactory.TabPageType.MyOrdersPage); myOrdersTab.Name = "myordersTab"; if (!MainTabControl.TabPages.ContainsKey("myordersTab")) { MainTabControl.TabPages.Add(myOrdersTab); MainTabControl.SelectedTab = myOrdersTab; } else { if (MainTabControl.TabPages.ContainsKey("myordersTab")) { MainTabControl.SelectTab("myordersTab"); } } break; case "tsSupplerOrders": break; case "tsbReceiveOrder": TabPage suppliersTab = PageFactory.GetNewTabPage(_context, PageFactory.TabPageType.SupplierOrdersPage); suppliersTab.Name = "SupplierTab"; if (!MainTabControl.TabPages.ContainsKey("SupplierTab")) { MainTabControl.TabPages.Add(suppliersTab); MainTabControl.SelectedTab = suppliersTab; } else { if (MainTabControl.TabPages.ContainsKey("SupplierTab")) { MainTabControl.SelectTab("SupplierTab"); } } break; case "tsPartEditor": TabPage partEditorPage = PageFactory.GetNewTabPage(_context, PageFactory.TabPageType.PartEditorPage);; partEditorPage.Name = "partEditorPage"; if (!MainTabControl.TabPages.ContainsKey("partEditorPage")) { MainTabControl.TabPages.Add(partEditorPage); MainTabControl.SelectedTab = partEditorPage; } else { if (MainTabControl.TabPages.ContainsKey("partEditorPage")) { MainTabControl.SelectTab("partEditorPage"); } } break; case "tsbJobOrders": TabPage jobOrdersPage = PageFactory.GetNewTabPage(_context, PageFactory.TabPageType.JobOrdersPage); jobOrdersPage.Name = "JobOrderPage"; if (!MainTabControl.TabPages.ContainsKey("JobOrderPage")) { MainTabControl.TabPages.Add(jobOrdersPage); MainTabControl.SelectedTab = jobOrdersPage; } else { if (MainTabControl.TabPages.ContainsKey("JobOrderPage")) { MainTabControl.SelectTab("JobOrderPage"); } } break; default: break; } }
public void ResetDefaults() { MainTabControl.SelectTab(GeneralTabPage); DataSourceInfo = null; }
private void optiesToolStripMenuItem_Click(object sender, EventArgs e) { MainTabControl.SelectTab("OptiesTabPage"); Show(); }
private void FormMainView_Shown(object sender, EventArgs e) { try { //Display empty event information EventInformationName.Text = "No event information"; EventInformationVenue.Text = String.Empty; EventInformationHill.Text = String.Empty; EventInformationDate.Text = String.Empty; //Display empty event parameters EventParametersText.Text = "No event parameters"; //Load event configuration file and create Event OpenFileDialog dialog = new OpenFileDialog(); dialog.Title = "Choose event configuration file"; dialog.Filter = "XML files | *.xml"; dialog.Multiselect = false; if (dialog.ShowDialog() == DialogResult.OK) { //File selected, attempt to load and create event String path = dialog.FileName; _event = EventLoader.LoadXML(path); } else { //No file selected, exit Application.Exit(); return; } //Display event information EventInformationName.Text = _event.Name; EventInformationVenue.Text = String.Format("Venue: {0}", _event.Venue); EventInformationHill.Text = String.Format("Hill: {0}", _event.Hill); EventInformationDate.Text = String.Format("Date: {0}", _event.Date.ToShortDateString()); //Display event parameters EventParametersText.Text = _event.Parameters.ToString(); //Initialize and populate event round datagrid _eventRound = _event.GetFirstRound(); _eventRoundBindingList = new BindingList <Jump>(_eventRound.Jumps); _eventRoundBindingSource = new BindingSource(_eventRoundBindingList, null); MainEventRoundDataGrid.AutoGenerateColumns = false; MainEventRoundDataGrid.AutoSize = true; MainEventRoundDataGrid.DefaultCellStyle.BackColor = Color.LightYellow; MainEventRoundDataGrid.DataSource = _eventRoundBindingSource; DataGridViewColumn column = new DataGridViewTextBoxColumn(); column.DataPropertyName = "CompetitorFisCode"; column.Name = "FIS Code"; MainEventRoundDataGrid.Columns.Add(column); column = new DataGridViewTextBoxColumn(); column.DataPropertyName = "CompetitorLastName"; column.Name = "Last Name"; MainEventRoundDataGrid.Columns.Add(column); column = new DataGridViewTextBoxColumn(); column.DataPropertyName = "CompetitorFirstName"; column.Name = "First Name"; MainEventRoundDataGrid.Columns.Add(column); column = new DataGridViewTextBoxColumn(); column.DataPropertyName = "CompetitorNation"; column.Name = "Nation"; MainEventRoundDataGrid.Columns.Add(column); column = new DataGridViewTextBoxColumn(); column.DataPropertyName = "Score"; column.Name = "Score"; column.DefaultCellStyle.Format = "F2"; MainEventRoundDataGrid.Columns.Add(column); DataGridViewButtonColumn btncolumn = new DataGridViewButtonColumn(); btncolumn.Name = "Score Jump"; btncolumn.Text = "Score Jump"; btncolumn.UseColumnTextForButtonValue = true; MainEventRoundDataGrid.Columns.Add(btncolumn); //Initialize and populate event results datagrid _eventResultsBindingList = new BindingList <EventResult>(_event.Results); _eventResultsBindingSource = new BindingSource(_eventResultsBindingList, null); MainEventResultsDataGrid.AutoGenerateColumns = false; MainEventResultsDataGrid.AutoSize = true; MainEventResultsDataGrid.DefaultCellStyle.BackColor = Color.LightYellow; MainEventResultsDataGrid.DataSource = _eventResultsBindingSource; column = new DataGridViewTextBoxColumn(); column.DataPropertyName = "CompetitorFisCode"; column.Name = "FIS Code"; MainEventResultsDataGrid.Columns.Add(column); column = new DataGridViewTextBoxColumn(); column.DataPropertyName = "CompetitorLastName"; column.Name = "Last Name"; MainEventResultsDataGrid.Columns.Add(column); column = new DataGridViewTextBoxColumn(); column.DataPropertyName = "CompetitorFirstName"; column.Name = "First Name"; MainEventResultsDataGrid.Columns.Add(column); column = new DataGridViewTextBoxColumn(); column.DataPropertyName = "CompetitorNation"; column.Name = "Nation"; MainEventResultsDataGrid.Columns.Add(column); column = new DataGridViewTextBoxColumn(); column.DataPropertyName = "Score"; column.Name = "Score"; column.DefaultCellStyle.Format = "F2"; MainEventResultsDataGrid.Columns.Add(column); //Select event round tab MainTabControl.SelectTab("MainTabRound"); } catch (Exception exception) { MessageBox.Show(String.Format("{0}", exception.Message), "EKoodi - Ski jumping points calculator", MessageBoxButtons.OK); Application.Exit(); } }