public CashButtonControl() { InitializeComponent(); groupBox1.Text = ResourceLoadHelper.GetLocalString("PayGroup"); label1.Text = ResourceLoadHelper.GetLocalString("PayCurrency"); changeButton.Text = ResourceLoadHelper.GetLocalString("Change"); }
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 taskQueue_DrawItem(object sender, DrawListViewItemEventArgs e) { Rectangle rect = e.Bounds; e.Graphics.FillRectangle(new SolidBrush(e.Item.BackColor), rect); e.Graphics.DrawImage(ResourceLoadHelper.GetImage(ResourceLoadHelper.GetImageName((DrinkType)e.Item.ImageIndex)), rect); if (e.Item.Index == 0) { Pen pen = new Pen(taskQueue.ForeColor, 2); pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dash; rect.Inflate(-1, -1); e.Graphics.DrawRectangle(pen, rect); } }
private void coins_GiveFeedback(object sender, GiveFeedbackEventArgs e) { switch (e.Effect) { case DragDropEffects.Move: e.UseDefaultCursors = false; Cursor.Current = ResourceLoadHelper.GetCoinCursor(new Size(30, 30), ((CoinsBar)sender).BackColor, ((CoinsBar)sender).ForeColor, ((CoinsBar)sender).Parent.Font, ((CoinsBar)sender).CoinValue); break; case DragDropEffects.Link: e.UseDefaultCursors = false; Cursor.Current = ResourceLoadHelper.GetPutCoinCursor(new Size(10, 30), ((CoinsBar)sender).BackColor, ((CoinsBar)sender).ForeColor); break; } }
public void RefreshGoods(Dictionary <Guid, Product> drinks) { descriptionToolTips.RemoveAll(); if (drinks.Any() && (_buttons == null)) { _buttons = drinks.Values.ToDictionary(x => x.id, y => new Button() { Size = new Size(94, 94), Font = new Font(Font, FontStyle.Bold), TextAlign = ContentAlignment.TopRight, ForeColor = y.parsedColor.R + y.parsedColor.G + y.parsedColor.B > 381 ? Color.Black : Color.White, BackColor = y.parsedColor, BackgroundImageLayout = ImageLayout.Stretch, BackgroundImage = y.type == DrinkType.None ? null : ResourceLoadHelper.GetImage(ResourceLoadHelper.GetImageName(y.type)) }); foreach (KeyValuePair <Guid, Button> btn in _buttons) { _goodsButtonHandlers.Add(btn.Key, (s, e) => { if (Purchase != null) { Purchase(btn.Key); } }); btn.Value.Click += _goodsButtonHandlers[btn.Key]; } flowLayoutPanel1.Controls.AddRange(_buttons.Values.ToArray()); } else { if (_buttons == null) { return; } List <Guid> delete = _buttons.Keys.Except(drinks.Keys).ToList(); foreach (Guid guid in delete) { _buttons[guid].Click -= _goodsButtonHandlers[guid]; flowLayoutPanel1.Controls.Remove(_buttons[guid]); _buttons.Remove(guid); } } if (_buttons.Any()) { foreach (Product drink in drinks.Values) { _buttons[drink.id].Text = drink.quantity.ToString(); descriptionToolTips.SetToolTip(_buttons[drink.id], string.Format(ResourceLoadHelper.GetLocalString("GoodsDescription"), ResourceLoadHelper.GetLocalName(drink.locals), drink.price, drink.quantity)); } } }
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(); }
public void InsufficientMessage() { timer1.Stop(); display.Text = ResourceLoadHelper.GetLocalString("InsufficientMessage"); timer1.Start(); }
public void ThanksMessage() { timer1.Stop(); display.Text = ResourceLoadHelper.GetLocalString("ThanksMessage"); timer1.Start(); }
public GoodsButtonControl() { InitializeComponent(); groupBox1.Text = ResourceLoadHelper.GetLocalString("DrinksGroup"); }