public GObjectEditor(object obj) : base(0, 0, 317, 392) { Gumps.Focus = (Gump)this; this.m_Object = obj; this.m_NonRestrictivePicking = true; this.Text = "Option Editor"; Hashtable categories = new Hashtable(); this.BuildCategories(obj, categories); ArrayList arrayList = new ArrayList((ICollection)categories); arrayList.Sort((IComparer) new CategorySorter()); ArrayList panels = new ArrayList(); foreach (DictionaryEntry dictionaryEntry in arrayList) { string category = (string)dictionaryEntry.Key; ArrayList entries = (ArrayList)dictionaryEntry.Value; GCategoryPanel gcategoryPanel = new GCategoryPanel(obj, category, entries); panels.Add((object)gcategoryPanel); } GEditorPanel geditorPanel = new GEditorPanel(panels, 360); this.m_Panel = geditorPanel; geditorPanel.X += 2; geditorPanel.Y += 3; this.Client.m_NonRestrictivePicking = true; this.Client.Children.Add((Gump)geditorPanel); this.Center(); }
public void Layout() { int num1 = 5; int num2 = 0; int num3 = 0; int num4 = 0; if (this.m_Scroller != null) { num2 = -this.m_Scroller.Value; } for (int index = 0; index < this.m_Panels.Length; ++index) { GCategoryPanel gcategoryPanel = this.m_Panels[index]; gcategoryPanel.X = 5; gcategoryPanel.Y = num1 + num2; if (this.m_Scroller == null) { this.m_Children.Add((Gump)gcategoryPanel); } if (gcategoryPanel.Width > num3) { num3 = gcategoryPanel.Width; } if (num1 + gcategoryPanel.Height > num4) { num4 = num1 + gcategoryPanel.Height; } num1 += gcategoryPanel.Height - 1; } int num5 = num3 + 26; this.Width = num5; if (this.m_Scroller != null) { return; } this.m_Scroller = new GEditorScroller(this); this.m_Scroller.X = num5 - 16; this.m_Scroller.Y = 0; this.m_Scroller.Height = this.Height; this.m_Scroller.Width = 16; this.m_Scroller.Maximum = num4 - this.Height + 5; this.m_Children.Insert(0, (Gump)this.m_Scroller); }