private void buttonConfirm_Click(object sender, EventArgs e)
        {
            clickEvent ce = new clickEvent();

            if (radioButtonChangeValue.Checked)
            {
                ce.type = "ChangeValue";
                if (comboBoxCVGVarName.SelectedItem != null)
                {
                    ce.gName = comboBoxCVGVarName.SelectedItem.ToString();
                    if (textBoxCVValue.Text != "")
                    {
                        ce.value    = textBoxCVValue.Text;
                        confirmFlag = true;
                    }
                }
            }
            else if (radioButtonIncreaseValue.Checked)
            {
                ce.type = "IncreaseValue";
                if (comboBoxIVGVarName.SelectedItem != null)
                {
                    ce.gName = comboBoxIVGVarName.SelectedItem.ToString();
                    if (textBoxIVValue.Text != "")
                    {
                        ce.value    = textBoxIVValue.Text;
                        confirmFlag = true;
                    }
                }
            }
            else if (radioButtonDecreaseValue.Checked)
            {
                ce.type = "DecreaseValue";
                if (comboBoxDVGVarName.SelectedItem != null)
                {
                    ce.gName = comboBoxDVGVarName.SelectedItem.ToString();
                    if (textBoxDVValue.Text != "")
                    {
                        ce.value    = textBoxDVValue.Text;
                        confirmFlag = true;
                    }
                }
            }
            else if (radioButtonChangeProperty.Checked)
            {
                ce.type = "ChangeProperty";
                if (comboBoxProperty.SelectedItem != null)
                {
                    foreach (HMIEditorPane pane in StaticMethods.hmIEditorPaneList)
                    {
                        foreach (GUIO guio in pane.GUIOList)
                        {
                            if (guio.name == comboBoxGUIOName.SelectedItem.ToString())
                            {
                                ce.GUIOType = guio.type;
                            }
                        }
                    }
                    ce.gName    = comboBoxGUIOName.SelectedItem.ToString();
                    ce.property = comboBoxProperty.SelectedItem.ToString();
                    if (textBoxCPValue.Text != "")
                    {
                        ce.value    = textBoxCPValue.Text;
                        confirmFlag = true;
                    }
                }
            }
            else if (radioButtonChangePage.Checked)
            {
                ce.type = "ChangePage";
                if (comboBoxPageName.SelectedItem != null)
                {
                    ce.gName    = comboBoxPageName.SelectedItem.ToString();
                    confirmFlag = true;
                }
            }
            if (confirmFlag)
            {
                HMIClickEventsDialog.button.clickEvents.Add(ce);
                this.Close();
            }
            else
            {
                MessageBox.Show("유효한 값을 입력해주세요");
            }
        }
Exemple #2
0
        public GUIO Clone()
        {
            GUIO clone = new GUIO();

            clone.name            = this.name;
            clone.gVariable       = this.gVariable;
            clone.tempGVariable   = this.tempGVariable;
            clone.initialState    = this.initialState;
            clone.backgroundColor = this.backgroundColor;
            clone.layer           = this.layer;

            clone.fillColor     = this.fillColor;
            clone.lineColor     = this.lineColor;
            clone.lineThickness = this.lineThickness;

            clone.buttonColor   = this.buttonColor;
            clone.thickness     = this.thickness;
            clone.borderColor   = this.borderColor;
            clone.fontSize      = this.fontSize;
            clone.fontColor     = this.fontColor;
            clone.fontBold      = this.fontBold;
            clone.fontUnderline = this.fontUnderline;
            clone.text          = this.text;

            clone.min         = this.min;
            clone.max         = this.max;
            clone.major       = this.major;
            clone.minor       = this.minor;
            clone.needleColor = this.needleColor;
            clone.dialColor   = this.dialColor;

            clone.progressColor = this.progressColor;
            clone.orientation   = this.orientation;

            clone.sliderColor = this.sliderColor;
            clone.handleColor = this.handleColor;

            clone.password         = this.password;
            clone.pageName         = this.pageName;
            clone.numColor         = this.numColor;
            clone.numButtonColor   = this.numButtonColor;
            clone.resetColor       = this.resetColor;
            clone.resetButtonColor = this.resetButtonColor;
            clone.loginColor       = this.loginColor;
            clone.loginButtonColor = this.loginButtonColor;
            clone.funcColor        = this.funcColor;
            clone.funcButtonColor  = this.funcButtonColor;
            clone.digitNumber      = this.digitNumber;
            clone.okColor          = this.okColor;
            clone.okButtonColor    = this.okButtonColor;
            clone.labelColor       = this.labelColor;
            clone.clockColor       = this.clockColor;
            clone.ipAddress        = this.ipAddress;
            clone.port             = this.port;

            clone.location.x  = this.location.x;
            clone.location.y  = this.location.y;
            clone.size.width  = this.size.width;
            clone.size.height = this.size.height;

            clone.type    = this.type;
            clone.groupID = this.groupID;

            clone.ledColor    = this.ledColor;
            clone.bodyColor   = this.bodyColor;
            clone.digitColor  = this.digitColor;
            clone.count       = this.count;
            clone.imageName   = this.imageName;
            clone.flickering  = this.flickering;
            clone.grayScale   = this.grayScale;
            clone.url         = this.url;
            clone.transparent = this.transparent;
            clone.angle       = this.angle;
            clone.alignment   = this.alignment;

            clone.direction = this.direction;
            clone.speed     = this.speed;

            clone.startPointID      = this.startPointID;
            clone.endPointID        = this.endPointID;
            clone.duration          = this.duration;
            clone.visibleDuration   = this.visibleDuration;
            clone.invisibleDuration = this.invisibleDuration;
            clone.state             = this.state;
            clone.scrollFlag        = this.scrollFlag;
            clone.startFrame        = this.startFrame;
            clone.endFrame          = this.endFrame;

            foreach (clickEvent Event in this.clickEvents)
            {
                clickEvent cloneEvent = new clickEvent();
                cloneEvent.type     = Event.type;
                cloneEvent.number   = Event.number;
                cloneEvent.gName    = Event.gName;
                cloneEvent.GUIOType = Event.GUIOType;
                cloneEvent.property = Event.property;
                cloneEvent.value    = Event.value;
                clone.clickEvents.Add(cloneEvent);
            }

            foreach (vertex vtx in this.vertexes)
            {
                vertex cloneVtx = new vertex();
                cloneVtx.x       = vtx.x;
                cloneVtx.y       = vtx.y;
                cloneVtx.angle   = vtx.angle;
                cloneVtx.pointID = vtx.pointID;
                cloneVtx.scale   = vtx.scale;
                clone.vertexes.Add(cloneVtx);
            }

            foreach (flickeringImage img in this.flickeringImages)
            {
                flickeringImage cloneImg = new flickeringImage();
                cloneImg.imageName = img.imageName;
                clone.flickeringImages.Add(cloneImg);
            }

            return(clone);
        }