public MoveCostForm() { InitializeComponent(); LoadNames(); this.AddressList.OwnerDraw(ListBoxEx.DrawClassAndText, DrawMode.OwnerDrawFixed); this.CLASS_LISTBOX.OwnerDraw(ListBoxEx.DrawClassAndText, DrawMode.OwnerDrawFixed); this.CLASS_LISTBOX.ItemListToJumpForm("CLASS"); this.FilterComboBox.SelectedIndex = 0; this.InputFormRef = Init(this); this.InputFormRef.IsMemoryNotContinuous = true; //メモリは連続していないので、警告不能. this.InputFormRef.IsSurrogateStructure = true; //代理構造体で表示されているので警告不能 this.InputFormRef.MakeGeneralAddressListContextMenu(true); this.InputFormRef.CheckProtectionPaddingALIGN4 = false; List <Control> controls = InputFormRef.GetAllControls(this); for (int i = 0; i < 64 + 1; i++) { Control c = InputFormRef.FindObjectByFormFirstMatch <NumericUpDown>(controls, "B" + i); if (c is NumericUpDown) { NumericUpDown nud = (NumericUpDown)c; nud.ValueChanged += NUD_ValueChanged; } } }
static List <NameMapping> MakeStruct(InputFormRef ifr, List <Control> controls) { List <String> unionPrefList = ifr.UnionPrefixList; List <NameMapping> dic = new List <NameMapping>(); foreach (Control info in controls) { if (!(info is NumericUpDown)) { continue; } string prefix = ifr.Prefix; NumericUpDown info_object = ((NumericUpDown)info); String name = InputFormRef.SkipPrefixName(info.Name, prefix); if (name.Length <= 0) { continue; } if (!InputFormRef.IsTypeWord(name[0])) { if (ifr.UnionTab != null) { prefix = InputFormRef.ConvertUniTabPageToSelectedUnionPrefixName(ifr.UnionTab); name = InputFormRef.SkipPrefixName(info.Name, prefix); if (name.Length <= 0) { continue; } } if (!InputFormRef.IsTypeWord(name[0])) { continue; } } NameMapping nm = new NameMapping(); nm.TypeName = name; nm.Id = U.atoi(name.Substring(1)); nm.Value = info_object; uint id = U.atoi(name.Substring(1)); string labelname = prefix + "L_" + id + "_"; nm.Label = InputFormRef.FindObjectByFormFirstMatch <Control>(controls, labelname); string jumpname = prefix + "J_" + id + "_"; nm.Jump = InputFormRef.FindObjectByFormFirstMatch <Control>(controls, jumpname); if (nm.Jump == null) { jumpname = prefix + "J_" + id; nm.Jump = InputFormRef.FindObjectByForm <Control>(controls, jumpname); } dic.Add(nm); } if (dic.Count <= 0) { MakeStructDWORD(ifr, dic); } dic.Sort(); return(dic); }