Exemplo n.º 1
0
 private void CmbKeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
 {
     if (e.KeyChar == 13 || e.KeyChar == 27)
     {
         cmbBox.Hide();
     }
 }
Exemplo n.º 2
0
 public void addDataTypes(string[] items)
 {
     this.comboBox_.Items.AddRange(items);
     comboBox_.Size     = new System.Drawing.Size(0, 0);
     comboBox_.Location = new System.Drawing.Point(0, 0);
     this.Controls.AddRange(new System.Windows.Forms.Control[] { this.comboBox_ });
     comboBox_.SelectedIndexChanged += new EventHandler(comboBox__SelectedIndexChanged);
     comboBox_.LostFocus            += new EventHandler(comboBox__LostFocus);
     comboBox_.KeyPress             += new KeyPressEventHandler(comboBox__KeyPress);
     comboBox_.Font          = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
     comboBox_.BackColor     = Color.LightYellow;
     comboBox_.DropDownStyle = ComboBoxStyle.DropDownList;
     comboBox_.Hide();
 }
Exemplo n.º 3
0
        private void checkBox1_CheckedChanged(object sender, EventArgs e)
        {
            _mergeModels = checkBox1.Checked;
            if (_mergeModels)
            {
                label1.Hide();
                comboBox1.Hide();
                _baseInf = (IMatrixNode)_externalModel._linker.BoneCache[0];
                switch (comboBox3.SelectedIndex)
                {
                case 0:
                    label2.Text = "Add base bone \"" + _baseInf + "\" to the children of: ";
                    break;

                case 1:
                    label2.Text = "With base bone \"" + _baseInf + "\", replace: ";
                    break;

                case 2:
                    label2.Text = "Merge base bone \"" + _baseInf + "\" with: ";
                    break;
                }
            }
            else
            {
                label1.Show();
                comboBox1.Show();
                getBaseInfluence();
            }
        }
Exemplo n.º 4
0
        private void GetBaseInfluence()
        {
            ResourceNode[] boneCache = _externalModel._linker.BoneCache;
            if ((_node = (MDL0ObjectNode)comboBox1.SelectedItem).Weighted)
            {
                int least = int.MaxValue;
                foreach (IMatrixNode inf in _node.Influences)
                {
                    if (inf is MDL0BoneNode && ((MDL0BoneNode)inf).BoneIndex < least)
                    {
                        least = ((MDL0BoneNode)inf).BoneIndex;
                    }
                }

                if (least != int.MaxValue)
                {
                    MDL0BoneNode temp = (MDL0BoneNode)boneCache[least];
                    _baseInf = (IMatrixNode)temp.Parent;
                }
            }
            else
            {
                _baseInf = _node.MatrixNode;
            }

            if (_baseInf is Influence)
            {
                label2.Hide();
                comboBox2.Hide();
            }
            else if (_baseInf is MDL0BoneNode)
            {
                label2.Show();
                comboBox2.Show();
            }

            baseBone.Text = _baseInf.ToString();

            if (comboBox3.SelectedIndex == 0 && _baseInf is MDL0BoneNode)
            {
                int i = 0;
                foreach (MDL0BoneNode s in comboBox2.Items)
                {
                    if (s.Name == baseBone.Text)
                    {
                        comboBox2.SelectedIndex = i;
                        break;
                    }
                    i++;
                }
            }

            modelPanel1.AddTarget(_node);
            Vector3 min, max;

            _node.GetBox(out min, out max);
            modelPanel1.SetCamWithBox(min, max);
        }
Exemplo n.º 5
0
        public DataPanelWPF()
        {
            InitializeComponent();

            this.listView1.Font = new System.Drawing.Font("Segoe UI", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));

            //first row combobox
            cmbBox1.Items.Add(ColumnType.Numeric.Description());
            cmbBox1.Items.Add(ColumnType.Category.Description());
            cmbBox1.Items.Add(ColumnType.None.Description());
            cmbBox1.DropDownClosed += CmbBox1_DropDownClosed;
            cmbBox1.Size            = new System.Drawing.Size(0, 0);
            cmbBox1.Location        = new System.Drawing.Point(0, 0);
            this.listView1.Controls.AddRange(new System.Windows.Forms.Control[] { this.cmbBox1 });
            cmbBox1.SelectedIndexChanged += new System.EventHandler(this.CmbSelected);
            cmbBox1.LostFocus            += new System.EventHandler(this.CmbFocusOver);
            cmbBox1.KeyPress             += new System.Windows.Forms.KeyPressEventHandler(this.CmbKeyPress);
            cmbBox1.DropDownStyle         = forms.ComboBoxStyle.DropDownList;
            cmbBox1.Hide();

            //second row combobox
            cmbBox2.Items.Add(VariableType.None.Description());
            cmbBox2.Items.Add(VariableType.Feature.Description());
            cmbBox2.Items.Add(VariableType.Label.Description());
            cmbBox2.DropDownClosed += CmbBox1_DropDownClosed;
            cmbBox2.Size            = new System.Drawing.Size(0, 0);
            cmbBox2.Location        = new System.Drawing.Point(0, 0);
            this.listView1.Controls.AddRange(new System.Windows.Forms.Control[] { this.cmbBox2 });
            cmbBox2.SelectedIndexChanged += new System.EventHandler(this.CmbSelected);
            cmbBox2.LostFocus            += new System.EventHandler(this.CmbFocusOver);
            cmbBox2.KeyPress             += new System.Windows.Forms.KeyPressEventHandler(this.CmbKeyPress);
            cmbBox2.DropDownStyle         = forms.ComboBoxStyle.DropDownList;
            cmbBox2.Hide();


            //forth row combo box
            cmbBox3.Items.Add(MissingValue.None.Description());
            cmbBox3.Items.Add(MissingValue.Ignore.Description());
            cmbBox3.Items.Add(MissingValue.Average.Description());
            cmbBox3.Items.Add(MissingValue.Max.Description());
            cmbBox3.Items.Add(MissingValue.Min.Description());
            cmbBox3.Items.Add(MissingValue.Mode.Description());
            cmbBox3.Items.Add(MissingValue.Random.Description());
            cmbBox3.DropDownClosed += CmbBox1_DropDownClosed;

            cmbBox3.Size     = new System.Drawing.Size(0, 0);
            cmbBox3.Location = new System.Drawing.Point(0, 0);
            this.listView1.Controls.AddRange(new System.Windows.Forms.Control[] { this.cmbBox3 });
            cmbBox3.SelectedIndexChanged += new System.EventHandler(this.CmbSelected);
            cmbBox3.LostFocus            += new System.EventHandler(this.CmbFocusOver);
            cmbBox3.KeyPress             += new System.Windows.Forms.KeyPressEventHandler(this.CmbKeyPress);
            cmbBox3.DropDownStyle         = forms.ComboBoxStyle.DropDownList;
            cmbBox3.Hide();
        }
Exemplo n.º 6
0
        private void getBaseInfluence()
        {
            ResourceNode[] boneCache = _externalModel._linker.BoneCache;
            if ((node = (MDL0PolygonNode)comboBox1.SelectedItem).Weighted)
            {
                int least = int.MaxValue;
                foreach (IMatrixNode inf in node.Influences)
                {
                    if (inf is MDL0BoneNode && ((MDL0BoneNode)inf).BoneIndex < least)
                    {
                        least = ((MDL0BoneNode)inf).BoneIndex;
                    }
                }

                if (least != int.MaxValue)
                {
                    MDL0BoneNode temp = (MDL0BoneNode)boneCache[least];
                    _baseInf = (IMatrixNode)temp.Parent;
                }
            }
            else
            {
                _baseInf = node.SingleBindInf;
            }

            if (_baseInf is Influence)
            {
                label2.Hide();
                comboBox2.Hide();
            }
            else if (_baseInf is MDL0BoneNode)
            {
                label2.Show();
                comboBox2.Show();
            }

            switch (comboBox3.SelectedIndex)
            {
            case 0:
                label2.Text = "Add base bone \"" + _baseInf + "\" to the children of: ";
                break;

            case 1:
                label2.Text = "With base bone \"" + _baseInf + "\", replace: ";
                break;

            case 2:
                label2.Text = "Merge base bone \"" + _baseInf + "\" with: ";
                break;
            }

            comboBox2.Location = new Drawing.Point(label2.Size.Width + 20, 36);
            //Width = comboBox2.Location.X + 140;
        }
Exemplo n.º 7
0
        public PropertyView()
        {
            this.Font          = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
            this.FullRowSelect = true;
            this.GridLines     = true;
            //this.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
            this.LabelEdit   = false;
            this.LabelWrap   = false;
            this.MultiSelect = false;
            //this.Scrollable = false;
            this.Name         = "listView1";
            this.Size         = new System.Drawing.Size(0, 0);
            this.TabIndex     = 0;
            this.View         = System.Windows.Forms.View.Details;
            this.MouseDown   += new MouseEventHandler(PropertyView_MouseDown);
            this.DoubleClick += new EventHandler(PropertyView_DoubleClick);
            this.Columns.Add("Name", 100, HorizontalAlignment.Left);
            this.Columns.Add("Value", this.Width - 104, HorizontalAlignment.Left);

            editBox_.Size     = new System.Drawing.Size(0, 0);
            editBox_.Location = new System.Drawing.Point(0, 0);
            this.Controls.AddRange(new System.Windows.Forms.Control[] { this.editBox_ });
            editBox_.KeyPress   += new KeyPressEventHandler(editBox__KeyPress);
            editBox_.LostFocus  += new EventHandler(editBox__LostFocus);
            editBox_.Font        = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
            editBox_.BackColor   = Color.LightYellow;
            editBox_.BorderStyle = BorderStyle.None;
            editBox_.Text        = "";
            editBox_.Hide();

            comboBox_.Size     = new System.Drawing.Size(0, 0);
            comboBox_.Location = new System.Drawing.Point(0, 0);
            this.Controls.AddRange(new System.Windows.Forms.Control[] { this.comboBox_ });
            comboBox_.SelectedIndexChanged += new EventHandler(comboBox__SelectedIndexChanged);
            comboBox_.LostFocus            += new EventHandler(comboBox__LostFocus);
            comboBox_.KeyPress             += new KeyPressEventHandler(comboBox__KeyPress);
            comboBox_.Font          = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
            comboBox_.BackColor     = Color.LightYellow;
            comboBox_.DropDownStyle = ComboBoxStyle.DropDownList;
            comboBox_.Hide();
        }
Exemplo n.º 8
0
        private void checkBox1_CheckedChanged(object sender, EventArgs e)
        {
            modelPanel1.ClearTargets();

            _mergeModels = checkBox1.Checked;
            if (_mergeModels)
            {
                label1.Hide();
                comboBox1.Hide();
                _baseInf      = _externalModel._linker.BoneCache[0];
                baseBone.Text = _baseInf.ToString();

                modelPanel1.AddTarget(_externalModel, false);
                modelPanel1.SetCamWithBox(_externalModel.GetBox());
            }
            else
            {
                label1.Show();
                comboBox1.Show();
                GetBaseInfluence();
            }
        }
        public ExperimentPanel()
        {
            InitializeComponent();

            //first row combobox
            cmbBox.Items.Add(ColumnType.Numeric.Description());
            cmbBox.Items.Add(ColumnType.Binary.Description());
            cmbBox.Items.Add(ColumnType.Category.Description());
            cmbBox.Items.Add(ColumnType.Unknown.Description());

            cmbBox.Size     = new System.Drawing.Size(0, 0);
            cmbBox.Location = new System.Drawing.Point(0, 0);
            this.listView1.Controls.AddRange(new System.Windows.Forms.Control[] { this.cmbBox });
            cmbBox.SelectedIndexChanged += new System.EventHandler(this.CmbSelected);
            cmbBox.LostFocus            += new System.EventHandler(this.CmbFocusOver);
            cmbBox.KeyPress             += new System.Windows.Forms.KeyPressEventHandler(this.CmbKeyPress);
            cmbBox.DropDownStyle         = ComboBoxStyle.DropDownList;
            cmbBox.Hide();

            //second row combobox
            cmbBox1.Items.Add(ParameterType.Ignored.Description());
            cmbBox1.Items.Add(ParameterType.Input.Description());
            cmbBox1.Items.Add(ParameterType.Output.Description());

            cmbBox1.Size     = new System.Drawing.Size(0, 0);
            cmbBox1.Location = new System.Drawing.Point(0, 0);
            this.listView1.Controls.AddRange(new System.Windows.Forms.Control[] { this.cmbBox1 });
            cmbBox1.SelectedIndexChanged += new System.EventHandler(this.CmbSelected);
            cmbBox1.LostFocus            += new System.EventHandler(this.CmbFocusOver);
            cmbBox1.KeyPress             += new System.Windows.Forms.KeyPressEventHandler(this.CmbKeyPress);
            cmbBox1.DropDownStyle         = ComboBoxStyle.DropDownList;
            cmbBox1.Hide();

            //cat encoding is filled on demand

            cmbBox11.Size     = new System.Drawing.Size(0, 0);
            cmbBox11.Location = new System.Drawing.Point(0, 0);
            this.listView1.Controls.AddRange(new System.Windows.Forms.Control[] { this.cmbBox11 });
            cmbBox11.SelectedIndexChanged += new System.EventHandler(this.CmbSelected);
            cmbBox11.LostFocus            += new System.EventHandler(this.CmbFocusOver);
            cmbBox11.KeyPress             += new System.Windows.Forms.KeyPressEventHandler(this.CmbKeyPress);
            cmbBox11.DropDownStyle         = ComboBoxStyle.DropDownList;
            cmbBox11.Hide();

            //third row combobox
            cmbBox2.Items.Add(Scaling.None.Description());
            cmbBox2.Items.Add(Scaling.MinMax.Description());
            cmbBox2.Items.Add(Scaling.Gauss.Description());

            cmbBox2.Size     = new System.Drawing.Size(0, 0);
            cmbBox2.Location = new System.Drawing.Point(0, 0);
            this.listView1.Controls.AddRange(new System.Windows.Forms.Control[] { this.cmbBox2 });
            cmbBox2.SelectedIndexChanged += new System.EventHandler(this.CmbSelected);
            cmbBox2.LostFocus            += new System.EventHandler(this.CmbFocusOver);
            cmbBox2.KeyPress             += new System.Windows.Forms.KeyPressEventHandler(this.CmbKeyPress);
            cmbBox2.DropDownStyle         = ComboBoxStyle.DropDownList;
            cmbBox2.Hide();

            //forth row combo box
            cmbBox3.Items.Add(MissingValue.Ignore.Description());
            cmbBox3.Items.Add(MissingValue.Average.Description());
            cmbBox3.Items.Add(MissingValue.Max.Description());
            cmbBox3.Items.Add(MissingValue.Min.Description());
            cmbBox3.Items.Add(MissingValue.Mode.Description());
            cmbBox3.Items.Add(MissingValue.Random.Description());


            cmbBox3.Size     = new System.Drawing.Size(0, 0);
            cmbBox3.Location = new System.Drawing.Point(0, 0);
            this.listView1.Controls.AddRange(new System.Windows.Forms.Control[] { this.cmbBox3 });
            cmbBox3.SelectedIndexChanged += new System.EventHandler(this.CmbSelected);
            cmbBox3.LostFocus            += new System.EventHandler(this.CmbFocusOver);
            cmbBox3.KeyPress             += new System.Windows.Forms.KeyPressEventHandler(this.CmbKeyPress);
            cmbBox3.DropDownStyle         = ComboBoxStyle.DropDownList;
            cmbBox3.Hide();

            HideOptionPanel();
            //default encoding values
            DefaultBEncoding = CategoryEncoding.Binary1;
            DefaultCEncoding = CategoryEncoding.OneHot;
        }
Exemplo n.º 10
0
        private void GetBaseInfluence()
        {
            if (_node != null)
            {
                modelPanel1.RemoveReference(_node);
            }

            MDL0BoneNode[] boneCache = _externalModel._linker.BoneCache;
            if ((_node = (MDL0ObjectNode)comboBox1.SelectedItem).Weighted)
            {
                int least = int.MaxValue;
                foreach (IMatrixNode inf in _node.Influences)
                {
                    if (inf is MDL0BoneNode && ((MDL0BoneNode)inf).BoneIndex < least)
                    {
                        least = ((MDL0BoneNode)inf).BoneIndex;
                    }
                }

                if (least != int.MaxValue)
                {
                    MDL0BoneNode temp = boneCache[least];
                    _baseInf = (IMatrixNode)temp.Parent;
                }
            }
            else
            {
                _baseInf = _node.MatrixNode;
            }

            if (_baseInf is Influence)
            {
                label2.Hide();
                comboBox2.Hide();
            }
            else if (_baseInf is MDL0BoneNode)
            {
                label2.Show();
                comboBox2.Show();
            }

            baseBone.Text = _baseInf.ToString();

            if (comboBox3.SelectedIndex == 0 && _baseInf is MDL0BoneNode)
            {
                int i = 0;
                foreach (MDL0BoneNode s in comboBox2.Items)
                {
                    if (s.Name == baseBone.Text)
                    {
                        comboBox2.SelectedIndex = i;
                        break;
                    }

                    i++;
                }
            }

            _node.IsRendering = true;
            modelPanel1.ClearTargets();
            modelPanel1.AddTarget(_node, false);
            modelPanel1.SetCamWithBox(_node.GetBox());
        }
Exemplo n.º 11
0
        public LodgerListView()
        {
            duties = DutyParser.LoadDuties();
            foreach (Duty d in duties)
            {
                cmbBox.Items.Add(d.Description);
            }

            cmbBox.Size     = new System.Drawing.Size(0, 0);
            cmbBox.Location = new System.Drawing.Point(0, 0);
            this.Controls.AddRange(new System.Windows.Forms.Control[] { this.cmbBox });
            cmbBox.SelectedIndexChanged += new System.EventHandler(this.CmbSelected);
            cmbBox.LostFocus            += new System.EventHandler(this.CmbFocusOver);
            cmbBox.KeyPress             += new System.Windows.Forms.KeyPressEventHandler(this.CmbKeyPress);
            cmbBox.Font          = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
            cmbBox.BackColor     = Color.SkyBlue;
            cmbBox.DropDownStyle = ComboBoxStyle.DropDownList;
            cmbBox.Hide();

            this.columnHeader1 = new System.Windows.Forms.ColumnHeader();
            this.columnHeader2 = new System.Windows.Forms.ColumnHeader();
            this.columnHeader3 = new System.Windows.Forms.ColumnHeader();
            this.columnHeader4 = new System.Windows.Forms.ColumnHeader();

            this.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
                this.columnHeader1,
                this.columnHeader2,
                this.columnHeader3,
                this.columnHeader4
            });

            this.MouseDown   += new System.Windows.Forms.MouseEventHandler(this.SMKMouseDown);
            this.DoubleClick += new System.EventHandler(this.SMKDoubleClick);

            this.columnHeader1.Text  = "Name";
            this.columnHeader1.Width = 100;
            //
            // columnHeader2
            //
            this.columnHeader2.Text  = "Floor";
            this.columnHeader2.Width = 50;
            //
            // columnHeader3
            //
            this.columnHeader3.Text  = "Kitchen";
            this.columnHeader3.Width = 50;
            //
            // columnHeader4
            //
            this.columnHeader4.Text  = "Description";
            this.columnHeader4.Width = 700;

            editBox.Size     = new System.Drawing.Size(0, 0);
            editBox.Location = new System.Drawing.Point(0, 0);
            this.Controls.AddRange(new System.Windows.Forms.Control[] { this.editBox });
            editBox.KeyPress   += new System.Windows.Forms.KeyPressEventHandler(this.EditOver);
            editBox.LostFocus  += new System.EventHandler(this.FocusOver);
            editBox.Font        = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
            editBox.BackColor   = Color.LightYellow;
            editBox.BorderStyle = BorderStyle.Fixed3D;
            editBox.Hide();
            editBox.Text = "";

            lodgers = LodgerParser.LoadLodgers();
            foreach (Lodger l in lodgers)
            {
                ListViewItem item1 = new ListViewItem(l.Name);
                item1.SubItems.Add(l.FloorNumber.ToString());
                item1.SubItems.Add(getKitchen(l));
                item1.SubItems.Add(getDuty(l, duties));
                this.Items.Add(item1);
            }
        }
Exemplo n.º 12
0
        public EditListView()
        {
            //Action
            ActionCmbBox.Items.Add("");
            //ActionCmbBox.Items.Add("Lock Door Relay 01");
            //ActionCmbBox.Items.Add("Lock Door Relay 02");
            ActionCmbBox.Items.Add("Turn On Alarm Light Relay 01");
            ActionCmbBox.Items.Add("Turn On Alarm Light Relay 02");
            ActionCmbBox.Items.Add("Turn On Siren Relay 01");
            ActionCmbBox.Items.Add("Turn On Siren Relay 02");
            ActionCmbBox.Items.Add("Unlock Door Relay 01");
            ActionCmbBox.Items.Add("Unlock Door Relay 02");
            ActionCmbBox.Items.Add("Display Tag Moving Direction");
            ActionCmbBox.Items.Add("Call Access Tag");
            ActionCmbBox.Items.Add("Call Asset Tag");
            ActionCmbBox.Items.Add("Call Inventory Tag");
            ActionCmbBox.Items.Add("E-mail Event Activity");

            ActionCmbBox.Size     = new System.Drawing.Size(0, 0);
            ActionCmbBox.Location = new System.Drawing.Point(0, 0);
            this.Controls.AddRange(new System.Windows.Forms.Control[] { this.ActionCmbBox });
            ActionCmbBox.SelectedIndexChanged += new System.EventHandler(this.ActionCmbSelected);
            ActionCmbBox.LostFocus            += new System.EventHandler(HideControlFocusOver);
            ActionCmbBox.KeyPress             += new System.Windows.Forms.KeyPressEventHandler(HideControlKeyPress);
            ActionCmbBox.Font          = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
            ActionCmbBox.BackColor     = Color.SkyBlue;
            ActionCmbBox.DropDownStyle = ComboBoxStyle.DropDownList;
            ActionCmbBox.Hide();

            //Action
            ActionInputCmbBox.Items.Add("");
            ActionInputCmbBox.Items.Add("Input 01 Timeout");
            ActionInputCmbBox.Items.Add("Input 02 Timeout");
            //ActiInputonCmbBox.Items.Add("Lock Door Relay 01");
            //ActiInputonCmbBox.Items.Add("Lock Door Relay 02");
            ActionInputCmbBox.Items.Add("Turn On Alarm Light Relay 01");
            ActionInputCmbBox.Items.Add("Turn On Alarm Light Relay 02");
            ActionInputCmbBox.Items.Add("Turn On Siren Relay 01");
            ActionInputCmbBox.Items.Add("Turn On Siren Relay 02");
            ActionInputCmbBox.Items.Add("Call Access Tag");
            ActionInputCmbBox.Items.Add("Call Asset Tag");
            ActionInputCmbBox.Items.Add("Call Inventory Tag");
            ActionInputCmbBox.Items.Add("E-mail Event Activity");

            ActionInputCmbBox.Size     = new System.Drawing.Size(0, 0);
            ActionInputCmbBox.Location = new System.Drawing.Point(0, 0);
            this.Controls.Add(ActionInputCmbBox);
            ActionInputCmbBox.SelectedIndexChanged += new System.EventHandler(this.ActionInputCmbSelected);
            ActionInputCmbBox.LostFocus            += new System.EventHandler(HideControlFocusOver);
            ActionInputCmbBox.KeyPress             += new System.Windows.Forms.KeyPressEventHandler(HideControlKeyPress);
            ActionInputCmbBox.Font          = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
            ActionInputCmbBox.BackColor     = Color.SkyBlue;
            ActionInputCmbBox.DropDownStyle = ComboBoxStyle.DropDownList;
            ActionInputCmbBox.Hide();


            //Duration
            for (int i = 1; i < 60; i++)
            {
                DurationCmbBox.Items.Add(i + " sec");
            }

            DurationCmbBox.Items.Add("1 min");
            DurationCmbBox.Items.Add("2 min");
            DurationCmbBox.Items.Add("3 min");
            DurationCmbBox.Items.Add("forever");

            DurationCmbBox.Size     = new System.Drawing.Size(0, 0);
            DurationCmbBox.Location = new System.Drawing.Point(0, 0);
            this.Controls.AddRange(new System.Windows.Forms.Control[] { this.DurationCmbBox });
            DurationCmbBox.SelectedIndexChanged += new System.EventHandler(this.CmbSelected);
            DurationCmbBox.LostFocus            += new System.EventHandler(HideControlFocusOver);
            DurationCmbBox.KeyPress             += new System.Windows.Forms.KeyPressEventHandler(HideControlKeyPress);
            DurationCmbBox.Font          = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
            DurationCmbBox.BackColor     = Color.SkyBlue;
            DurationCmbBox.DropDownStyle = ComboBoxStyle.DropDownList;
            DurationCmbBox.Hide();

            //Reader ID
            ReaderCmbBox.Items.Add("0");

            ReaderCmbBox.Size     = new System.Drawing.Size(0, 0);
            ReaderCmbBox.Location = new System.Drawing.Point(0, 0);
            this.Controls.AddRange(new System.Windows.Forms.Control[] { this.ReaderCmbBox });
            ReaderCmbBox.SelectedIndexChanged += new System.EventHandler(this.ReaderCmbSelected);
            ReaderCmbBox.Sorted        = true;
            ReaderCmbBox.LostFocus    += new System.EventHandler(HideControlFocusOver);
            ReaderCmbBox.KeyPress     += new System.Windows.Forms.KeyPressEventHandler(HideControlKeyPress);
            ReaderCmbBox.Font          = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
            ReaderCmbBox.BackColor     = Color.SkyBlue;
            ReaderCmbBox.DropDownStyle = ComboBoxStyle.DropDownList;
            ReaderCmbBox.Hide();


            //FGen ID
            FGenCmbBox.Items.Add("0");
            FGenCmbBox.Text = "0";

            FGenCmbBox.Size     = new System.Drawing.Size(0, 0);
            FGenCmbBox.Location = new System.Drawing.Point(0, 0);
            this.Controls.AddRange(new System.Windows.Forms.Control[] { this.FGenCmbBox });
            FGenCmbBox.Sorted = true;
            FGenCmbBox.SelectedIndexChanged += new System.EventHandler(this.FGenCmbSelected);
            FGenCmbBox.LostFocus            += new System.EventHandler(HideControlFocusOver);
            FGenCmbBox.KeyPress             += new System.Windows.Forms.KeyPressEventHandler(HideControlKeyPress);
            FGenCmbBox.Font          = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
            FGenCmbBox.BackColor     = Color.SkyBlue;
            FGenCmbBox.ForeColor     = Color.White;
            FGenCmbBox.DropDownStyle = ComboBoxStyle.DropDownList;
            FGenCmbBox.Hide();

            //EditBox Location
            LocationLabel.Size     = new System.Drawing.Size(0, 0);
            LocationLabel.Location = new System.Drawing.Point(0, 0);
            this.Controls.AddRange(new System.Windows.Forms.Control[] { this.LocationLabel });
            //LocationLabel.SelectedIndexChanged += new System.EventHandler(this.ActionCmbSelected);
            LocationLabel.LostFocus += new System.EventHandler(HideControlFocusOver);
            LocationLabel.KeyPress  += new System.Windows.Forms.KeyPressEventHandler(HideControlKeyPress);
            LocationLabel.Font       = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
            LocationLabel.BackColor  = Color.White;
            //LocationLabel.DropDownStyle = ComboBoxStyle.DropDownList;
            LocationLabel.Hide();


            this.columnHeader1 = new System.Windows.Forms.ColumnHeader();
            this.columnHeader2 = new System.Windows.Forms.ColumnHeader();
            this.columnHeader3 = new System.Windows.Forms.ColumnHeader();
            this.columnHeader4 = new System.Windows.Forms.ColumnHeader();
            this.columnHeader5 = new System.Windows.Forms.ColumnHeader();


            this.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
                this.columnHeader1,                                                             //action
                this.columnHeader2,                                                             //duration
                this.columnHeader3,                                                             //reader ID
                this.columnHeader4,                                                             //Fgen ID
                this.columnHeader5,                                                             //location
            });
            this.Dock          = System.Windows.Forms.DockStyle.Fill;
            this.Font          = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
            this.FullRowSelect = false;
            this.Name          = "listView1";
            this.Size          = new System.Drawing.Size(0, 0);
            this.TabIndex      = 0;
            this.View          = System.Windows.Forms.View.Details;
            this.MouseDown    += new System.Windows.Forms.MouseEventHandler(this.ListBoxMouseDown);
            this.MouseUp      += new System.Windows.Forms.MouseEventHandler(this.ListBoxMouseUp);
            this.DoubleClick  += new System.EventHandler(this.ListBoxItemDoubleClick);
            this.ItemCheck    += new ItemCheckEventHandler(this.ListViewItemCheck);
            this.GridLines     = true;
            this.CheckBoxes    = false;
            this.View          = View.Details;

            this.Items.Clear();

            for (int i = 0; i < MAX_ROW; i++)
            {
                ListViewItem item = new ListViewItem(""); //action
                //item.Checked = true;
                item.SubItems.Add("");                    //duration
                item.SubItems.Add("");                    //readerid
                item.SubItems.Add("");                    //fgenid
                item.SubItems.Add("");                    //location
                this.Items.Add(item);
            }

            // columnHeader1
            //
            this.columnHeader1.Text  = "Action";
            this.columnHeader1.Width = 220;
            //
            // columnHeader2
            //
            this.columnHeader2.Text  = "Duration";
            this.columnHeader2.Width = 65;
            //
            // columnHeader3
            //
            this.columnHeader3.Text  = "Reader ID";
            this.columnHeader3.Width = 75;
            //
            // columnHeader4
            //
            this.columnHeader4.Text  = "FGen ID";
            this.columnHeader4.Width = 75;
            //
            // columnHeader5
            //
            this.columnHeader5.Text  = "Location";
            this.columnHeader5.Width = 200;


            /*if (GetItemReaderComboBoxEvent != null)
             * {
             *  int rID;
             *  int index = 0;
             *
             *  while ((rID=GetItemReaderComboBoxEvent(index)) > 0)
             *  {
             *      if (index == 0)
             *          ReaderCmbBox.Items.Clear();
             *
             *      if (!ReaderCmbBox.Items.Contains(rID))
             *          ReaderCmbBox.Items.Add(rID);
             *
             *      index += 1;
             *  }
             * }*/

            loadingThread = new Thread(LoadReader);
            loadingThread.Start();
        }
Exemplo n.º 13
0
        public ListViewThu()
        {
            cmbBox.Items.Add("Asia");
            cmbBox.Items.Add("North America");
            cmbBox.Items.Add("South America");
            cmbBox.Items.Add("Africa");
            cmbBox.Items.Add("Europe");
            cmbBox.Items.Add("Australia");
            cmbBox.Items.Add("Antartica");
            cmbBox.Size     = new System.Drawing.Size(0, 0);
            cmbBox.Location = new System.Drawing.Point(0, 0);
            this.Controls.AddRange(new System.Windows.Forms.Control[] { this.cmbBox });
            cmbBox.SelectedIndexChanged += new System.EventHandler(this.CmbSelected);
            cmbBox.LostFocus            += new System.EventHandler(this.CmbFocusOver);
            cmbBox.KeyPress             += new System.Windows.Forms.KeyPressEventHandler(this.CmbKeyPress);
            cmbBox.Font          = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
            cmbBox.BackColor     = Color.SkyBlue;
            cmbBox.DropDownStyle = ComboBoxStyle.DropDownList;
            cmbBox.Hide();

            this.columnHeader1 = new System.Windows.Forms.ColumnHeader();
            this.columnHeader2 = new System.Windows.Forms.ColumnHeader();
            this.columnHeader3 = new System.Windows.Forms.ColumnHeader();
            this.columnHeader4 = new System.Windows.Forms.ColumnHeader();

            this.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
                this.columnHeader1,
                this.columnHeader2,
                this.columnHeader3,
                this.columnHeader4
            });
            //this.Dock = System.Windows.Forms.DockStyle.Fill;
            this.Font          = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
            this.FullRowSelect = true;
            this.Name          = "listView1";
            this.Size          = new System.Drawing.Size(0, 0);
            this.TabIndex      = 0;
            this.View          = System.Windows.Forms.View.Details;
            this.MouseDown    += new System.Windows.Forms.MouseEventHandler(this.SMKMouseDown);
            this.DoubleClick  += new System.EventHandler(this.SMKDoubleClick);
            this.GridLines     = true;
            //
            // columnHeader1
            //
            this.columnHeader1.Text  = "Country";
            this.columnHeader1.Width = 100;
            //
            // columnHeader2
            //
            this.columnHeader2.Text  = "City";
            this.columnHeader2.Width = 100;
            //
            // columnHeader3
            //
            this.columnHeader3.Text  = "City";
            this.columnHeader3.Width = 100;
            //
            // columnHeader4
            //
            this.columnHeader4.Text  = "Continent";
            this.columnHeader4.Width = 100;

            editBox.Size     = new System.Drawing.Size(0, 0);
            editBox.Location = new System.Drawing.Point(0, 0);
            this.Controls.AddRange(new System.Windows.Forms.Control[] { this.editBox });
            editBox.KeyPress   += new System.Windows.Forms.KeyPressEventHandler(this.EditOver);
            editBox.LostFocus  += new System.EventHandler(this.FocusOver);
            editBox.Font        = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
            editBox.BackColor   = Color.LightYellow;
            editBox.BorderStyle = BorderStyle.Fixed3D;
            editBox.Hide();
            editBox.Text = "";

            string[] s = new string[4];
            s[0] = "USA";
            s[1] = "Milwaukee";
            s[2] = "Michigan";
            s[3] = "North America";
            this.Items.Add(new ListViewItem(s));

            s[0] = "Great Britan";
            s[1] = "London";
            s[2] = "Glasgow";
            s[3] = "Europe";
            this.Items.Add(new ListViewItem(s));

            s[0] = "India";
            s[1] = "Mumbai";
            s[2] = "Delhi";
            s[3] = "Asia";
            this.Items.Add(new ListViewItem(s));

            s[0] = "Australia";
            s[1] = "Sydney";
            s[2] = "Canberra";
            s[3] = "Australia";
            this.Items.Add(new ListViewItem(s));
        }
Exemplo n.º 14
0
        public ExperimentPanel()
        {
            InitializeComponent();

            //first row combobox
            cmbBox.Items.Add("Numeric");
            cmbBox.Items.Add("Category");
            cmbBox.Items.Add("Binary");
            cmbBox.Items.Add("String");

            cmbBox.Size     = new System.Drawing.Size(0, 0);
            cmbBox.Location = new System.Drawing.Point(0, 0);
            this.listView1.Controls.AddRange(new System.Windows.Forms.Control[] { this.cmbBox });
            cmbBox.SelectedIndexChanged += new System.EventHandler(this.CmbSelected);
            cmbBox.LostFocus            += new System.EventHandler(this.CmbFocusOver);
            cmbBox.KeyPress             += new System.Windows.Forms.KeyPressEventHandler(this.CmbKeyPress);
            cmbBox.DropDownStyle         = ComboBoxStyle.DropDownList;
            cmbBox.Hide();

            //second row combobox
            cmbBox1.Items.Add("Ignore");
            cmbBox1.Items.Add("Input");
            cmbBox1.Items.Add("Output");

            cmbBox1.Size     = new System.Drawing.Size(0, 0);
            cmbBox1.Location = new System.Drawing.Point(0, 0);
            this.listView1.Controls.AddRange(new System.Windows.Forms.Control[] { this.cmbBox1 });
            cmbBox1.SelectedIndexChanged += new System.EventHandler(this.CmbSelected);
            cmbBox1.LostFocus            += new System.EventHandler(this.CmbFocusOver);
            cmbBox1.KeyPress             += new System.Windows.Forms.KeyPressEventHandler(this.CmbKeyPress);
            cmbBox1.DropDownStyle         = ComboBoxStyle.DropDownList;
            cmbBox1.Hide();

            cmbBox11.Items.Add("None");
            cmbBox11.Items.Add("Level");
            cmbBox11.Items.Add("1 out of N");
            cmbBox11.Items.Add("1 out of N-1");

            cmbBox11.Size     = new System.Drawing.Size(0, 0);
            cmbBox11.Location = new System.Drawing.Point(0, 0);
            this.listView1.Controls.AddRange(new System.Windows.Forms.Control[] { this.cmbBox11 });
            cmbBox11.SelectedIndexChanged += new System.EventHandler(this.CmbSelected);
            cmbBox11.LostFocus            += new System.EventHandler(this.CmbFocusOver);
            cmbBox11.KeyPress             += new System.Windows.Forms.KeyPressEventHandler(this.CmbKeyPress);
            cmbBox11.DropDownStyle         = ComboBoxStyle.DropDownList;
            cmbBox11.Hide();

            //third row combobox
            cmbBox2.Items.Add("None");
            cmbBox2.Items.Add("MinMax");
            cmbBox2.Items.Add("Gauss");

            cmbBox2.Size     = new System.Drawing.Size(0, 0);
            cmbBox2.Location = new System.Drawing.Point(0, 0);
            this.listView1.Controls.AddRange(new System.Windows.Forms.Control[] { this.cmbBox2 });
            cmbBox2.SelectedIndexChanged += new System.EventHandler(this.CmbSelected);
            cmbBox2.LostFocus            += new System.EventHandler(this.CmbFocusOver);
            cmbBox2.KeyPress             += new System.Windows.Forms.KeyPressEventHandler(this.CmbKeyPress);
            cmbBox2.DropDownStyle         = ComboBoxStyle.DropDownList;
            cmbBox2.Hide();

            //forth row combo box
            cmbBox3.Items.Add("Ignore");
            cmbBox3.Items.Add("Average");
            cmbBox3.Items.Add("Mode");
            cmbBox3.Items.Add("Random");
            cmbBox3.Items.Add("Max");
            cmbBox3.Items.Add("Min");


            cmbBox3.Size     = new System.Drawing.Size(0, 0);
            cmbBox3.Location = new System.Drawing.Point(0, 0);
            this.listView1.Controls.AddRange(new System.Windows.Forms.Control[] { this.cmbBox3 });
            cmbBox3.SelectedIndexChanged += new System.EventHandler(this.CmbSelected);
            cmbBox3.LostFocus            += new System.EventHandler(this.CmbFocusOver);
            cmbBox3.KeyPress             += new System.Windows.Forms.KeyPressEventHandler(this.CmbKeyPress);
            cmbBox3.DropDownStyle         = ComboBoxStyle.DropDownList;
            cmbBox3.Hide();

            numCtrlNumForTest.Maximum = int.MaxValue;
            numCtrlNumForTest.Minimum = 0;
        }