private void TileSetList_CharSetMenuRequested(object sender, CharSetMenuEventArgs e) { setToDelete = e.CharSet; listToDelete = sender as CharSetList; var point = e.Source.PointToScreen(e.Position); ctmCharSets.Show(point); }
public void DeleteCharSet(CharSet Set) { CharSetList listToDelete = null; if (Set.SetType == Enums.CharSetType.Sprite) { listToDelete = spriteSetList; } else { listToDelete = tileSetList; } listToDelete.RemoveCharSet(Set); }
public CharSetListManager(bool IncludeSpriteSet, bool IncludeTileSet) { InitializeComponent(); int width = 0; if (IncludeSpriteSet) { spriteSetList = new CharSetList(); spriteSetList.Top = 0; spriteSetList.Left = 0; spriteSetList.Width = CharSetList.ItemSize + 32; spriteSetList.Height = this.ClientSize.Height; spriteSetList.Title = "Sprites"; spriteSetList.CharSetSelected += CharSetList_CharSetSelected; spriteSetList.CharSetMenuRequested += SpriteSetList_CharSetMenuRequested; Controls.Add(spriteSetList); spriteSetList.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Bottom; width = spriteSetList.Width; } if (IncludeTileSet) { tileSetList = new CharSetList(); tileSetList.Top = 0; tileSetList.Left = width; tileSetList.Width = CharSetList.ItemSize + 32; tileSetList.Height = this.ClientSize.Height; tileSetList.Title = "Tiles"; tileSetList.CharSetSelected += CharSetList_CharSetSelected; tileSetList.CharSetMenuRequested += TileSetList_CharSetMenuRequested; Controls.Add(tileSetList); tileSetList.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Bottom; width += tileSetList.Width; } var clw = this.ClientSize; clw.Width = width; this.ClientSize = clw; this.MinimumSize = new Size(this.Width, CharSetList.ItemSize); this.MaximumSize = new Size(this.Width, 10000); }