Click or drag to resize

GUILayoutStringTable Class

Utility class to draw a simple table with the text column contents.
Inheritance Hierarchy
SystemObject
  KSPDev.GUIUtilsGUILayoutStringTable

Namespace:  KSPDev.GUIUtils
Assembly:  KSPDev_Utils.2.5 (in KSPDev_Utils.2.5.dll) Version: 2.5 for KSP v1
Syntax
C#
public class GUILayoutStringTable
Request Example View Source

The GUILayoutStringTable type exposes the following members.

Constructors
  NameDescription
Public methodGUILayoutStringTable
Creates a table of the specified column width.
Top
Properties
  NameDescription
Public propertykeepMaxSize
Tells if the maximum size of the columns should be persistent between the frames.
Top
Methods
  NameDescription
Public methodAddTextColumn(String, GUIStyle)
Adds a text column into the table.
Public methodAddTextColumn(String, LocalizableMessage, GUIStyle)
Adds a text column into the table.
Public methodAddTextColumn(String, String, GUIStyle)
Adds a text column into the table with a value tooltip.
Public methodAddTextColumn(String, String, LocalizableMessage, GUIStyle)
Adds a text column into the table with a value tooltip.
Public methodAddTextColumn(GUIContent, GUIStyle, Single, Single)
Adds a content into the table column.
Public methodResetMaxSizes
Resets all the accumulated maximum column sizes to zero.
Public methodStartNewRow
Tells that a new row is about to be rendered.
Public methodUpdateFrame
Updates the table state each frame to remember the best column size values.
Top
Remarks

This table cannot hold non-string content. It keeps all the columns to be of the same size, and the size is adjusted to the maximum column's size in all the rows. There is a one frame delay between the content change and the column resizing, which may result in flickering if the content changes too frequently. The columns try to take as small space as possible, so defining the minimum size may be a good bet.

This class is designed to be called on every frame. It's heavily performance optimized.

See Also