示例#1
0
        public void changeSelectedAddress(Int32 addr)
        {
            //select and remove
            selectedAddress    = addr;
            modAddress.address = addr;
            bool active = modAddressControl.getIsActive();

            mod_panel.Controls.Remove(modAddressControl);

            //create new control
            modAddressControl               = new ModAddressControl(modAddress, true);
            modAddressControl.Location      = new Point(0, 0);
            modAddressControl.lbl_name.Text = selectedAddress.ToString("X");
            modAddressControl.ChangeType(cb_type.SelectedIndex);
            modAddressControl.setIsActive(active);
            mod_panel.Controls.Add(modAddressControl);

            //highlight selected bytes
            if (tab_control.SelectedIndex == 0) //set value
            {
                highlightSelectedAddress(addr, ModAddress.dataTypeSizes[modAddress.type], true);
            }
            else if (tab_control.SelectedIndex == 1) //randomize
            {
                highlightSelectedAddress(addr, Convert.ToInt32(tb_randomize_amount.Text), true);
            }
        }
        private void AddModAddress(ModAddress m)
        {
            ModAddressControl modAddressControl = new ModAddressControl(m, false);

            modAddressControls.Add(modAddressControl);
            int locationX = 0;
            int locationY = ModAddressControl.sizeY * (modAddressControls.Count - 1) + panel_mod_addresses.AutoScrollPosition.Y;

            modAddressControl.Location = new Point(locationX, locationY);
            panel_mod_addresses.Controls.Add(modAddressControl);
            lb_mod_addresses.Items.Add(m.name);
        }
示例#3
0
        private void loadFormControls()
        {
            hexRows = new HexRow[nRows];
            int i = 0;

            for (; i < nRows; i++)
            {
                hexRows[i]          = new HexRow(startAddress + (16 * i), this);
                hexRows[i].Location = new Point(0, (HexRow.sizeY * i));
                hex_panel.Controls.Add(hexRows[i]);
            }

            modAddressControl          = new ModAddressControl(modAddress, true);
            modAddressControl.Location = new Point(0, 0);
            mod_panel.Controls.Add(modAddressControl);
            modAddressControl.lbl_name.Text = selectedAddress.ToString("X8");

            timer1.Start();
        }