diff --git a/SpriteLibrary/SpriteEntryForm.Designer.cs b/SpriteLibrary/SpriteEntryForm.Designer.cs index b800d54..80d9a88 100644 --- a/SpriteLibrary/SpriteEntryForm.Designer.cs +++ b/SpriteLibrary/SpriteEntryForm.Designer.cs @@ -171,6 +171,7 @@ this.btnApply.TabIndex = 10; this.btnApply.Text = "Apply"; this.btnApply.UseVisualStyleBackColor = true; + this.btnApply.Click += new System.EventHandler(this.btnApply_Click); // // btnNewSprite // @@ -222,6 +223,7 @@ this.btnBack.TabIndex = 16; this.btnBack.Text = "<"; this.btnBack.UseVisualStyleBackColor = true; + this.btnBack.Click += new System.EventHandler(this.btnBack_Click); // // btnFwd // @@ -232,6 +234,7 @@ this.btnFwd.TabIndex = 17; this.btnFwd.Text = ">"; this.btnFwd.UseVisualStyleBackColor = true; + this.btnFwd.Click += new System.EventHandler(this.btnFwd_Click); // // lblCountSprites // diff --git a/SpriteLibrary/SpriteEntryForm.cs b/SpriteLibrary/SpriteEntryForm.cs index dbf14e3..8810bc7 100644 --- a/SpriteLibrary/SpriteEntryForm.cs +++ b/SpriteLibrary/SpriteEntryForm.cs @@ -280,5 +280,37 @@ namespace SpriteLibrary WeAreDragging = false; } + + private void btnApply_Click(object sender, EventArgs e) + { + if(CurrentSIIndex >0 && CurrentSIIndex < SpriteInformation.Count) + { + SpriteInformation[CurrentSIIndex].CopyFrom(TempInformation); + } + else + { + SpriteInformation.Add(TempInformation); + CurrentSIIndex = SpriteInformation.IndexOf(TempInformation); + } + UpdateMenu(); + } + + private void btnFwd_Click(object sender, EventArgs e) + { + if (SpriteInformation.Count == 0) return; //nothing to do + CurrentSIIndex++; + if (CurrentSIIndex >= SpriteInformation.Count) CurrentSIIndex = 0; + SpriteInformationToForm(); + UpdateMenu(); + } + + private void btnBack_Click(object sender, EventArgs e) + { + if (SpriteInformation.Count == 0) return; //nothing to do + CurrentSIIndex--; + if (CurrentSIIndex < 0) CurrentSIIndex = SpriteInformation.Count - 1; + SpriteInformationToForm(); + UpdateMenu(); + } } }