public ResizeBar(River.Orqa.Controls.Common.Direction direction, IResizeSource resizeSource) { // Define initial state _direction = direction; _resizing = false; _resizeSource = resizeSource; // Always default to Control color this.BackColor = _resizeSource.ResizeBarColor; this.ForeColor = SystemColors.ControlText; UpdateStyle(_resizeSource.Style); }
protected void InternalConstruct(Control control, River.Orqa.Controls.Common.Direction direction) { // Do we need to create our own window? if (control == null) { // Yes, use a simple panel for organizing children onto _control = new Panel(); } else { // No, use the constructor provided one _control = control; } // Hook into control events _control.Resize += new EventHandler(OnControlResize); // Assign initial values _direction = direction; // Create collection to remember our child objects _children = new TabGroupBaseCollection(); }
public TabGroupSequence(TabbedGroups tabbedGroups, TabGroupBase parent, River.Orqa.Controls.Common.Direction direction) : base(tabbedGroups, parent) { InternalConstruct(null, direction); }
public override void LoadFromXml(XmlTextReader xmlIn) { // Grab the expected attributes string rawCount = xmlIn.GetAttribute(0); string rawUnique = xmlIn.GetAttribute(1); string rawSpace = xmlIn.GetAttribute(2); string rawDirection = xmlIn.GetAttribute(3); // Convert to correct types int count = Convert.ToInt32(rawCount); int unique = Convert.ToInt32(rawUnique); Decimal space = Convert.ToDecimal(rawSpace); Common.Direction direction = (rawDirection == "Horizontal" ? Common.Direction.Horizontal : Common.Direction.Vertical); // Update myself with new values _unique = unique; _space = space; _direction = direction; // Load each of the children for (int i = 0; i < count; i++) { // Read the next Element if (!xmlIn.Read()) { throw new ArgumentException("An element was expected but could not be read in"); } TabGroupBase newElement = null; // Is it another sequence? if (xmlIn.Name == "Sequence") { newElement = new TabGroupSequence(_tabbedGroups, this); } else if (xmlIn.Name == "Leaf") { newElement = new TabGroupLeaf(_tabbedGroups, this); } else { throw new ArgumentException("Unknown element was encountered"); } bool expectEndElement = !xmlIn.IsEmptyElement; // Load its config newElement.LoadFromXml(xmlIn); // Add new element to the collection Add(newElement); // Do we expect and end element to occur? if (expectEndElement) { // Move past the end element if (!xmlIn.Read()) { throw new ArgumentException("Could not read in next expected node"); } // Check it has the expected name if (xmlIn.NodeType != XmlNodeType.EndElement) { throw new ArgumentException("EndElement expected but not found"); } } } }
public ResizeAutoBar(River.Orqa.Controls.Common.Direction direction, IResizeSource resizeSource) : base(direction, resizeSource) { }