public GDragAmount(Item item) : base(2140, 0, 0) { this.m_Item = item; int num = (int)(ushort)this.m_Item.Amount; this.m_Amount = num; this.m_Okay = new GButtonNew(2074, 2076, 2075, 102, 37); this.m_Okay.CanEnter = true; this.m_Okay.Clicked += new EventHandler(this.Okay_Clicked); this.m_Children.Add((Gump)this.m_Okay); GSlider gslider = new GSlider(2117, 35, 16, 95, 15, (double)num, 0.0, (double)num, 1.0); gslider.OnValueChange = new OnValueChange(this.Slider_OnValueChange); this.m_Children.Add((Gump)gslider); this.m_Slider = gslider; this.m_Children.Add((Gump) new GHotspot(28, 16, 109, 15, (Gump)gslider)); GTextBox gtextBox = new GTextBox(0, false, 26, 43, 66, 15, num.ToString(), (IFont)Engine.GetFont(1), Hues.Load(1109), Hues.Load(1109), Hues.Load(1109)); gtextBox.OnTextChange += new OnTextChange(this.TextBox_OnTextChange); gtextBox.OnBeforeTextChange += new OnBeforeTextChange(this.TextBox_OnBeforeTextChange); gtextBox.EnterButton = (IClickable)this.m_Okay; this.m_Children.Add((Gump)gtextBox); this.m_TextBox = gtextBox; gtextBox.Focus(); this.m_IsDragging = true; this.m_OffsetX = this.Width / 2; this.m_OffsetY = this.Height / 2; Gumps.LastOver = (Gump)this; Gumps.Drag = (Gump)this; Gumps.Focus = (Gump)this; this.m_X = Engine.m_xMouse - this.m_OffsetX; this.m_Y = Engine.m_yMouse - this.m_OffsetY; }
public GWindowsTextBox(int x, int y, int width, int height, string initialText, IFont font, IHue normalHue, IHue overHue, IHue focusHue, char passChar) : base(x, y) { this.m_Width = width; this.m_Height = height; this.m_TextBox = new GTextBox(0, false, 3, 3, width - 6, height - 6, initialText, font, normalHue, overHue, focusHue, passChar); this.Layout(); this.m_Children.Add((Gump)this.m_TextBox); }
private GTextBox AddTextBox(string name, int index, string initialText, char pc) { int Y = 30 + index * 25; GLabel glabel = new GLabel(name, (IFont)Engine.GetUniFont(2), GumpHues.ControlText, 0, 0); glabel.X = 10 - glabel.Image.xMin; glabel.Y = Y + (22 - (glabel.Image.yMax - glabel.Image.yMin + 1)) / 2 - glabel.Image.yMin; this.m_Children.Add((Gump)glabel); this.m_Children.Add((Gump) new GAlphaBackground(60, Y, 200, 22) { ShouldHitTest = false, FillColor = GumpColors.Window, FillAlpha = 1f }); IHue windowText = GumpHues.WindowText; GTextBox gtextBox = new GTextBox(0, false, 64, Y, 196, 22, initialText, (IFont)Engine.GetUniFont(2), windowText, windowText, windowText, pc); this.Client.Children.Add((Gump)gtextBox); return(gtextBox); }
public GMacroEditorPanel(Macro m) : base(0, 0, 259, 230) { this.m_Macro = m; this.m_CanDrag = false; this.m_NonRestrictivePicking = true; this.ShouldHitTest = false; this.m_Ctrl = new GSystemButton(10, 10, 40, 20, GumpPaint.Blend(Color.WhiteSmoke, SystemColors.Control, 0.5f), SystemColors.ControlText, "Ctrl", (IFont)Engine.GetUniFont(2)); this.m_Alt = new GSystemButton(49, 10, 40, 20, GumpPaint.Blend(Color.WhiteSmoke, SystemColors.Control, 0.5f), SystemColors.ControlText, "Alt", (IFont)Engine.GetUniFont(2)); this.m_Shift = new GSystemButton(88, 10, 42, 20, GumpPaint.Blend(Color.WhiteSmoke, SystemColors.Control, 0.5f), SystemColors.ControlText, "Shift", (IFont)Engine.GetUniFont(2)); this.m_Ctrl.OnClick = new OnClick(this.Ctrl_OnClick); this.m_Alt.OnClick = new OnClick(this.Alt_OnClick); this.m_Shift.OnClick = new OnClick(this.Shift_OnClick); this.m_Ctrl.Tooltip = (ITooltip) new Tooltip("Toggles the control key modifier", true); this.m_Alt.Tooltip = (ITooltip) new Tooltip("Toggles the alt key modifier", true); this.m_Shift.Tooltip = (ITooltip) new Tooltip("Toggles the shift key modifier", true); this.m_Children.Add((Gump)this.m_Ctrl); this.m_Children.Add((Gump)this.m_Alt); this.m_Children.Add((Gump)this.m_Shift); this.UpdateModifiers(); this.m_Children.Add((Gump) new GAlphaBackground(129, 10, 74, 20) { FillAlpha = 1f, FillColor = GumpColors.Window }); GMacroKeyEntry gmacroKeyEntry = new GMacroKeyEntry(GMacroEditorPanel.GetKeyName(m.Key), 129, 10, 74, 20); gmacroKeyEntry.Tooltip = (ITooltip) new Tooltip("Press any key here to change the macro", true); this.m_Children.Add((Gump)gmacroKeyEntry); GSystemButton gsystemButton = new GSystemButton(10, 10, 40, 20, GumpPaint.Blend(Color.WhiteSmoke, SystemColors.Control, 0.5f), SystemColors.ControlText, "Delete", (IFont)Engine.GetUniFont(2)); gsystemButton.SetBackColor(GumpPaint.Blend(Color.SteelBlue, SystemColors.Control, 0.25f)); gsystemButton.InactiveColor = GumpPaint.Blend(Color.WhiteSmoke, SystemColors.Control, 0.5f); gsystemButton.Tooltip = (ITooltip) new Tooltip("Deletes the entire macro", true); gsystemButton.OnClick = new OnClick(this.Delete_OnClick); gsystemButton.X = this.Width - 10 - gsystemButton.Width; this.m_Children.Add((Gump)gsystemButton); this.FillAlpha = 0.15f; for (int index = 0; index < m.Actions.Count; ++index) { try { Action action = m.Actions[index]; if (action.Handler != null) { ActionHandler handler = action.Handler; GMainMenu gmainMenu = new GMainMenu(10, 35 + index * 23); GMenuItem mi = (GMenuItem) new GActionMenu(this, m, action); gmainMenu.Add(this.FormatMenu(mi)); if (handler.Params == null) { GAlphaBackground galphaBackground = new GAlphaBackground(129, 35 + index * 23, 120, 24); galphaBackground.FillAlpha = 1f; galphaBackground.FillColor = GumpColors.Window; this.m_Children.Add((Gump)galphaBackground); IHue windowText = GumpHues.WindowText; GTextBox gtextBox = (GTextBox) new GMacroParamEntry(action, action.Param, galphaBackground.X + 4, galphaBackground.Y, galphaBackground.Width - 4, galphaBackground.Height); gtextBox.MaxChars = 239; this.m_Children.Add((Gump)gtextBox); } else if (handler.Params.Length != 0) { GMenuItem menuFrom = this.GetMenuFrom(new ParamNode(GMacroEditorPanel.Find(action.Param, handler.Params) ?? action.Param, handler.Params), action, handler); menuFrom.DropDown = index == m.Actions.Count - 1; gmainMenu.Add(menuFrom); } gmainMenu.LeftToRight = true; this.m_Children.Add((Gump)gmainMenu); } } catch { } } GMainMenu gmainMenu1 = new GMainMenu(10, 35 + m.Actions.Count * 23); GMenuItem menuFrom1 = this.GetMenuFrom(ActionHandler.Root); menuFrom1.Tooltip = (ITooltip) new Tooltip("To create a new instruction pick one from the menu below", false, 200); menuFrom1.Text = "New..."; menuFrom1.DropDown = true; gmainMenu1.Add(this.FormatMenu(menuFrom1)); gmainMenu1.LeftToRight = true; this.m_Children.Add((Gump)gmainMenu1); }