public GTextBox(int GumpID, bool HasBorder, int X, int Y, int Width, int Height, string StartText, IFont f, IHue HNormal, IHue HOver, IHue HFocus, char PassChar) : base(X, Y) { this.m_Transparent = GumpID == 0; this.m_Back = new GBackground(GumpID, Width, Height, HasBorder); this.m_PassChar = PassChar; this.m_String = StartText; this.m_Font = f; this.m_HNormal = HNormal; this.m_HFocus = HFocus; this.m_HOver = HOver; this.m_Width = Width; this.m_Height = Height; this.m_OverCursor = 14; this.UpdateLabel(false, this.m_HNormal); }
public GQuestionMenu(int serial, int menuID, string question, AnswerEntry[] answers) : base(9204, Engine.ScreenWidth / 2, 100, 50, 50, true) { this.m_CanDrag = true; this.m_QuickDrag = true; this.m_Serial = serial; this.m_MenuID = menuID; GWrappedLabel gwrappedLabel = new GWrappedLabel(question, (IFont)Engine.GetFont(1), Hues.Load(1109), this.OffsetX + 4, this.OffsetY + 4, this.UseWidth - 8); this.m_Children.Add((Gump)gwrappedLabel); this.m_Entries = new GQuestionMenuEntry[answers.Length]; GBackground gbackground = (GBackground) new GQuestionBackground(this.m_Entries, this.UseWidth - 8, this.UseHeight - 8 - gwrappedLabel.Height - 4, this.OffsetX + 4, gwrappedLabel.Y + gwrappedLabel.Height + 4); gbackground.SetMouseOverride((Gump)this); int offsetX = gbackground.OffsetX; int offsetY1 = gbackground.OffsetY; int useWidth = gbackground.UseWidth; for (int index = 0; index < answers.Length; ++index) { GQuestionMenuEntry gquestionMenuEntry = new GQuestionMenuEntry(offsetX, offsetY1, useWidth, answers[index]); gbackground.Children.Add((Gump)gquestionMenuEntry); gquestionMenuEntry.Radio.ParentOverride = (Gump)gbackground; this.m_Entries[index] = gquestionMenuEntry; offsetY1 += gquestionMenuEntry.Height + 4; } gbackground.Height = offsetY1 - 4 - gbackground.OffsetY + (gbackground.Height - gbackground.UseHeight); this.Height = this.Height - this.UseHeight + 4 + gwrappedLabel.Height + 4 + gbackground.Height + 4; int num1 = (int)((double)Engine.ScreenHeight * 0.75); if (this.Height > num1) { this.Height = num1; gbackground.Height = this.UseHeight - 8 - gwrappedLabel.Height - 4; } int num2 = offsetY1 - 4 - gbackground.OffsetY; if (num2 > gbackground.UseHeight) { int num3 = num2; gbackground.Width += 19; this.Width += 19; int num4 = gbackground.OffsetX + gbackground.UseWidth - 15; int offsetY2 = gbackground.OffsetY; gbackground.Children.Add((Gump) new GImage(257, num4, offsetY2)); gbackground.Children.Add((Gump) new GImage((int)byte.MaxValue, num4, offsetY2 + gbackground.UseHeight - 32)); int y = offsetY2 + 30; while (y + 32 < gbackground.UseHeight) { gbackground.Children.Add((Gump) new GImage(256, num4, y)); y += 30; } this.m_Slider = new GVSlider(254, num4 + 1, offsetY2 + 1 + 12, 13, gbackground.UseHeight - 2 - 24, 0.0, 0.0, (double)(num3 - gbackground.UseHeight), 1.0); this.m_Slider.OnValueChange = new OnValueChange(this.OnScroll); this.m_Slider.ScrollOffset = 20.0; gbackground.Children.Add((Gump)this.m_Slider); gbackground.Children.Add((Gump) new GHotspot(num4, offsetY2, 15, gbackground.UseHeight, (Gump)this.m_Slider)); } GButtonNew gbuttonNew1 = new GButtonNew(243, 242, 241, 0, gbackground.Y + gbackground.Height + 4); GButtonNew gbuttonNew2 = new GButtonNew(249, 247, 248, 0, gbuttonNew1.Y); gbuttonNew1.Clicked += new EventHandler(this.Cancel_Clicked); gbuttonNew2.Clicked += new EventHandler(this.Okay_Clicked); gbuttonNew1.X = this.OffsetX + this.UseWidth - 4 - gbuttonNew1.Width; gbuttonNew2.X = gbuttonNew1.X - 4 - gbuttonNew2.Width; this.m_Children.Add((Gump)gbuttonNew1); this.m_Children.Add((Gump)gbuttonNew2); this.Height += 4 + gbuttonNew1.Height; this.m_Children.Add((Gump)gbackground); this.Center(); }