protected override void Initialize() { Control.KeyPreview = !ApplicationHandler.BubbleKeyEvents; Control.FormBorderStyle = DefaultWindowStyle; resizable = Control.FormBorderStyle.IsResizable(); content = new swf.Panel { AutoSize = true, AutoSizeMode = swf.AutoSizeMode.GrowAndShrink, Dock = swf.DockStyle.Fill }; Control.Controls.Add(content); toolbarHolder = new swf.Panel { Dock = swf.DockStyle.Top, AutoSizeMode = swf.AutoSizeMode.GrowAndShrink, AutoSize = true }; Control.Controls.Add(toolbarHolder); menuHolder = new swf.Panel { AutoSizeMode = swf.AutoSizeMode.GrowAndShrink, AutoSize = true, Dock = swf.DockStyle.Top }; Control.Controls.Add(menuHolder); Control.Load += (sender, e) => { // ensure we auto size to the content if ((!clientWidthSet || !clientHeightSet) /*&& Control.AutoSize*/ && contentSize != null) { var sz = contentSize.Value.ToSD(); // Content.GetPreferredSize().ToSD(); var min = new sd.Size(); if (!clientWidthSet) { min.Width = sz.Width; } if (!clientHeightSet) { min.Height = sz.Height; } ContainerContentControl.MinimumSize = min; } Control.MinimumSize = Control.Size; Control.AutoSize = false; Control.MinimumSize = MinimumSize.ToSD(); content.MinimumSize = content.MaximumSize = sd.Size.Empty; ContainerContentControl.MinimumSize = sd.Size.Empty; }; Control.Size = sd.Size.Empty; base.Initialize(); // Always handle closing because we want to send Application.Terminating event HandleEvent(Window.ClosingEvent); }
internal override void BuildNodes(System.Xml.XmlElement parent, System.Xml.XmlDocument doc) { XmlElement el = doc.CreateElement("DisplayWindow"); XmlHelper.AppendAttribute(el, doc, "name", Name); XmlHelper.AppendAttribute(el, doc, "preferred_size", Size.ToString()); XmlHelper.AppendAttribute(el, doc, "minimum_size", MinimumSize.ToString()); XmlHelper.AppendAttribute(el, doc, "maximum_size", MaximumSize.ToString()); XmlHelper.AppendAttribute(el, doc, "allow_resize", AllowResize); XmlHelper.AppendAttribute(el, doc, "full_screen", FullScreen); XmlHelper.AppendAttribute(el, doc, "bpp", Bpp); el.InnerText = Title; parent.AppendChild(el); }
public SearchImagesEditorial WithMinimumSize(MinimumSize value) { AddQueryParameter(Constants.MinimumSizeKey, value); return(this); }