Exemplo n.º 1
0
 // Token: 0x0600030E RID: 782 RVA: 0x00018C10 File Offset: 0x00016E10
 internal void ShowCheckBox(string label, EditValue edit, Action <float> func)
 {
     GUILayout.BeginHorizontal(new GUILayoutOption[0]);
     try
     {
         GUILayout.Label(label, this.uiParams.lStyle, new GUILayoutOption[]
         {
             this.optItemHeight
         });
         GUILayout.Space((float)this.uiParams.marginL);
         float      num     = edit.val;
         GUIContent content = NumberUtil.Equals(num, 0f, 0.001f) ? ResourceHolder.Instance.Checkoff : ResourceHolder.Instance.Checkon;
         if (GUILayout.Button(content, this.bStyleCenter, new GUILayoutOption[]
         {
             GUILayout.Width(50f)
         }))
         {
             num = 1f - num;
             edit.Set(num);
             func(num);
         }
     }
     finally
     {
         GUILayout.EndHorizontal();
     }
 }
 void CustomFilterMemoEditControl_EditValueChanged(object sender, EditValueChangedEventArgs e)
 {
     if (EditValue != null)
     {
         _filter = EditValue.ToString();
     }
 }
Exemplo n.º 3
0
    public override void Init(Main m, SceneActor actor, EditValue ev)
    {
        this.resetValue = ev.val.Clone();
        base.Init(m, actor, ev);

        resetButton.onClick.AddListener(this.OnButtonReset);
    }
        private void OnShowFilterView()
        {
            // показываем фильтр пользователю
            var viewService = GetViewService();
            var filterModel = new FilterViewModel {
                IsFilterMode = false, FilterExpression = _filter, MaxRowCount = null
            };

            if (_fields != null)
            {
                foreach (var field in _fields)
                {
                    filterModel.Fields.Add(field);
                }
            }

            var res = viewService.ShowDialogWindow(filterModel, true, false, "40%", "50%");

            if (!res.HasValue || !res.Value)
            {
                return;
            }
            filterModel.MaxRowCount = null;
            filterModel.AcceptChanges();

            var retFilter = filterModel.GetSqlExpression();

            EditValue = string.IsNullOrEmpty(retFilter) ? EditValue : retFilter;
            _filter   = EditValue.ToString();
        }
        private void InitType()
        {
            // Color生成
            var colProps = type.colProps;

            this.editColors = new EditColor[colProps.Length];
            for (int i = 0; i < colProps.Length; i++)
            {
                var colProp = colProps[i];
                var ec      = new EditColor(null, colProp.colorType);
                if (material != null)
                {
                    ec.Set(material.GetColor(colProps[i].propId));
                }
                else
                {
                    ec.Set(colProps[i].defaultVal);
                }
                editColors[i] = ec;
            }

            // float生成
            var props = type.fProps;

            this.editVals = new EditValue[props.Length];
            for (int i = 0; i < props.Length; i++)
            {
                float val = props[i].defaultVal;
                if (material != null)
                {
                    val = material.GetFloat(props[i].propId);
                }
                editVals[i] = new EditValue(val, props[i].range);
            }
        }
Exemplo n.º 6
0
 public ActionResult EditPosition(EditValue editValue)
 {
     if (ModelState.IsValid)
     {
         AlcoholBase.EditPosition(editValue.Types, (int)editValue.Pos, (uint)editValue.Quantity, (uint)editValue.Prise);
     }
     return(Redirect($"/Home/ByTypes?types={editValue.Types}"));
 }
Exemplo n.º 7
0
        // Token: 0x06000322 RID: 802 RVA: 0x000193A4 File Offset: 0x000175A4
        internal void SetupFloatSlider(string label, EditValue edit, float sliderMin, float sliderMax, Action <float> func, PresetOperation[] presetOprs, float[] vals1, float[] vals2)
        {
            GUILayout.BeginHorizontal(new GUILayoutOption[0]);
            GUILayout.Label(label, this.uiParams.lStyle, new GUILayoutOption[]
            {
                this.optItemHeight
            });
            GUILayout.Space((float)this.uiParams.marginL);
            bool           changed = false;
            Action <float> action  = delegate(float val)
            {
                GUIContent guicontent2 = new GUIContent(val.ToString(CultureInfo.InvariantCulture));
                if (!GUILayout.Button(guicontent2, this.bStyleSS, new GUILayoutOption[]
                {
                    this.getWidthOpt(guicontent2)
                }))
                {
                    return;
                }
                edit.Set(val);
                changed = true;
            };

            if (vals1 != null)
            {
                foreach (float obj in vals1)
                {
                    action(obj);
                }
            }
            if (vals2 != null)
            {
                foreach (float obj2 in vals2)
                {
                    action(obj2);
                }
            }
            if (presetOprs != null)
            {
                foreach (PresetOperation presetOperation in presetOprs)
                {
                    GUIContent guicontent = new GUIContent(presetOperation.label);
                    if (GUILayout.Button(guicontent, this.bStyleSS, new GUILayoutOption[]
                    {
                        this.getWidthOpt(guicontent)
                    }))
                    {
                        edit.SetWithCheck(presetOperation.func(edit.val));
                        changed = true;
                    }
                }
            }
            GUILayout.EndHorizontal();
            if (changed || this.DrawValueSlider(null, edit, sliderMin, sliderMax))
            {
                func(edit.val);
            }
        }
        internal void SetupFloatSlider(string label, EditValue edit, float sliderMin, float sliderMax,
                                       Action <float> func, PresetOperation[] presetOprs, float[] vals1, float[] vals2)
        {
            GUILayout.BeginHorizontal();
            GUILayout.Label(label, uiParams.lStyle, optItemHeight);
            GUILayout.Space(uiParams.marginL);

            var changed = false;

            Action <float> preset = (val) => {
                var cont = new GUIContent(val.ToString(CultureInfo.InvariantCulture));
                if (!GUILayout.Button(cont, bStyleSS, getWidthOpt(cont)))
                {
                    return;
                }

                edit.Set(val);
                changed = true;
            };

            if (vals1 != null)
            {
                foreach (var val in vals1)
                {
                    preset(val);
                }
            }

            if (vals2 != null)
            {
                foreach (var val in vals2)
                {
                    preset(val);
                }
            }

            if (presetOprs != null)
            {
                foreach (var pset in presetOprs)
                {
                    var cont = new GUIContent(pset.label);
                    if (!GUILayout.Button(cont, bStyleSS, getWidthOpt(cont)))
                    {
                        continue;
                    }

                    edit.SetWithCheck(pset.func(edit.val));
                    changed = true;
                }
            }

            GUILayout.EndHorizontal();

            if (changed || DrawValueSlider(null, edit, sliderMin, sliderMax))
            {
                func(edit.val);
            }
        }
Exemplo n.º 9
0
        internal void ShowComboBox(string label, EditValue edit, Action <int> func)
        {
            var idx = (int)edit.val;

            if (ShowComboBox(label, CompareFuncs, ref compareCombo, ref idx, func))
            {
                edit.Set(idx);
            }
        }
Exemplo n.º 10
0
        // Token: 0x0600030C RID: 780 RVA: 0x00018AF0 File Offset: 0x00016CF0
        internal void ShowComboBox(string label, EditValue edit, Action <int> func)
        {
            int num = (int)edit.val;

            if (this.ShowComboBox(label, CheckboxHelper.CompareFuncs, ref this.compareCombo, ref num, func))
            {
                edit.Set((float)num);
            }
        }
Exemplo n.º 11
0
 protected override void OnEditorKeyDown(KeyEventArgs e)
 {
     if ((this.EditValue != null) && (isKeyTagAdd(e.KeyCode)) && (!String.IsNullOrWhiteSpace(EditValue.ToString())))
     {
         Properties.Tags.Add(new EditorButton()
         {
             Caption = EditValue.ToString().Trim()
         });
     }
 }
Exemplo n.º 12
0
        /// <summary>
        /// Sets initial edited or selected index.
        /// </summary>
        private void SetSelectedValue()
        {
            if (EditValue.Equals(NullValue) && RememberSessionValues)
            {
                GetSessionValue();
            }

            SelectedIndex = Items.IndexOf(Items.FindByValue(EditValue.ToString()));

            EditValue = NullValue;
        }
Exemplo n.º 13
0
 private void ButtonRecoverFormat_ItemClick(object sender, ItemClickEventArgs e)
 {
     if (DefaultLayoutData.IsNotNullOrEmpty())
     {
         if (UIPublic.ShowYesNoDialog("您是否需要默认格式?") == DialogReturn.Yes)
         {
             EditorPublic.RemoveEditControllerFromStorage(EditValue.GetType(), Controller.GetType());
             this.PropertyGridControl.SetLayoutData(DefaultLayoutData);
         }
     }
 }
Exemplo n.º 14
0
 private void UpdateTextFromEditValue()
 {
     if (EditValue != null && EditValue.ToString() != string.Empty)
     {
         _textBox.Text = GetDisplayValue(EditValue);
     }
     else
     {
         _textBox.Text = "";
     }
 }
        protected override Size CalcPopupFormSize()
        {
            if (EditValue != null)
            {
                if (EditValue.ToString() == "")
                {
                    blobForm.ClearPopupContainerContent();
                }
            }

            return(blobForm.CalcBlobPopupFormSize());
        }
 public bool DrawValueSlider(string label, EditValue edit, float min, float max)
 {
     return(DrawValueSlider(label, edit,
                            () => {
         var sliderVal = edit.val;
         if (DrawSlider(ref sliderVal, min, max))
         {
             edit.Set(sliderVal);
             return true;
         }
         return false;
     }));
 }
Exemplo n.º 17
0
 // Token: 0x06000329 RID: 809 RVA: 0x00019C44 File Offset: 0x00017E44
 public bool DrawValueSlider(string label, EditValue edit, float min, float max)
 {
     return(this.DrawValueSlider <float>(label, edit, delegate()
     {
         float val = edit.val;
         if (this.DrawSlider(ref val, min, max))
         {
             edit.Set(val);
             return true;
         }
         return false;
     }));
 }
Exemplo n.º 18
0
    public override void Init(Main m, SceneActor actor, EditValue ev)
    {
        base.Init(m, actor, ev);

        this.input.onEndEdit.AddListener(
            (x) =>
        {
            this.OnTextChange();
        });

        SetupWidgetDrag(this.Mgr, this.actor, this.btnSpinner, this.EV, this);

        this.OnUpdateValue();
    }
Exemplo n.º 19
0
    public override void Init(Main m, SceneActor actor, EditValue ev)
    {
        base.Init(m, actor, ev);

        this.toggle.onValueChanged.AddListener(
            (x) =>
        {
            this.EV.val.SetBool(this.toggle.isOn);
            this.OnUpdateValue();
            this.Mgr.NotifyActorModified(this.actor, ev.name);
        });

        this.OnUpdateValue();
    }
Exemplo n.º 20
0
        private void gridEdit_Click(object sender, EventArgs e)
        {
            EditValue    addValue = new EditValue(treeViewRegistery.SelectedNode.FullPath, gridValues.SelectedRows[0].Cells[0].Value.ToString());
            DialogResult result   = addValue.ShowDialog();

            if (result == DialogResult.OK)
            {
                BindValues(treeViewRegistery.SelectedNode);
            }
            else
            {
                MessageBox.Show("عملیات توسط کاربر لغو شد.", "ویرایش", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Exemplo n.º 21
0
        void OnWriteDataClick(object sender, EventArgs e)
        {
            NodeData data = (NodeData)(sender as ToolStripItem).Tag;

            EditValue    ev = new EditValue(data);
            DialogResult r  = ev.ShowDialog();

            if (r == DialogResult.OK)
            {
                if (data != null && data.GetIedNode() != null && data.GetIedNode().SCLServerRunning != null)
                {
                    data.GetIedNode().SCLServerRunning.UpdateServerData(data, null, false, ev.TimeNode, ev.UpdateTimestamp);
                }
            }
        }
 protected override void OnEditValueChanged()
 {
     base.OnEditValueChanged();
     if (EditValue != null)
     {
         if (EditValue.ToString() != "")
         {
             SetMenuItemEnabledMode(true);
             FileInfo info = GetFileInfo();
             if (blobForm != null)
             {
                 RetrieveInformation(info);
             }
         }
     }
 }
        // 編集前と後でオブジェクトを分ける場合用(未使用)
        public ACCMaterial(ACCMaterial src)
        {
            this.original = src;
            this.renderer = src.renderer;
            this.material = src.material;
            this.name     = src.name;
            //this.shader = src.shader;
            //this.type1 = src.type1;
            this.type = src.type;

            this.renderQueue = src.renderQueue;

            // TODO 配列の中身はディープコピーとする
            this.editColors = src.editColors;
            this.editVals   = src.editVals;
        }
Exemplo n.º 24
0
        void OnWriteDataClick(object sender, EventArgs e)
        {
            NodeData data    = (NodeData)(sender as ToolStripItem).Tag;
            NodeData newdata = Iec61850Controller.PrepareWriteData(data);

            EditValue ev = new EditValue(newdata);

            ev.HideUpdateTimestamp();
            DialogResult r = ev.ShowDialog();

            if (r == DialogResult.OK)
            {
                data.DataValue = newdata.DataValue;
                ctrl.WriteData(data, true);
            }
        }
Exemplo n.º 25
0
        // 編集前と後でオブジェクトを分ける場合用(未使用)
        public ACCMaterial(ACCMaterial src)
        {
            Original = src;
            renderer = src.renderer;
            material = src.material;
            name     = src.name;
            //this.shader = src.shader;
            //this.type1 = src.type1;
            type = src.type;

            renderQueue = src.renderQueue;

            // TODO 配列の中身はディープコピーとする
            editColors = src.editColors;
            pickers    = src.pickers;
            editVals   = src.editVals;
        }
        // Token: 0x060000E3 RID: 227 RVA: 0x0000B2C4 File Offset: 0x000094C4
        public static void Write(BinaryWriter writer, ACCMaterialEx mate)
        {
            writer.Write(FileConst.HEAD_MATE);
            writer.Write(1000);
            writer.Write(mate.name1);
            writer.Write(mate.name2);
            string name = mate.type.name;

            writer.Write(name);
            string mateName = ShaderType.GetMateName(name);

            writer.Write(mateName);
            foreach (ShaderPropTex shaderPropTex in mate.type.texProps)
            {
                if (shaderPropTex.key == PropKey._RenderTex)
                {
                    writer.Write("null");
                }
                else
                {
                    writer.Write("tex2d");
                    ACCTextureEx acctextureEx = mate.texDic[shaderPropTex.key];
                    writer.Write(acctextureEx.editname);
                    writer.Write(acctextureEx.txtpath);
                    ACCMaterialEx.OUT_UTIL.Write(writer, acctextureEx.texOffset);
                    ACCMaterialEx.OUT_UTIL.Write(writer, acctextureEx.texScale);
                }
            }
            for (int j = 0; j < mate.editColors.Length; j++)
            {
                ShaderPropColor shaderPropColor = mate.type.colProps[j];
                EditColor       editColor       = mate.editColors[j];
                writer.Write(shaderPropColor.type.ToString());
                writer.Write(shaderPropColor.keyName);
                ACCMaterialEx.OUT_UTIL.Write(writer, editColor.val);
            }
            for (int k = 0; k < mate.editVals.Length; k++)
            {
                ShaderPropFloat shaderPropFloat = mate.type.fProps[k];
                EditValue       editValue       = mate.editVals[k];
                writer.Write(shaderPropFloat.type.ToString());
                writer.Write(shaderPropFloat.keyName);
                writer.Write(editValue.val);
            }
        }
Exemplo n.º 27
0
 ///--------------------------------------------------------------------------------
 /// <summary>This method sets the default values.</summary>
 ///--------------------------------------------------------------------------------
 protected override void OnSetDefaults()
 {
     if (Value.ReverseInstance != null)
     {
         EditValue.TransformDataFromObject(Value.ReverseInstance, null, false);
     }
     else if (Value.IsAutoUpdated == true)
     {
         EditValue.TransformDataFromObject(Value, null, false);
     }
     else
     {
         Value newValue = new Value();
         newValue.ValueID = EditValue.ValueID;
         EditValue.TransformDataFromObject(newValue, null, false);
     }
     EditValue.ResetModified(true);
 }
        private EditorButtonCollection ButtonsFromEditValue()
        {
            string[] Captions          = EditValue.ToString().Split(",".ToCharArray()[0]);
            EditorButtonCollection res = new EditorButtonCollection();

            foreach (string caption in Captions)
            {
                EditorButton button = new EditorButton()
                {
                    Caption = caption, IsLeft = true, Kind = ButtonPredefines.Glyph
                };
                AppearanceObject appearance = new AppearanceObject();
                appearance.TextOptions.HAlignment = HorzAlignment.Near;
                button.Appearance.Assign(appearance);
                res.Insert(0, button);
            }
            return(res);
        }
 protected override PopupBaseForm GetPopupForm()
 {
     if (blobForm == null)
     {
         blobForm = new CustomPopupForm(this);
         if (EditValue != null)
         {
             if (EditValue.ToString() != "")
             {
                 RetrieveInformation(GetFileInfo());
             }
             else
             {
                 blobForm.ClearPopupContainerContent();
             }
         }
     }
     return(blobForm);
 }
Exemplo n.º 30
0
 private void LenovoGridLookUpEdit_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e)
 {
     if (Properties.TextEditStyle == DevExpress.XtraEditors.Controls.TextEditStyles.Standard)
     {
         if (!IsPopupOpen)
         {
             try
             {
                 //if (EditValue != null && EditValue.ToString().Length > 0)
                 //{
                 //    ClosePopup();
                 //}
                 //else
                 //{
                 if (e.KeyData == Keys.Escape || e.KeyData == Keys.Return || e.Control || e.Alt || e.Shift)
                 {
                     if (e.KeyData == Keys.Escape)
                     {
                         Properties.IsEscape = true;
                     }
                     ClosePopup();
                     SelectAll();
                 }
                 else
                 {
                     if ((e.KeyCode.GetHashCode() >= 65 && e.KeyCode.GetHashCode() <= 90) ||
                         (e.KeyCode.GetHashCode() >= 48 && e.KeyCode.GetHashCode() <= 57) ||
                         (e.KeyCode.GetHashCode() >= 97 && e.KeyCode.GetHashCode() <= 105) ||
                         e.KeyCode.GetHashCode() == 91 ||
                         e.KeyCode.GetHashCode() == 8 ||
                         (EditValue != null && EditValue.ToString().Length > 0 &&
                          EditValue.ToString().Substring(EditValue.ToString().Length - 1, 1) == "?"))
                     {
                         ShowPopup();
                     }
                 }
             }
             //}
             catch { };
         }
     }
 }
Exemplo n.º 31
0
        internal static void AddTagToNode(TreeNode node, int descriptionIndex, TagType type)
        {
            TagNode tag = GetTagNode(node);
            if (tag == null)
                return;

            if (tag.GetTagType() != TagType.TAG_COMPOUND &&
                tag.GetTagType() != TagType.TAG_LIST)
                return;

            if (tag.GetTagType() == TagType.TAG_LIST &&
                tag.ToTagList().ValueType != type &&
                tag.ToTagList().Count > 0)
                return;

            TagNode newNode = null;
            switch (type)
            {
                case TagType.TAG_BYTE:
                    newNode = new TagNodeByte();
                    break;
                case TagType.TAG_SHORT:
                    newNode = new TagNodeShort();
                    break;
                case TagType.TAG_INT:
                    newNode = new TagNodeInt();
                    break;
                case TagType.TAG_LONG:
                    newNode = new TagNodeLong();
                    break;
                case TagType.TAG_FLOAT:
                    newNode = new TagNodeFloat();
                    break;
                case TagType.TAG_DOUBLE:
                    newNode = new TagNodeDouble();
                    break;
                case TagType.TAG_BYTE_ARRAY:
                    newNode = new TagNodeByteArray();
                    break;
                case TagType.TAG_STRING:
                    newNode = new TagNodeString();
                    break;
                case TagType.TAG_LIST:
                    newNode = new TagNodeList(TagType.TAG_BYTE);
                    break;
                case TagType.TAG_COMPOUND:
                    newNode = new TagNodeCompound();
                    break;
                case TagType.TAG_INT_ARRAY:
                    newNode = new TagNodeIntArray();
                    break;
            }

            if (tag is TagNodeCompound)
            {
                TagNodeCompound ctag = tag as TagNodeCompound;

                EditValue form = new EditValue("");
                foreach (string key in ctag.Keys)
                {
                    form.InvalidNames.Add(key);
                }

                if (form.ShowDialog() != DialogResult.OK)
                    return;

                ctag.Add(form.NodeName, newNode);

                TreeNode tnode = NodeFromTag(newNode, descriptionIndex, form.NodeName);
                node.Nodes.Add(tnode);

                tnode.TreeView.SelectedNode = tnode;
                tnode.Expand();
            }
            else if (tag is TagNodeList)
            {
                var ltag = tag as TagNodeList;
                if (ltag.ValueType != type)
                    ltag.ChangeValueType(type);

                ltag.Add(newNode);

                TreeNode tnode = NodeFromTag(newNode, descriptionIndex);
                node.Nodes.Add(tnode);
                tnode.TreeView.SelectedNode = tnode;

                tnode.Expand();
            }

            node.Text = GetNodeText(node);

            TreeNode baseNode = BaseNode(node);
            if (baseNode != null)
            {
                (baseNode.Tag as DataNode).Modified = true;
            }
        }
Exemplo n.º 32
0
        internal static void EditNodeValue(TreeNode node)
        {
            if (node == null)
                return;

            TagNode tag = GetTagNode(node);
            if (tag == null)
                return;

            if (tag.GetTagType() == TagType.TAG_BYTE_ARRAY ||
                tag.GetTagType() == TagType.TAG_LIST ||
                tag.GetTagType() == TagType.TAG_COMPOUND)
                return;

            EditValue form = new EditValue(tag);
            if (form.ShowDialog() == DialogResult.OK)
            {
                TreeNode baseNode = BaseNode(node);
                if (baseNode != null)
                {
                    (baseNode.Tag as DataNode).Modified = true;
                }

                node.Text = GetNodeText(node);
            }
        }
Exemplo n.º 33
0
        internal static void EditNodeName(TreeNode node)
        {
            if (node == null)
                return;

            TagNode tag = GetTagNode(node);
            if (tag == null)
                return;

            string name = GetTagNodeName(node);
            if (name == null)
                return;

            var form = new EditValue(name);

            var parentTag = GetParentTagNode(node);
            foreach (string key in parentTag.ToTagCompound().Keys)
            {
                form.InvalidNames.Add(key);
            }

            if (form.ShowDialog() == DialogResult.OK)
            {
                TreeNode baseNode = BaseNode(node);
                if (baseNode != null)
                {
                    (baseNode.Tag as DataNode).Modified = true;
                }

                SetTagNodeName(node, form.NodeName);
                node.Text = GetNodeText(node);
            }
        }
Exemplo n.º 34
0
 public void Init(EditorInfo ctl, XmlElement value)
 {
     init = new EditValue() { Editor = ctl, Value = value };
 }