/// <summary> /// Initializes the GUI elements for the entry. /// </summary> /// <param name="parent">Scroll area into whose layout to insert the GUI elements.</param> internal void Initialize(GUIListViewBase <TData> parent) { this.parent = parent; GUIScrollArea scrollArea = parent.ScrollArea; int numElements = scrollArea.Layout.ChildCount; // Last panel is always the padding panel, so keep it there panel = scrollArea.Layout.InsertPanel(numElements - 1); layout = panel.AddLayoutY(); BuildGUI(); }
/// <summary> /// Creates a new empty list view. /// </summary> /// <param name="width">Width of the list view, in pixels.</param> /// <param name="height">Height of the list view, in pixels.</param> /// <param name="entryHeight">Height of a single element in the list, in pixels.</param> /// <param name="layout">GUI layout into which the list view will be placed into.</param> protected GUIListViewBase(int width, int height, int entryHeight, GUILayout layout) { scrollArea = new GUIScrollArea(ScrollBarType.ShowIfDoesntFit, ScrollBarType.NeverShow, GUIOption.FixedWidth(width), GUIOption.FixedHeight(height)); layout.AddElement(scrollArea); topPadding = new GUILabel(new LocString()); bottomPadding = new GUILabel(new LocString()); scrollArea.Layout.AddElement(topPadding); scrollArea.Layout.AddElement(bottomPadding); this.width = width; this.height = height; this.entryHeight = entryHeight; }
private static extern void Internal_CreateInstance(GUIScrollArea instance, ScrollBarType vertBarType, ScrollBarType horzBarType, string scrollBarStyle, string scrollAreaStyle, params GUIOption[] options);
/// <summary> /// Internal method used by the runtime. Initializes a managed version of the vertical layout that is referenced /// by a native GUI scroll area element. /// </summary> /// <param name="parentArea">Scroll area of which we want to reference the layout of.</param> internal GUILayoutY(GUIScrollArea parentArea) { Internal_CreateInstanceYFromScrollArea(this, parentArea); }
protected static extern void Internal_CreateInstanceYFromScrollArea(GUILayout instance, GUIScrollArea parentArea);