public FillingCupProgressBarControl() { InitializeComponent(); groupBox1.Text = ResourceLoadHelper.GetLocalString("Queue"); fillingCupIndicator.Value = 0; _fillColor = fillingCupIndicator.ForeColor; if (fillingCupIndicator.SkinImage == null) { if ((fillingCupIndicator.SkinImage = ResourceLoadHelper.GetImage(ResourceLoadHelper.GetImageName(DrinkType.None))) == null) { fillingCupIndicator.SkinExceptRectangleForProgressBar = new Rectangle(15, 36, 52, 105); } else { fillingCupIndicator.SkinExceptRectangleForProgressBar = fillingCupIndicator.DisplayRectangle; } } queueImages.Images.Add(ResourceLoadHelper.GetBlankImage(new Size(66, 66), Color.Empty)); queueImages.Images.Add(ResourceLoadHelper.GetImage(ResourceLoadHelper.GetImageName(DrinkType.Tea)) ?? ResourceLoadHelper.GetBlankImage(new Size(66, 66), Color.Empty)); queueImages.Images.Add(ResourceLoadHelper.GetImage(ResourceLoadHelper.GetImageName(DrinkType.Coffee)) ?? ResourceLoadHelper.GetBlankImage(new Size(66, 66), Color.Empty)); queueImages.Images.Add(ResourceLoadHelper.GetImage(ResourceLoadHelper.GetImageName(DrinkType.Juice)) ?? ResourceLoadHelper.GetBlankImage(new Size(66, 66), Color.Empty)); _flashingCup.NextOperation += NextOperation; _flashingCup.FillCupComplete += FillCupComplete; _flashingCup.HideCup += HideCup; _flashingCup.ShowCup += ShowCup; _flashingCup.FillCupProgress += FillCupProgress; }
private void descriptionToolTips_Draw(object sender, DrawToolTipEventArgs e) { e.DrawBackground(); Rectangle rect = e.Bounds; Bitmap bmp = new Bitmap(ResourceLoadHelper.GetBlankImage(new Size(rect.Width, rect.Height), descriptionToolTips.BackColor)); foreach (Component c in descriptionToolTips.Container.Components) { if (c is CoinsBar) { CoinsBar cb = c as CoinsBar; if (cb.Visible) { rect = cb.Bounds; cb.DrawToBitmap(bmp, rect); e.Graphics.DrawImage(bmp, rect, rect, GraphicsUnit.Pixel); e.Graphics.DrawString(string.Format("x{0}", _drawnCoins[(CoinType)cb.CoinValue]), new Font("Microsoft Sans Serif", 7, FontStyle.Italic), new SolidBrush(Color.Black), rect.Right, rect.Bottom - 14); } } } e.DrawBorder(); }