public idSimpleWindow(idWindow win) { _gui = win.UserInterface; _context = win.DeviceContext; _drawRect = win.DrawRectangle; _clientRect = win.ClientRectangle; _textRect = win.TextRectangle; _origin = win.Origin; _fontFamily = win.FontFamily; _name = win.Name; _materialScaleX = win.MaterialScaleX; _materialScaleY = win.MaterialScaleY; _borderSize = win.BorderSize; _textAlign = win.TextAlign; _textAlignX = win.TextAlignX; _textAlignY = win.TextAlignY; _background = win.Background; _flags = win.Flags; _textShadow = win.TextShadow; _visible.Set(win.IsVisible); _text.Set(win.Text); _rect.Set(win.Rectangle); _backColor.Set(win.BackColor); _materialColor.Set(win.MaterialColor); _foreColor.Set(win.ForeColor); _borderColor.Set(win.BorderColor); _textScale.Set(win.TextScale); _rotate.Set(win.Rotate); _shear.Set(win.Shear); _backgroundName.Set(win.BackgroundName); if (_backgroundName != string.Empty) { _background = idE.DeclManager.FindMaterial(_backgroundName); _background.Sort = (float)MaterialSort.Gui;; _background.ImageClassification = 1; // just for resource tracking } _backgroundName.Material = _background; _parent = win.Parent; _hideCursor.Set(win.HideCursor); if (_parent != null) { if (_text.NeedsUpdate == true) { _parent.AddUpdateVariable(_text); } if (_visible.NeedsUpdate == true) { _parent.AddUpdateVariable(_visible); } if (_rect.NeedsUpdate == true) { _parent.AddUpdateVariable(_rect); } if (_backColor.NeedsUpdate == true) { _parent.AddUpdateVariable(_backColor); } if (_materialColor.NeedsUpdate == true) { _parent.AddUpdateVariable(_materialColor); } if (_foreColor.NeedsUpdate == true) { _parent.AddUpdateVariable(_foreColor); } if (_borderColor.NeedsUpdate == true) { _parent.AddUpdateVariable(_borderColor); } if (_textScale.NeedsUpdate == true) { _parent.AddUpdateVariable(_textScale); } if (_rotate.NeedsUpdate == true) { _parent.AddUpdateVariable(_rotate); } if (_shear.NeedsUpdate == true) { _parent.AddUpdateVariable(_shear); } if (_backgroundName.NeedsUpdate == true) { _parent.AddUpdateVariable(_backgroundName); } } }