Exemple #1
0
        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();
        }
Exemple #2
0
        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);
        }
Exemple #3
0
 public void HideFrameStats()
 {
     if (AreFrameStatsVisible())
     {
         DestroyWidget(_fpsLabel);
         DestroyWidget(_statsPanel);
         _fpsLabel   = null;
         _statsPanel = null;
     }
 }
Exemple #4
0
        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);
            }
        }