private void addModuleToolStripMenuItem_Click(object sender, EventArgs e) { var modulesForm = new fsModulesForm(); modulesForm.ShowDialog(); if (modulesForm.DialogResult == DialogResult.OK) { if (modulesForm.SelectedCalculatorControl is fsOptionsSingleTableAndCommentsCalculatorControl) { (modulesForm.SelectedCalculatorControl as fsOptionsSingleTableAndCommentsCalculatorControl). AllowDiagramView = true; } ++m_counter; var module = new fsModule("#" + m_counter + " - " + modulesForm.SelectedCalculatorControlName, modulesForm.SelectedCalculatorControl); m_modules.Add(module); module.Form.MdiParent = this; module.Form.Closed += FormClose; module.Form.Activated += FormActivated; int mdiAreaHeight = ClientSize.Height - menuStrip1.Bounds.Height - 4; if (module.Form.Bounds.Y + module.Form.Bounds.Height > mdiAreaHeight) { var rect = new System.Drawing.Rectangle( module.Form.Bounds.X, module.Form.Bounds.Y, module.Form.Bounds.Width, mdiAreaHeight - module.Form.Bounds.Y); module.Form.Bounds = rect; } m_currentModule = module; RebuildWindowsList(); } }
private void SetCurrentModule(string checkedModuleName) { if (m_currentModule != null && m_currentModule.Name == checkedModuleName) { return; } foreach (ToolStripItem toolStripItem in modulesToolStripMenuItem.DropDownItems) { if (toolStripItem is ToolStripMenuItem) { var menuItem = (ToolStripMenuItem)toolStripItem; menuItem.Checked = menuItem.Text == checkedModuleName; } } foreach (fsModule module in m_modules) { if (module.Name == checkedModuleName) { m_currentModule = module; m_currentModule.Form.Activate(); break; } } }
private void AddModuleToList(string text, bool isChecked, fsModule module) { var checkBox = new CheckBox { Parent = listingPanel, Location = new Point(8, 48 + 8 + (m_moduleToCheckBox.Count) * 24), Text = text, Checked = isChecked, AutoSize = true }; if (module == m_initiallyCheckedModule) { checkBox.Checked = true; } m_moduleToCheckBox[module] = checkBox; }
public void AddModule(fsModule module) { m_modules.Add(module); }
public void RemoveModule(fsModule module) { m_modules.Remove(module); }
internal void SetInitiallyCheckedModule(fsModule module) { m_initiallyCheckedModule = module; }
internal void SetInitiallyCheckedModule(fsModule fsModule) { fsCheckedList1.CheckItem(fsModule.Name); }