public ContentButton(string title, Content content) : base(title) { this.content = content; this.Relief = ReliefStyle.None; this.FocusOnClick = false; this.CanFocus = false; }
/// <summary> /// The panel content. /// </summary> public void AddContent(string title, Content content) { ContentButton button = new ContentButton (title, content); box.PackStart (button, false, false, 0); box.PackStart (new VSeparator (), false, false, 2); if (first_button) { button.Active = true; first_button = false; } button.Toggled += button_toggled; }
//switch pages private void change_content(object o, SwitchPageArgs args) { //look for the content currently showing active_content = null; Widget active_widget = tabs.GetNthPage ((int) args.PageNum); foreach (Content content in content_list) if (content.DisplayWidget == active_widget) active_content = content; if (active_content == null) return; content_resize (); }
//a content button was pressed private void button_toggled(Content content) { if (ContentChanged != null) ContentChanged (content); }
/// <summary> /// Load the specified content info. /// </summary> public void LoadTab(Content content, QueryInfo query) { tabs.Page = tabs.PageNum (content.DisplayWidget); LoadContent (active_content, query); }
/// <summary> /// Load the specified content info. /// </summary> public void LoadContent(Content content, QueryInfo query) { string url = content.GetQuery (query); if (url == null) return; content.ShowLoading (); XmlDocument doc = content.LoadXml (url); if (doc != null) { content.Load (doc, query); content.HideLoading (); } }
/// <summary> /// Add content with a tab. /// </summary> public void AddContent(Content content, string title) { AddContent (content); button_box.AddContent (title, content); }
/// <summary> /// Add content without a tab. /// </summary> public void AddContent(Content content) { content_list.Add (content); tabs.AppendPage (content.DisplayWidget, null); content.NewSize += content_resize; }