public void DestroyWidget(Widget widget) { Contract.ArgumentNotNull(widget, "widget"); // in case special widgets are destroyed manually, set them to 0 if (widget == _logo) { _logo = null; } else if (widget == _statsPanel) { _statsPanel = null; } else if (widget == _fpsLabel) { _fpsLabel = null; } _trays[(int)widget.TrayLocation].RemoveChild(widget.Name); var wList = _widgets[(int)widget.TrayLocation]; wList.Remove(widget); //if (widget == mExpandedMenu) setExpandedMenu(0); widget.Cleanup(); //mWidgetDeathRow.push_back(widget); AdjustTrays(); }
public ParamsPanel CreateParamsPanel(TrayLocation trayLoc, string name, float width, StringVector paramNames) { ParamsPanel pp = new ParamsPanel(name, width, paramNames.Count); pp.SetAllParamNames(paramNames); MoveWidgetToTray(pp, trayLoc); return(pp); }
public void HideFrameStats() { if (AreFrameStatsVisible()) { DestroyWidget(_fpsLabel); DestroyWidget(_statsPanel); _fpsLabel = null; _statsPanel = null; } }
public void ShowFrameStats(TrayLocation trayLoc, int place = -1) { if (!AreFrameStatsVisible()) { StringVector stats = new StringVector(); stats.Add("Average FPS"); stats.Add("Best FPS"); stats.Add("Worst FPS"); stats.Add("Triangles"); stats.Add("Batches"); _fpsLabel = CreateLabel(TrayLocation.None, Name + "/FpsLabel", "FPS:", 180); //_fpsLabel._AssignListener(this); _statsPanel = CreateParamsPanel(TrayLocation.None, Name + "/StatsPanel", 180, stats); } }