public virtual void HandleLimitedTextInput(GumpTextEntryLimited input, string text) { if (LimitedTextInputHandler != null) { LimitedTextInputHandler(input, text); } else if (LimitedTextInputs[input] != null) { LimitedTextInputs[input](input, text); } }
protected void AddTextEntryLimited(GumpTextEntryLimited input, Action<GumpTextEntryLimited, string> handler) { if (input == null) { return; } if (!LimitedTextInputs.ContainsKey(input)) { LimitedTextInputs.Add(input, handler); } else { LimitedTextInputs[input] = handler; } Add(input); }
public virtual bool CanDisplay(GumpTextEntryLimited input) { return (input != null); }
public virtual void Write(string name, GumpTextEntryLimited e) { CreateElement(e); SetAttribute("name", name); SetAttribute("x", e.X); SetAttribute("y", e.Y); SetAttribute("width", e.Width); SetAttribute("height", e.Height); SetAttribute("entryid", e.EntryID); SetAttribute("limit", e.Size); SetAttribute("hue", e.Hue); SetValue(e.InitialText); Append(); }
protected virtual void ParseInput(GumpTextEntryLimited entry, string text) { ParseInput(text); }
protected override void ParseInput(GumpTextEntryLimited entry, string text) { switch (entry.EntryID) { case 0: Month = Int32.TryParse(text, out Month) ? Math.Max(1, Math.Min(12, Month)) : 0; break; case 1: Day = Int32.TryParse(text, out Day) ? Math.Max(1, Math.Min(31, Day)) : 0; break; case 2: Year = Int32.TryParse(text, out Year) ? Math.Max(1, Math.Min(9999, Year)) : 0; break; } base.ParseInput(entry, text); }