/// <summary> /// Initializes a new instance of the BagButtonBase class. /// </summary> /// <param name="bagNumber">number of the bag for display</param> /// <param name="getToolTip">Tooltip delegate</param> protected BagButtonBase(int bagNumber, GetToolTip getToolTip) { this.getToolTip = getToolTip; this.ButtonNumber = bagNumber; BackColor = Color.Black; MouseEnter += new EventHandler(this.MouseEnterCallback); MouseLeave += new EventHandler(this.MouseLeaveCallback); Paint += new PaintEventHandler(this.PaintCallback); // Da_FileServer: Some small paint optimizations. this.SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint, true); }
/// <summary> /// Initializes a new instance of the BagButtonBase class. /// </summary> /// <param name="bagNumber">number of the bag for display</param> /// <param name="getToolTip">Tooltip delegate</param> public BagButtonBase(int bagNumber, GetToolTip getToolTip, IServiceProvider serviceProvider) { InitializeComponent(); this.ServiceProvider = serviceProvider; this.FontService = this.ServiceProvider.GetService <IFontService>(); this.UIService = this.ServiceProvider.GetService <IUIService>(); this.getToolTip = getToolTip; this.ButtonNumber = bagNumber; // Da_FileServer: Some small paint optimizations. this.SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint, true); }
/// <summary> /// Tooltip callback that is used to display a tooltip with the bag's contents. /// </summary> /// <param name="windowHandle">window handle for parent</param> /// <returns>string with the bag's contents</returns> public string ToolTipCallback(int windowHandle) { // see if this is us if (this.Handle.ToInt32() == windowHandle) { // yep. GetToolTip temp = this.getToolTip; if (temp != null) { return(temp(this)); } } return(null); }
/// <summary> /// Initializes a new instance of the StashButton class. /// </summary> /// <param name="bagNumber">number of the bag for display</param> /// <param name="getToolTip">Tooltip delegate</param> /// <param name="tooltip">Tooltip instance</param> public StashButton(int bagNumber, GetToolTip getToolTip) : base(bagNumber, getToolTip) { // Override the default background graphics. this.CreateBackgroundGraphics(); }
/// <summary> /// Initializes a new instance of the BagButton class. /// </summary> /// <param name="bagNumber">number of the bag for display</param> /// <param name="getToolTip">Tooltip delegate</param> public BagButton(int bagNumber, GetToolTip getToolTip, IServiceProvider serviceProvider) : base(bagNumber, getToolTip, serviceProvider) { }
/// <summary> /// Initializes a new instance of the BagButton class. /// </summary> /// <param name="bagNumber">number of the bag for display</param> /// <param name="getToolTip">Tooltip delegate</param> /// <param name="tooltip">Tooltip instance</param> public BagButton(int bagNumber, GetToolTip getToolTip) : base(bagNumber, getToolTip) { }
/// <summary> /// Initializes a new instance of the BagButton class. /// </summary> /// <param name="bagNumber">number of the bag for display</param> /// <param name="getToolTip">Tooltip delegate</param> /// <param name="tooltip">Tooltip instance</param> public BagButton(int bagNumber, GetToolTip getToolTip, TTLib tooltip) : base(bagNumber, getToolTip, tooltip) { }