예제 #1
0
 public ContentButton(string title, Content content)
     : base(title)
 {
     this.content = content;
     this.Relief = ReliefStyle.None;
     this.FocusOnClick = false;
     this.CanFocus = false;
 }
예제 #2
0
        /// <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;
        }
예제 #3
0
        //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 ();
        }
예제 #4
0
 //a content button was pressed
 private void button_toggled(Content content)
 {
     if (ContentChanged != null)
         ContentChanged (content);
 }
예제 #5
0
 /// <summary>
 /// Load the specified content info.
 /// </summary>
 public void LoadTab(Content content, QueryInfo query)
 {
     tabs.Page = tabs.PageNum (content.DisplayWidget);
     LoadContent (active_content, query);
 }
예제 #6
0
        /// <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 ();
            }
        }
예제 #7
0
 /// <summary>
 /// Add content with a tab.
 /// </summary>
 public void AddContent(Content content, string title)
 {
     AddContent (content);
     button_box.AddContent (title, content);
 }
예제 #8
0
 /// <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;
 }