public SectionView(Board board, SpiderView spiderView) { InitializeComponent(); this.Board = board; this.Controls.Add(board); board.AutoResize(); this.Scroll += SectionView_Scroll; board.AutoResize(); this.AutoScroll = true; this.SpiderView = spiderView; if (overflow == null) { overflow = new Overflow(ListView); overflow.Top = -1424; this.Controls.Add(overflow); } }
public winbutton(Board host, XmlElement node) : base(host, node) { base.Control = new Button(); base.Control.Tag = this; host.Controls.Add(Control); base.Control.Text = node.InnerText; base.Control.MouseClick += Control_MouseClick; host.InputFields.Add(node.GetAttribute("name"), this); }
public track(Board host, XmlElement node) : base(host, node) { this.Visible = false; this.node = node; IMusicService ms = host.SpiderView.Host.MusicService; this.Visible = false; this.Track = new Track(ms, node.GetAttribute("uri").Split(':')[2]); this.Track.TrackLoaded += Track_TrackLoaded; this.Track.Element = this; this.Track.LoadAsync(this); this.Track.Name = node.GetAttribute("name"); this.Block = (Block)this.Board.Stylesheet.Blocks["track"].Clone(); this.Block.Font = new Font("MS Sans Serif", 11, FontStyle.Regular, GraphicsUnit.Pixel); this.SelectedBlock = (Block)this.Board.Stylesheet.Blocks["track::selected"].Clone(); }
public columnheader(Board host, XmlElement node) : base(host, node) { this.Block = (Block)this.Stylesheet.Blocks["columnheader"].Clone(); this.ColumnHeaders = new Dictionary<string, ColumnHeader>(); this.ColumnHeaders.Add("no", new ColumnHeader() { Name="", Left = 2, Width = 30 }); this.ColumnHeaders.Add("name", new ColumnHeader() { Name="Title", Left = 18, Width = 140 }); this.ColumnHeaders.Add("artist", new ColumnHeader() { Name="Artist", Left = 484, Width = 100 }); this.ColumnHeaders.Add("duration", new ColumnHeader() { Name = "Duration", Left = 182, Width = 50 }); this.ColumnHeaders.Add("popularity", new ColumnHeader() { Name = "Popularity", Left = 417, Width = 35 }); this.ColumnHeaders.Add("album", new ColumnHeader() { Name = "Album", Left = 625, Width = 310 }); }
public text(Board host, XmlElement node) : base(host, node) { if (this.Parent != null && this.Parent.Block != null) this.Block = (Block)this.Parent.Block.Clone(); else this.Block = (Block)this.Board.Stylesheet.Blocks["Body"].Clone(); if (node.HasAttribute("fontSize")) { this.Block.Font = new Font(this.Block.Font.FontFamily.Name, int.Parse(node.GetAttribute("fontSize"))); } if (node.HasAttribute("bold")) { this.Block.Font = new Font(this.Block.Font, this.Block.Font.Style | FontStyle.Bold); } if (node.HasAttribute("italic")) { this.Block.Font = new Font(this.Block.Font, this.Block.Font.Style | FontStyle.Italic); } if (node.HasAttribute("class")) { this.Block = (Block)this.Board.Stylesheet.Blocks["." + node.GetAttribute("class").Split(' ')[0]].Clone(); } Text = node.InnerXml; }
public table(Board host, XmlElement node) : base(host, node) { }
public void AddSection(XmlElement _section) { Tab tab = new Tab(); tab.Title = _section.GetAttribute("title"); tab.ID = _section.GetAttribute("id"); this.tabBar.Tabs.Add(tab); Board childBoard = new Board(this); SectionView sv = new SectionView(childBoard, this); childBoard.Section = sv; Sections.Add(tab.ID, sv); childBoard.LoadNodes(_section); childBoard.ScriptCalled += childBoard_ScriptCalled; childBoard.AutoResize(); childBoard.Width = 31280; //if(_section.HasAttribute("padding")) // childBoard.Padding = new Spider.Padding(_section.GetAttribute("padding")); this.deck.Controls.Add(sv); sv.Dock = DockStyle.Fill; if (_section.HasAttribute("playlist")) { sv.Board.CustomHeight = true; this.IsPlaylist = _section.GetAttribute("playlist") == "true"; } if (this.IsPlaylist) { sv.Board.MinimumSize = new Size(0, 0); if (_section.HasAttribute("height")) { if (int.Parse(_section.GetAttribute("height")) < 1) { sv.Board.Hide(); sv.Board.Height = 0; } sv.Board.Height = int.Parse(_section.GetAttribute("height")); } else { sv.Board.Height = 120; } sv.Board.Left = 0; sv.Board.Top = 0; sv.Board.Width = this.Width; sv.Board.Anchor |= AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; sv.ListView = new CListView(sv); sv.Controls.Add(sv.ListView); sv.ListView.Top = sv.Board.Height; sv.ListView.Anchor |= AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; sv.ListView.Height = 1200; sv.ListView.Width = this.Width; sv.ListView.Columns.Add("No.", 52); sv.ListView.AllowsReoreder = false; sv.ListView.Columns.Add("Title", 300); sv.ListView.Columns.Add("Artist", 100); sv.ListView.Columns.Add("Duration", 100); sv.ListView.Columns.Add("Album", 300); sv.ListView.Columns.Add("User", 100); sv.ListView.Columns.Add("Time", 100); sv.ListView.BringToFront(); } }
public divider(Board parent, XmlElement node) : base(parent, node) { this.Block = parent.Stylesheet.Blocks["Divider"]; imgDivider = this.Block.BackgroundImage; }
public img(Board host, XmlElement elm) : base(host, elm) { Src = elm.GetAttribute("src"); if (elm.HasAttribute("shadow")) hasShadow = elm.GetAttribute("shadow") == "true" ; }
public html(Board board, XmlElement node) : base(board, node) { }
public hr(Board board, XmlElement node) : base(board, node) { this.Block = (Block)this.Stylesheet.Blocks["hr"].Clone(); this.Height = 50; }
public hbox(Board host, XmlElement node) : base(host, node) { }
public flow(Board parent, XmlElement node) : base(parent, node) { }
public button(Board host, XmlElement node) : base(host, node) { this.Width = 105; this.Height = 20; this.Block = (Block)host.Stylesheet.Blocks["button"].Clone(); this.PressedBlock = (Block)host.Stylesheet.Blocks["button:active"].Clone(); if (node.HasAttribute("text")) { this.Text = node.GetAttribute("text"); } }
public control(Board host, XmlElement node) : base(host, node) { }
public box(Board parent, XmlElement node) : base(parent, node) { }
public input(Board host, XmlElement node) : base(host, node) { if (node.GetAttribute("type") == "text") { base.Control = new TextBox(); base.Control.Tag = this; host.Controls.Add(Control); var id = node.GetAttribute("name"); if (host.InputFields.ContainsKey(id)) { host.InputFields.Remove(id); } host.InputFields.Add(id, this); } }
public Element(Board Host, XmlElement node) { if (node.HasAttribute("uri")) { this.Uri = node.GetAttribute("uri"); } this.Board = Host; this.node = node; if (this.Parent != null && this.Parent.Block != null) this.Block = (Block)this.Parent.Block.Clone(); else this.Block = (Block)this.Board.Stylesheet.Blocks["Body"].Clone(); this.BackColor = ParseColorAttribute("BackColor", ("bgcolor"), node); this.ForeColor = ParseColorAttribute("ForeColor", "color", node); foreach(XmlAttribute attribute in node.Attributes) { if(attribute.Name.StartsWith("on")) { this.ElementEventHandlers.Add(attribute.Name.Substring(2), node.GetAttribute(attribute.Name)); } } if (node.HasAttribute("class")) { this.Block = (Block)this.Board.Stylesheet.Blocks["." + node.GetAttribute("class").Split(' ')[0]].Clone(); } if (node.HasAttribute("fgcolor")) { this.ForeColor = ColorTranslator.FromHtml(node.GetAttribute("fgcolor")); } if (node.HasAttribute("bgcolor")) { this.BackColor = ColorTranslator.FromHtml(node.GetAttribute("bgcolor")); } if (node.HasAttribute("onclick")) { } if (node.HasAttribute("minHeight")) { this.MinHeight = int.Parse(node.GetAttribute("minHeight")); } if (node.HasAttribute("minWidth")) { this.MinWidth = int.Parse(node.GetAttribute("minWidth")); } if (node.HasAttribute("margin")) { Block.Margin = new Margin(node.GetAttribute("margin")); } if (node.HasAttribute("flex")) { this.Flex = int.Parse(node.GetAttribute("flex")); } if (node.HasAttribute("padding")) { Block.Padding = new Skinning.Padding(node.GetAttribute("padding")); } if (node.HasAttribute("uri")) { this.Hyperlink = node.GetAttribute("uri"); } if (node.HasAttribute("name")) { this.Name = node.GetAttribute("name"); } if (node.HasAttribute("alt")) { this.Alt = node.GetAttribute("alt"); } if (node.HasAttribute("width")) { if (node.GetAttribute("width") == "100%") { Dock |= DockStyle.Right; Width = -1; //Width = Parent.Width - Margin * 2 + Parent.Padding * 2; } else { this.AbsoluteWidth = int.Parse(node.GetAttribute("width")); this.Width = this.AbsoluteWidth; } } else { this.AbsoluteWidth = Parent != null ? Parent.Width : Board.Width; this.Width = this.AbsoluteWidth; } if (node.HasAttribute("height")) { if (node.GetAttribute("height") == "100%") { if(this.Parent != null) this.AbsoluteHeight = this.Parent.Height; return; } this.AbsoluteHeight = int.Parse(node.GetAttribute("height")); this.Height = this.AbsoluteHeight; } else { this.AbsoluteHeight = 32; this.Height = this.AbsoluteHeight; } if (node.HasAttribute("class")) { this.ApplyStyle((Block)this.Stylesheet.Blocks["." + node.GetAttribute("class")].Clone()); } if (node.HasAttribute("style")) { this.Block = new Block(node.GetAttribute("style"), Block); } this.Text = node.InnerText; if(this.node.Name != "text") foreach (XmlNode elm in node.ChildNodes) { if (elm.GetType() == typeof(XmlElement)) { try { Element _elm = (Element)Type.GetType("Spider." + elm.Name).GetConstructor(new Type[] { typeof(Board), typeof(XmlElement) }).Invoke( new Object[] {this.Board, elm}); this.Children.Add(_elm); _elm.Parent=this; } catch (Exception e) { } } } if (this.Children.Count > 0) { PackChildren(); } }
public link(Board host, XmlElement node) : base(host, node) { }
void childBoard_ScriptCalled(object sender, Board.ScriptInvokeEventArgs e) { object c = Scripting.InvokeFunction(e.Command, e); this.Refresh(null); }
public playlist(Board host, XmlElement node) : base(host, node) { if(node.HasAttribute("allowsReorder")) { this.AllowsReoreder = node.GetAttribute("allowsReorder") == "true"; } }