private void Draw() { inputWnd.Draw(); spriteWnd.Draw(); }
public MainForm() { _formatList = new Dictionary <FormatKind, FileFormat>(); _formatList[FormatKind.NES] = new FileFormat( "NES", Utils.TileType("NESTile"), new string[] { "nes", "fds", "chr", "bin" }, new ColorList(Utils.NESPalette, Utils.NESDefSel) ); _formatList[FormatKind.SNES] = new FileFormat( "SNES", Utils.TileType("SNESTile"), new string[] { "smc", "sfc", "chr", "bin" }, new ColorPattern(Utils.SNESRGBAOrderAndDepth, Utils.SNESDefSel) ); _formatList[FormatKind.MD] = new FileFormat( "Genesis", Utils.TileType("MDTile"), new string[] { "smd", "md", "bin" }, new ColorPattern(Utils.MDRGBAOrderAndDepth, Utils.MDDefSel) ); InitializeComponent(); string filter = ""; foreach (var fmt in _formatList) { filter += fmt.Value.Filter; } filter = filter.Remove(filter.Length - 1); this.openFileDialog1.Filter = filter; inputWnd = new InputWindow(this); spriteWnd = new SpriteWindow(this); toolBox = new ToolBox(this, inputWnd); // Setup MainForm events this.KeyPreview = true; this.KeyUp += this.keyUpHandler; this.KeyDown += this.keysHandler; this.Resize += this.catchWindowState; this.Layout += this.layoutHandler; Utils.ApplyRecursiveControlFunc(this, this.ConfigureControls); _sendTileEvents = new[] { new EventPair("Click", (s, e) => { CopyTile(inputWnd); PasteTile(spriteWnd); _tempSpriteSel = true; }), new EventPair("MouseEnter", (s, e) => { _tempSpriteSel = spriteWnd.Selected; spriteWnd.Selected = true; spriteWnd.Draw(); }), new EventPair("MouseLeave", (s, e) => { spriteWnd.Selected = _tempSpriteSel; spriteWnd.Draw(); }) }; UpdateMinimumSize(); inputWnd.Focus(this); }