Example #1
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="title"></param>
        /// <param name="caption"></param>
        /// <param name="type">string/int</param>
        public VSInputBox(string title, string caption, string default_value = "", bool numeric = false)
        {
            InitializeComponent();
            this.type = numeric? "int" : "string";

            this.Text = title;

            pn_control = new VSUIPanel(pnMain, "main");
            pn_control.Load(VSUILIB.Properties.Resources.VSInputBox);
            VSUIControl c = new VSUIControl("inpt");

            c.Value   = default_value;
            c.Caption = caption;
            pn_control.Set(c);
            pn_control.Display();
        }
Example #2
0
        private void cbNodeType_SelectedIndexChanged(object sender, EventArgs e)
        {
            short type = n_type_code[cbNodeType.SelectedIndex];

            VSUIControl[] controls = new VSUIControl[5];
            controls[0]         = new VSUIControl("select");
            controls[0].Visible = (type == DEFX.NODE_TYPE_CONTENT);

            controls[1]         = new VSUIControl("file");
            controls[1].Visible = (type == DEFX.NODE_TYPE_CONTENT);

            controls[2]         = new VSUIControl("title");
            controls[2].Visible = (type == DEFX.NODE_TYPE_CONTENT);

            controls[3]         = new VSUIControl("value");
            controls[3].Caption = (type == DEFX.NODE_TYPE_CATALOG) ? "Title:" : "Value:";

            controls[4] = new VSUIControl("name");

            if ((type == DEFX.NODE_TYPE_CONTENT) | (type == DEFX.NODE_TYPE_COMMENT) | (type == DEFX.NODE_TYPE_TEXT) | (type == DEFX.NODE_TYPE_TAG))
            {
                controls[4].Value = DEFX.GET_NODETYPE(type);
            }
            else
            {
                controls[4].Value = "";
            }

            controls[4].Enabled = (controls[4].Value == "");

            g.Set(controls);

            if (!controls[4].Enabled)
            {
                controls[4].Value = "";
            }
            else
            {
                g.SetFocus("name");
            }

            btnCreate.Enabled = (cbNodeType.SelectedIndex >= 0);
        }