Пример #1
0
        public override void InitDialogSettings()
        {
            srcCS = "//Text Input Control settings" + CRLF;
            srcVB = "'Text Input Control settings" + CRLF;

            if ((!checkDisplayControl.Checked) || (ControlCaption.Length == 0))
            {
                DlgMgr.EnableTextInputCtrl();
                srcCS += "DlgMgr.EnableTextInputCtrl();" + CRLF;
                srcVB += "DlgMgr.EnableTextInputCtrl()" + CRLF;
            }
            else
            {
                DlgMgr.EnableTextInputCtrl(ControlCaption, ControlWidth, ControlHeight, ControlStyle);

                srcCS += "DlgMgr.EnableTextInputCtrl(" + CSNxt +
                         "\"" + ControlCaption + "\", " + CSNxt +
                         ControlWidth.ToString() + ", " + ControlHeight.ToString() + ", " + CSNxt +
                         ((int)ControlStyle).ToString() + ");" + CRLF;

                srcVB += "DlgMgr.EnableTextInputCtrl(" + VBNxt +
                         "\"" + ControlCaption + "\"," + VBNxt +
                         ControlWidth.ToString() + ", " + ControlHeight.ToString() + "," + VBNxt +
                         ((int)ControlStyle).ToString() + ")" + CRLF;
            }
        }
        protected void SetNavViewHeight(ControlHeight height)
        {
            ComboBox heightComboBox = new ComboBox(FindElement.ByName("HeightCombobox"));
            string   currentHeight  = "Default";

            if (heightComboBox.Selection.Count > 0)
            {
                ComboBoxItem selectedComboBoxItem = heightComboBox.Selection[0];
                currentHeight = selectedComboBoxItem.Name;
                Log.Comment("Current height " + currentHeight);
            }

            Log.Comment("Changing height to " + height.ToString());
            heightComboBox.SelectItemByName(height.ToString());
        }
Пример #3
0
 private void SetControlHeight(ControlHeight height)
 {
     SetComboBox("HeightComboBox", height.ToString());
 }
        public override string RenderHtml()
        {
            string name       = "mvcdynamicfield_" + _key;
            var    html       = new StringBuilder();
            string ErrorStyle = string.Empty;

            var commandButtonTag = new TagBuilder("button");

            //commandButtonTag.Attributes.Add("text", Prompt);
            commandButtonTag.InnerHtml = Prompt;
            commandButtonTag.Attributes.Add("id", name);
            commandButtonTag.Attributes.Add("name", "Relate");
            //commandButtonTag.Attributes.Add("name", name);
            commandButtonTag.Attributes.Add("type", "button");

            commandButtonTag.Attributes.Add("onclick", "NavigateToChild(" + RelatedViewId + ");");
            string IsHiddenStyle      = "";
            string IsHighlightedStyle = "";

            if (_IsHidden)
            {
                IsHiddenStyle = "display:none";
            }

            if (_IsHighlighted)
            {
                IsHighlightedStyle = "background-color:yellow";
            }

            if (_IsDisabled)
            {
                commandButtonTag.Attributes.Add("disabled", "disabled");
            }

            // commandButtonTag.Attributes.Add("style", "position:absolute;left:" + _left.ToString() + "px;top:" + _top.ToString() + "px" + ";width:" + _Width.ToString() + "px" + ";height:" + _Height.ToString() + "px" + ErrorStyle + ";" + IsHiddenStyle + ";" + IsHighlightedStyle);
            commandButtonTag.Attributes.Add("style", "position:absolute;left:" + _left.ToString() + "px;top:" + _top.ToString() + "px" + ";width:" + ControlWidth.ToString() + "px" + ";height:" + ControlHeight.ToString() + "px" + ErrorStyle + ";" + IsHiddenStyle + ";" + IsHighlightedStyle);
            EnterRule FunctionObjectAfter = (EnterRule)_form.FormCheckCodeObj.GetCommand("level=field&event=after&identifier=" + _key);

            if (FunctionObjectAfter != null && !FunctionObjectAfter.IsNull())
            {
                commandButtonTag.Attributes.Add("onblur", "return " + _key + "_after();"); //After
            }
            EnterRule FunctionObjectBefore = (EnterRule)_form.FormCheckCodeObj.GetCommand("level=field&event=before&identifier=" + _key);

            if (FunctionObjectBefore != null && !FunctionObjectBefore.IsNull())
            {
                commandButtonTag.Attributes.Add("onfocus", "return " + _key + "_before();"); //Before
            }
            EnterRule FunctionObjectClick = (EnterRule)_form.FormCheckCodeObj.GetCommand("level=field&event=click&identifier=" + _key);

            if (FunctionObjectClick != null && !FunctionObjectClick.IsNull())
            {
                commandButtonTag.Attributes.Add("onclick", "return " + _key + "_click();");
            }

            //   html.Append(commandButtonTag.ToString(TagRenderMode.SelfClosing));
            html.Append(commandButtonTag.ToString());
            var scriptBuilder = new TagBuilder("script");

            scriptBuilder.InnerHtml = "$('#" + name + "').BlockEnter('" + name + "');";
            scriptBuilder.ToString(TagRenderMode.Normal);
            html.Append(scriptBuilder.ToString(TagRenderMode.Normal));

            var wrapper = new TagBuilder(_fieldWrapper);

            wrapper.Attributes["class"] = _fieldWrapperClass;
            if (_IsHidden)
            {
                wrapper.Attributes["style"] = "display:none";
            }
            wrapper.Attributes["id"] = name + "_fieldWrapper";
            wrapper.InnerHtml        = html.ToString();
            return(wrapper.ToString());
        }