예제 #1
0
        private void displayHullButton_Click(object sender, EventArgs e)
        {
            // take the focus anyway if we click the panel
            this.Focus();

            // create a copy of the edited layer to hold the old data (the layer can be on any type, we just want to copy the options)
            LayerText oldLayerData = new LayerText();

            oldLayerData.CopyOptionsFrom(mLayerReference);

            // create a new layer to store the new data, and reverse the display hull flag in the new data
            LayerText newLayerData = new LayerText();

            newLayerData.CopyOptionsFrom(mLayerReference);
            newLayerData.DisplayHulls = !mLayerReference.DisplayHulls;

            // do a change option action
            ActionManager.Instance.doAction(new ChangeLayerOption(mLayerReference, oldLayerData, newLayerData));
        }
예제 #2
0
        private void buttonOk_Click(object sender, EventArgs e)
        {
            // create a copy of the edited layer to hold the old data
            LayerText oldLayerData = new LayerText();

            oldLayerData.CopyOptionsFrom(mEditedLayer);

            // create a new layer to store the new data
            LayerText newLayerData = new LayerText();

            // name and visibility
            newLayerData.Name    = this.nameTextBox.Text;
            newLayerData.Visible = this.isVisibleCheckBox.Checked;

            //transparency
            newLayerData.Transparency = (int)(this.alphaNumericUpDown.Value);

            // hull
            newLayerData.DisplayHulls  = this.displayHullCheckBox.Checked;
            newLayerData.PenToDrawHull = new Pen(mHullColor, (int)hullThicknessNumericUpDown.Value);

            // do a change option action
            ActionManager.Instance.doAction(new ChangeLayerOption(mEditedLayer, oldLayerData, newLayerData));
        }