示例#1
0
        public CBaseWindow(CBaseWindow inParent, string inName, NamedId inWindowType, Rect inBaseRect, IGUIRealization inGUIRealization, CWindowTypeDescrs window_type_descrs)
        {
            Id = ++_id_counter;

            WindowType = inWindowType;

            _window_type_descrs = window_type_descrs;

            SetParent(inParent);

            _params.Add(SWindowParamDescr.Name.Id, new CStringParam(inName));
            _params.Add(SWindowParamDescr.Indent.Id, new CPVectorParam(new PVector2(inBaseRect.left, inBaseRect.top)));
            _params.Add(SWindowParamDescr.Shift.Id, new CPVectorParam(new PVector2()));
            _params.Add(SWindowParamDescr.Size.Id, new CPVectorParam(new PVector2(inBaseRect.Width, inBaseRect.Hight)));

            _gui_realization = inGUIRealization;
            _gui_realization.OnCreateWindow(this);
        }
示例#2
0
        public virtual void Dispose()
        {
            if (IsDisposed)
            {
                return;
            }

            _gui_realization.OnDeleteWindow(this);
            _gui_realization = null;

            var lst = new List <CBaseWindow>(_childs);

            lst.ForEach(w => w.Dispose());

            if (Parent != null)
            {
                Parent.RemoveChild(this);
            }
            Parent = null;

            IsDisposed = true;
        }
示例#3
0
 public CGUIBuilder(IParserOwner inParserOwner, IGUIRealization inGUIRealization, Rect inBaseRect)
 {
     _parser          = new CParserManager(inParserOwner);
     _gui_realization = inGUIRealization;
     _root            = new CBaseWindow(null, "MainFrame", new NamedId(uint.MaxValue, "MainFrame"), inBaseRect, _gui_realization, _window_type_descrs);
 }