private void DrawWindowContents()
 {
     scrollPosition = GUILayout.BeginScrollView(scrollPosition);
     GUILayout.BeginHorizontal();
     // Date and Time
     StatGUIUtility.DrawDataColumn(0, changes.Count - 1,
                                   (int i) => { return(KSPUtil.dateTimeFormatter.PrintDateCompact(changes[i].Time, true)); },
                                   (int i) => { return(StatGUIUtility.DateText); },
                                   RowClick, PreRow
                                   );
     // Reason
     StatGUIUtility.DrawDataColumn(0, changes.Count - 1,
                                   (int i) => { return(changes[i].Reason.ToString()); },
                                   (int i) => { return(StatGUIUtility.DateText); },
                                   RowClick, PreRow
                                   );
     // Amount
     StatGUIUtility.DrawDataColumn(0, changes.Count - 1,
                                   (int i) => { return(changes[i].After.ToString(FormatString)); },
                                   (int i) => { return(StatGUIUtility.DateText); },
                                   RowClick, PreRow
                                   );
     // Change
     StatGUIUtility.DrawDataColumn(0, changes.Count - 1,
                                   (int i) => { return(changes[i].Change.ToString(StatGUIUtility.alwaysShowSign)); },
                                   (int i) => { return(StatGUIUtility.PosNegStyle(changes[i].Change)); },
                                   RowClick, PreRow
                                   );
     GUILayout.EndHorizontal();
     GUILayout.EndScrollView();
     NetRow();
     GUI.DragWindow();
 }
 private void NetRow()
 {
     GUILayout.BeginHorizontal();
     GUILayout.Label("Marker Time:", StatGUIUtility.DateText, GUILayout.ExpandWidth(true));
     GUILayout.Label(changes.Count > SumCutoffIndex ? changes[SumCutoffIndex].Time.ToDate() : "No Marker", StatGUIUtility.DateTextField, GUILayout.ExpandWidth(true));
     GUILayout.Label("Net Change from Marker:", StatGUIUtility.DateText, GUILayout.ExpandWidth(true));
     GUILayout.Label(cachedChange.ToString(StatGUIUtility.alwaysShowSign), StatGUIUtility.PosNegStyle(cachedChange, true), GUILayout.ExpandWidth(true));
     GUILayout.EndHorizontal();
 }
 private void ResetWindowPosition()
 {
     windowPosition = StatGUIUtility.GetNormalizedRect(0.5f, 0.5f, 0.40f, 0.50f, 0.5f, 0.5f);
 }
 public void Start()
 {
     ToolbarControl.RegisterMod(StatisticsTrackerScenario.modNamespace, StatisticsTrackerScenario.modName);
     ChangesTypes = GetAllChangeClasses();
     StatGUIUtility.CreateStyles(HighLogic.Skin);
 }