//TODO public Tree tree <-- would it be helpful to have? public SkillButton(Skill inSkill, TreeTableLayoutPanel parentControl, SkillTooltipPanel skillTooltip, MainForm inForm) { InitializeComponent(); //Set the Skill skill = inSkill; this.Parent = parentControl; this.form = inForm; this.lblSkillLevel.Text = this.skill.level.ToString(); this.skillTooltipPanel = skillTooltip; //Set the .Name property based on the Skill's Name this.Name = skill.id.ToString(); //Specify defaults for this custom control this.pnlSkillButton.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Bottom); this.pnlSkillButton.Dock = DockStyle.Fill; //Background Image ResourceManagerImageSkill = new ResourceManager("ChroniCalc.ResourceImageSkill", Assembly.GetExecutingAssembly()); if (!((Image)ResourceManagerImageSkill.GetObject(MainForm.GetSkillButtonIconFilename(parentControl.tree.name, inSkill.id)) is null)) { this.pbSkillIcon.BackgroundImage = (Image)ResourceManagerImageSkill.GetObject(MainForm.GetSkillButtonIconFilename(parentControl.tree.name, inSkill.id)); }
public SkillSelectButton(MainForm inForm, SkillTooltipPanel skillTooltip) { InitializeComponent(); //Specify defaults for this custom control this.form = inForm; this.skillTooltipPanel = skillTooltip; //Size this.Height = 30; this.Width = 30; //Image Layout this.BackgroundImageLayout = ImageLayout.Stretch; }