Пример #1
0
        /// <summary>
        ///     Handles a double click event
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void TimeLineControl_DoubleClick(object sender, EventArgs e)
        {
            ModelEvent evt = GetEventUnderMouse();

            VariableUpdate variableUpdate = evt as VariableUpdate;

            if (variableUpdate != null)
            {
                EditorView.Window form = new EditorView.Window();
                TimeLineExpressionableTextChangeHandler handler = new TimeLineExpressionableTextChangeHandler(this,
                                                                                                              variableUpdate.Action);
                form.setChangeHandler(handler);
                GuiUtils.MdiWindow.AddChildWindow(form, DockAreas.Float);
            }

            Expect expect = evt as Expect;

            if (expect != null)
            {
                EditorView.Window form = new EditorView.Window();
                TimeLineExpressionableTextChangeHandler handler = new TimeLineExpressionableTextChangeHandler(this,
                                                                                                              expect.Expectation);
                form.setChangeHandler(handler);
                GuiUtils.MdiWindow.AddChildWindow(form, DockAreas.Float);
            }
        }
Пример #2
0
        /// <summary>
        ///     Handles a double click event
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void watchDataGridView_DoubleClick(object sender, EventArgs e)
        {
            try
            {
                HandlingDoubleClick = true;

                List <WatchedExpression> watches = (List <WatchedExpression>)watchDataGridView.DataSource;

                // Open a editor to edit the cell contents
                WatchedExpression selected = SelectedWatch;
                if (selected != null)
                {
                    DataGridViewCell selectedCell = watchDataGridView.SelectedCells[0];
                    if (selectedCell.ColumnIndex == 0)
                    {
                        EditorView.Window form = new EditorView.Window {
                            AutoComplete = true
                        };
                        TextChangeHandler handler = new TextChangeHandler(Instance, selected,
                                                                          selectedCell.OwningColumn.Name);
                        form.setChangeHandler(handler);
                        form.ShowDialog();

                        watchDataGridView.DataSource = null;
                        watchDataGridView.DataSource = watches;
                        EnsureEmptyRoom();
                        Refresh();
                    }
                    else if (selectedCell.ColumnIndex == 1)
                    {
                        ExplainBox explainTextBox = new ExplainBox();
                        explainTextBox.SetExplanation(selected.ExpressionTree.Explain());
                        GuiUtils.MdiWindow.AddChildWindow(explainTextBox);
                    }
                }
            }
            finally
            {
                HandlingDoubleClick = false;
            }
        }
Пример #3
0
        /// <summary>
        ///     Handles a double click event
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void watchDataGridView_DoubleClick(object sender, EventArgs e)
        {
            try
            {
                HandlingDoubleClick = true;

                List<WatchedExpression> watches = (List<WatchedExpression>) watchDataGridView.DataSource;

                // Open a editor to edit the cell contents
                WatchedExpression selected = SelectedWatch;
                if (selected != null)
                {
                    DataGridViewCell selectedCell = watchDataGridView.SelectedCells[0];
                    if (selectedCell.ColumnIndex == 0)
                    {
                        EditorView.Window form = new EditorView.Window {AutoComplete = true};
                        TextChangeHandler handler = new TextChangeHandler(Instance, selected,
                            selectedCell.OwningColumn.Name);
                        form.setChangeHandler(handler);
                        form.ShowDialog();

                        watchDataGridView.DataSource = null;
                        watchDataGridView.DataSource = watches;
                        EnsureEmptyRoom();
                        Refresh();
                    }
                    else if (selectedCell.ColumnIndex == 1)
                    {
                        ExplainBox explainTextBox = new ExplainBox();
                        explainTextBox.SetExplanation(selected.ExpressionTree.Explain());
                        GuiUtils.MdiWindow.AddChildWindow(explainTextBox);
                    }
                }
            }
            finally
            {
                HandlingDoubleClick = false;
            }
        }
        /// <summary>
        ///     Handles a double click event
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void TimeLineControl_DoubleClick(object sender, EventArgs e)
        {
            ModelEvent evt = GetEventUnderMouse();

            VariableUpdate variableUpdate = evt as VariableUpdate;
            if (variableUpdate != null)
            {
                EditorView.Window form = new EditorView.Window();
                TimeLineExpressionableTextChangeHandler handler = new TimeLineExpressionableTextChangeHandler(this,
                    variableUpdate.Action);
                form.setChangeHandler(handler);
                GuiUtils.MdiWindow.AddChildWindow(form, DockAreas.Float);
            }

            Expect expect = evt as Expect;
            if (expect != null)
            {
                EditorView.Window form = new EditorView.Window();
                TimeLineExpressionableTextChangeHandler handler = new TimeLineExpressionableTextChangeHandler(this,
                    expect.Expectation);
                form.setChangeHandler(handler);
                GuiUtils.MdiWindow.AddChildWindow(form, DockAreas.Float);
            }
        }