private void AddressList_MouseDoubleClick(object sender, MouseEventArgs e) { int index = this.AddressList.SelectedIndex; if (index < 0 || index >= this.AddressList.Items.Count) { return; } UseFlagID current = this.FlagList[index]; MainSimpleMenuEventErrorForm.GotoEvent(current.DataType, current.Addr, current.Tag, current.MapID); }
void EnterEvent() { U.AddrResult ar = InputFormRef.SelectToAddrResult(this.AddressList); if (ar.name == null) { return; } uint mapid = ar.addr; //マップIDが入っています. MainSimpleMenuEventErrorForm f = (MainSimpleMenuEventErrorForm)InputFormRef.JumpForm <MainSimpleMenuEventErrorForm>(U.NOT_FOUND); f.Init(mapid, ShowAllError1.Checked); }
public Size Draw(ListBox lb, int index, Graphics g, Rectangle listbounds, bool isWithDraw) { if (index < 0 || index >= lb.Items.Count) { return(new Size(listbounds.X, listbounds.Y)); } SolidBrush brush = new SolidBrush(lb.ForeColor); SolidBrush foreKeywordBrush = new SolidBrush(OptionForm.Color_Keyword_ForeColor()); Font normalFont = lb.Font; Font boldFont = new Font(lb.Font, FontStyle.Bold); Rectangle bounds = listbounds; int lineHeight = normalFont.Height; UseFlagID current = this.FlagList[index]; string text; int maxWidth = 0; if (index == 0 || current.ID != this.FlagList[index - 1].ID) { //フラグ名を描画 if (index != 0) { //空行を入れる bounds.Y += lineHeight; } //フラグのアイコンを描画 Bitmap bitmap = ImageSystemIconForm.FlagIcon(); U.MakeTransparent(bitmap); Rectangle b = bounds; b.Width = lineHeight; b.Height = lineHeight; bounds.X += U.DrawPicture(bitmap, g, isWithDraw, b); bitmap.Dispose(); //フラグ名を書く string dummy; text = ":"; bounds.X += U.DrawText(text, g, normalFont, brush, isWithDraw, bounds); text = U.ToHexString(current.ID); bounds.X += U.DrawText(text, g, boldFont, brush, isWithDraw, bounds); text = " " + InputFormRef.GetFlagName(current.ID, out dummy); bounds.X += U.DrawText(text, g, normalFont, brush, isWithDraw, bounds); //次の行へ maxWidth = bounds.X; bounds.Y += lineHeight; bounds.X = listbounds.X; } //名称の表示 bounds.X += 10; text = MainSimpleMenuEventErrorForm.TypeToString(current.DataType, current.Addr, current.Tag); bounds.X += U.DrawText(text, g, boldFont, foreKeywordBrush, isWithDraw, bounds); //次の行へ maxWidth = Math.Max(bounds.X, maxWidth); bounds.Y += lineHeight; bounds.X = listbounds.X; //情報を書く. bounds.X += 6; text = current.Info; Size ss; if (current.DataType == FELint.Type.BATTTLE_TALK || current.DataType == FELint.Type.HAIKU) { ss = DrawUnitAllowToAllow(text, lb, g, bounds, isWithDraw); } else if (current.DataType == FELint.Type.EVENT_COND_ALWAYS) { ss = EventCondForm.DrawEventListAlwaysOneLiner(current.Addr, lb, g, bounds, isWithDraw); } else if (current.DataType == FELint.Type.EVENT_COND_OBJECT) { ss = EventCondForm.DrawEventListObjectOneLiner(current.Addr, lb, g, bounds, isWithDraw); } else if (current.DataType == FELint.Type.EVENT_COND_TALK) { ss = EventCondForm.DrawEventListTalkOneLiner(current.Addr, lb, g, bounds, isWithDraw); } else if (current.DataType == FELint.Type.EVENT_COND_TURN) { ss = EventCondForm.DrawEventListTurnOneLiner(current.Addr, lb, g, bounds, isWithDraw); } else if (current.DataType == FELint.Type.EVENTSCRIPT) { EventScript.OneCode code = Program.EventScript.DisAseemble(Program.ROM.Data, current.Tag); ss = EventScriptForm.DrawCode(lb, g, bounds, isWithDraw, code); } else { bounds.X += U.DrawText(text, g, normalFont, brush, isWithDraw, bounds); bounds.Y += lineHeight; ss = new Size(bounds.X, bounds.Y); } bounds.X = ss.Width; bounds.Y = ss.Height; brush.Dispose(); foreKeywordBrush.Dispose(); //最後の改行 maxWidth = Math.Max(bounds.X, maxWidth); return(new Size(maxWidth, bounds.Y)); }