示例#1
0
        public JSUIComboBox(ObjectInstance prototype, JSUI parent)
            : base(prototype.Engine, ((ClrFunction)prototype.Engine.Global["UIComboBox"]).InstancePrototype)
        {
            this.PopulateFunctions();

            JSScript script = ScriptManager.Scripts.Find(x => x.ScriptName == this.Engine.ScriptName);

            if (script != null)
            {
                script.Elements.Add(this);
            }

            this.Shadow     = new List <String>();
            this.UIComboBox = new ComboBox();
            this.UIComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
            this.UIComboBox.Width         = 120;
            this.UIComboBox.Location      = new Point(32, 32);
            this.ID       = String.Empty;
            this._x       = 0;
            this._y       = 0;
            this._visible = true;
            this._enabled = true;
            this._width   = 100;
            this.UIComboBox.SelectedIndexChanged += this.UIComboBoxSelectedIndexChanged;
            parent.UIPanel.Controls.Add(this.UIComboBox);
        }
示例#2
0
        public JSUIImage(ObjectInstance prototype, JSUI parent)
            : base(prototype.Engine, ((ClrFunction)prototype.Engine.Global["UIImage"]).InstancePrototype)
        {
            this.PopulateFunctions();

            JSScript script = ScriptManager.Scripts.Find(x => x.ScriptName == this.Engine.ScriptName);

            if (script != null)
            {
                script.Elements.Add(this);
                this.DataPath = script.DataPath;
            }

            this.UIImage           = new PictureBox();
            this.UIImage.BackColor = Color.Transparent;
            this.UIImage.Width     = 200;
            this.UIImage.Height    = 200;
            this.UIImage.Location  = new Point(32, 32);
            this.UIImage.SizeMode  = PictureBoxSizeMode.Normal;
            this.ID                  = String.Empty;
            this._x                  = 0;
            this._y                  = 0;
            this._visible            = true;
            this._width              = 200;
            this._height             = 200;
            this._resize             = false;
            this._hand               = false;
            this.UIImage.MouseClick += this.UIImageMouseClick;
            parent.UIPanel.Controls.Add(this.UIImage);
        }
示例#3
0
        public JSUIGroupBox(ObjectInstance prototype, JSUI parent)
            : base(prototype.Engine, ((ClrFunction)prototype.Engine.Global["UIGroupBox"]).InstancePrototype)
        {
            this.PopulateFunctions();

            JSScript script = ScriptManager.Scripts.Find(x => x.ScriptName == this.Engine.ScriptName);

            if (script != null)
            {
                script.Elements.Add(this);
            }

            this.UIGroupBox          = new GroupBox();
            this.UIGroupBox.Text     = String.Empty;
            this._value              = String.Empty;
            this.UIGroupBox.Location = new Point(32, 32);
            this._x = 0;
            this._y = 0;
            this.UIGroupBox.Width  = 100;
            this._width            = 100;
            this.UIGroupBox.Height = 100;
            this._height           = 100;
            this.ID = String.Empty;
            parent.UIPanel.Controls.Add(this.UIGroupBox);
        }
示例#4
0
        public JSUIListBox(ObjectInstance prototype, JSUI parent)
            : base(prototype.Engine, ((ClrFunction)prototype.Engine.Global["UIListBox"]).InstancePrototype)
        {
            this.PopulateFunctions();

            JSScript script = ScriptManager.Scripts.Find(x => x.ScriptName == this.Engine.ScriptName);

            if (script != null)
            {
                script.Elements.Add(this);
            }

            this.Shadow    = new List <String>();
            this.UIListBox = new ListBox();
            this.UIListBox.FormattingEnabled   = true;
            this.UIListBox.Width               = 100;
            this.UIListBox.Height              = 100;
            this.UIListBox.ScrollAlwaysVisible = true;
            this.UIListBox.HorizontalScrollbar = false;
            this.UIListBox.Location            = new Point(32, 32);
            this._x       = 0;
            this._y       = 0;
            this.ID       = String.Empty;
            this._visible = true;
            this._enabled = true;
            this._width   = 100;
            this._height  = 100;
            this.UIListBox.SelectedIndexChanged += this.UIListBoxSelectedIndexChanged;
            this.UIListBox.MouseDoubleClick     += this.UIListBoxMouseDoubleClick;
            parent.UIPanel.Controls.Add(this.UIListBox);
        }
示例#5
0
        public JSUILabel(ObjectInstance prototype, JSUI parent)
            : base(prototype.Engine, ((ClrFunction)prototype.Engine.Global["UILabel"]).InstancePrototype)
        {
            this.PopulateFunctions();

            JSScript script = ScriptManager.Scripts.Find(x => x.ScriptName == this.Engine.ScriptName);

            if (script != null)
            {
                script.Elements.Add(this);
            }

            this.UILabel           = new Label();
            this.UILabel.BackColor = Color.Transparent;
            this.UILabel.Font      = new Font("Tahoma", (float)9, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0)));
            this.UILabel.AutoSize  = true;
            this.UILabel.Location  = new Point(32, 32);
            this._x                  = 0;
            this._y                  = 0;
            this.UILabel.Text        = String.Empty;
            this._value              = String.Empty;
            this.ID                  = String.Empty;
            this._visible            = true;
            this._enabled            = true;
            this._link               = false;
            this._size               = 9;
            this.UILabel.ForeColor   = Color.Black;
            this.UILabel.MouseClick += this.UILabelMouseClick;
            parent.UIPanel.Controls.Add(this.UILabel);
        }
示例#6
0
        public JSUITextArea(ObjectInstance prototype, JSUI parent)
            : base(prototype.Engine, ((ClrFunction)prototype.Engine.Global["UITextArea"]).InstancePrototype)
        {
            this.PopulateFunctions();

            JSScript script = ScriptManager.Scripts.Find(x => x.ScriptName == this.Engine.ScriptName);

            if (script != null)
            {
                script.Elements.Add(this);
            }

            this.UITextBox            = new TextBox();
            this.UITextBox.Font       = new Font("Tahoma", (float)9, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0)));
            this.UITextBox.Multiline  = true;
            this.UITextBox.ScrollBars = ScrollBars.Vertical;
            this.UITextBox.Text       = String.Empty;
            this._value             = String.Empty;
            this.UITextBox.Location = new Point(32, 32);
            this._x = 0;
            this._y = 0;
            this.UITextBox.Width  = 100;
            this._width           = 100;
            this.UITextBox.Height = 100;
            this._height          = 100;
            this.ID                     = String.Empty;
            this._visible               = true;
            this._enabled               = true;
            this._readonly              = false;
            this.UITextBox.KeyPress    += this.UITextBoxKeyPress;
            this.UITextBox.TextChanged += this.UITextBoxTextChanged;
            this.UITextBox.MouseClick  += this.UITextBoxMouseClick;
            parent.UIPanel.Controls.Add(this.UITextBox);
        }
示例#7
0
        public JSUIButton(ObjectInstance prototype, JSUI parent)
            : base(prototype.Engine, ((ClrFunction)prototype.Engine.Global["UIButton"]).InstancePrototype)
        {
            this.PopulateFunctions();

            JSScript script = ScriptManager.Scripts.Find(x => x.ScriptName == this.Engine.ScriptName);

            if (script != null)
            {
                script.Elements.Add(this);
            }

            this.UIButton = new Button();
            this.UIButton.UseVisualStyleBackColor = true;
            this.UIButton.Width    = 75;
            this.UIButton.Height   = 25;
            this.UIButton.Text     = String.Empty;
            this.UIButton.Location = new Point(32, 32);
            this._x                   = 0;
            this._y                   = 0;
            this._value               = String.Empty;
            this._visible             = true;
            this._enabled             = true;
            this._width               = 75;
            this._height              = 25;
            this.ID                   = String.Empty;
            this.UIButton.MouseClick += this.UIButtonMouseClick;
            parent.UIPanel.Controls.Add(this.UIButton);
        }
示例#8
0
        public JSUITextBox(ObjectInstance prototype, JSUI parent)
            : base(prototype.Engine, ((ClrFunction)prototype.Engine.Global["UITextBox"]).InstancePrototype)
        {
            this.PopulateFunctions();

            JSScript script = ScriptManager.Scripts.Find(x => x.ScriptName == this.Engine.ScriptName);

            if (script != null)
            {
                script.Elements.Add(this);
            }

            this.UITextBox          = new TextBox();
            this.UITextBox.Text     = String.Empty;
            this._value             = String.Empty;
            this.UITextBox.Location = new Point(32, 32);
            this._x = 0;
            this._y = 0;
            this.UITextBox.Width = 100;
            this._width          = 100;
            this.ID                     = String.Empty;
            this._visible               = true;
            this._enabled               = true;
            this._readonly              = false;
            this.UITextBox.KeyPress    += this.UITextBoxKeyPress;
            this.UITextBox.TextChanged += this.UITextBoxTextChanged;
            this.UITextBox.MouseClick  += this.UITextBoxMouseClick;
            parent.UIPanel.Controls.Add(this.UITextBox);
        }
示例#9
0
        public JSUICheckBox(ObjectInstance prototype, JSUI parent)
            : base(prototype.Engine, ((ClrFunction)prototype.Engine.Global["UICheckBox"]).InstancePrototype)
        {
            this.PopulateFunctions();

            JSScript script = ScriptManager.Scripts.Find(x => x.ScriptName == this.Engine.ScriptName);

            if (script != null)
            {
                script.Elements.Add(this);
            }

            this.UICheckBox           = new CheckBox();
            this.UICheckBox.BackColor = Color.Transparent;
            this.UICheckBox.Location  = new Point(32, 32);
            this.UICheckBox.AutoSize  = true;
            this.UICheckBox.UseVisualStyleBackColor = true;
            this._x = 0;
            this._y = 0;
            this.UICheckBox.Text = String.Empty;
            this._value          = String.Empty;
            this.ID       = String.Empty;
            this._visible = true;
            this._enabled = true;
            this._checked = false;
            this.UICheckBox.CheckedChanged += this.UICheckBoxCheckedChanged;
            parent.UIPanel.Controls.Add(this.UICheckBox);
        }
示例#10
0
        public JSUIRadioButton(ObjectInstance prototype, JSUI parent, String group)
            : base(prototype.Engine, ((ClrFunction)prototype.Engine.Global["UIRadioButton"]).InstancePrototype)
        {
            this.PopulateFunctions();

            JSScript script = ScriptManager.Scripts.Find(x => x.ScriptName == this.Engine.ScriptName);

            if (script != null)
            {
                script.Elements.Add(this);
            }

            this.UIRadioButton           = new RadioButton();
            this.UIRadioButton.BackColor = Color.Transparent;
            this.UIRadioButton.UseVisualStyleBackColor = true;
            this.UIRadioButton.AutoSize = true;
            this.UIRadioButton.Location = new Point(32, 32);
            this.ID                 = String.Empty;
            this._group             = group;
            this._x                 = 0;
            this._y                 = 0;
            this.UIRadioButton.Text = String.Empty;
            this._value             = String.Empty;
            this._visible           = true;
            this._enabled           = true;

            int count = 0;

            if (script != null)
            {
                foreach (ICustomUI ctrl in script.Elements)
                {
                    if (!string.IsNullOrEmpty(ctrl.Group))
                    {
                        if (ctrl.Group == group)
                        {
                            count++;
                        }
                    }
                }
            }

            this._checked = count == 1;
            this.UIRadioButton.Checked         = count == 1;
            this.UIRadioButton.CheckedChanged += this.UIRadioButtonCheckedChanged;
            parent.UIPanel.Controls.Add(this.UIRadioButton);
        }