Пример #1
0
        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();
            }
        }
Пример #2
0
        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;
                }
            }
        }
Пример #3
0
        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;
        }
Пример #4
0
 public void AddModule(fsModule module)
 {
     m_modules.Add(module);
 }
Пример #5
0
 public void RemoveModule(fsModule module)
 {
     m_modules.Remove(module);
 }
Пример #6
0
 internal void SetInitiallyCheckedModule(fsModule module)
 {
     m_initiallyCheckedModule = module;
 }
Пример #7
0
 internal void SetInitiallyCheckedModule(fsModule fsModule)
 {
     fsCheckedList1.CheckItem(fsModule.Name);
 }