internal static void EnteredTextChanged() { lock (lock_object) { ParameterInput.suggestionsDisplayed = ParameterInput.GetSuggestionsToDisplay(formParameterBox.tbParameter.Text); if (ParameterInput.suggestionsDisplayed.Count > 0) { formSuggestionsList.Top = formParameterBox.parameterBoxRectangle.Bounds.Bottom + formParameterBox.Top; formSuggestionsList.Left = formParameterBox.parameterBoxRectangle.Bounds.Left + formParameterBox.Left; formSuggestionsList.TopMost = true; //if (ParameterInput.suggestionsSelectionIndex > suggestionsOffset + suggestionsDisplayed.Count - 1) //{ ParameterInput.suggestionsSelectionIndex = suggestionsOffset; //suggestionsOffset + suggestionsDisplayed.Count - 1; //} formSuggestionsList.Show(); formSuggestionsList.DrawAll(ParameterInput.suggestionsDisplayed, suggestionsOffset, formParameterBox.tbParameter.Text, ParameterInput.suggestionsSelectionIndex); formParameterBox.tbParameter.Focus(); } else { ParameterInput.suggestionsSelectionIndex = -1; if (formSuggestionsList != null) { formSuggestionsList.Hide(); } } } }
private void tbParameter_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Up) { ParameterInput.MoveUpSuggesstionSelection(); e.SuppressKeyPress = true; } else if (e.KeyCode == Keys.Down) { ParameterInput.MoveDownSuggesstionSelection(); e.SuppressKeyPress = true; } else if (e.KeyCode == Keys.Enter) { ParameterInput.Accept(); e.SuppressKeyPress = true; } else if (e.KeyCode == Keys.Escape) { ParameterInput.Cancel(); e.SuppressKeyPress = true; } else { e.SuppressKeyPress = ParameterInput._readOnly; } }
private void textBox1_TextChanged(object sender, EventArgs e) { if (!ParameterInput._readOnly) { ParameterInput.EnteredTextChanged(); } }
private void FormParameterBox_VisibilityChanged(object sender, EventArgs e) { if (this.Visible) { if (ParameterInput._readOnly) { ParameterInput.EnteredTextChanged(); } Focus(); this._tickCount = 0; this.timer1.Enabled = true; } }