/// <summary> /// Checks the expression during editing /// </summary> private void OnExpressionChanged(object sender, EventArgs e) { TestExpression(); if (!_noEvents) { LabelHelper.DrawPreview(_category, _featureSet, pctPreview, txtExpression.Text, true); RefreshControls(); } if (!_fieldSelection) { // it's user input, select the <expression> on the main tab cboField.SelectedIndex = cboField.Items.Count - 1; } btnApply.Enabled = true; }
/// <summary> /// Draws preview of the label /// </summary> private void DrawPreview() { RefreshControls(); if (_noEvents) { return; } if (_category.Visible) { string text = _categoryEdited ? _featureSet.Labels.Expression : txtExpression.Text; LabelHelper.DrawPreview(_category, _featureSet, pctPreview, text, true); } else { var img = new Bitmap(pctPreview.ClientRectangle.Width, pctPreview.ClientRectangle.Height); if (pctPreview.Image != null) { pctPreview.Image.Dispose(); } pctPreview.Image = img; } }
/// <summary> /// Updates preview of the labels /// </summary> private void DrawLabelsPreview() { LabelHelper.DrawPreview(_featureSet.Labels.Style, _featureSet, pctLabelPreview, false); }