Exemplo n.º 1
0
        public NotebookPage (Page page)
        {
            this.page = page;

            BorderWidth = 5;
            Spacing = 10;

            tab_widget = new Label (page.Name);
            tab_widget.Show ();

            Widget page_widget = page.DisplayWidget as Widget;
            if (page_widget != null) {
                page_widget.Show ();
                PackStart (page_widget, true, true, 0);
            } else {
                foreach (Section section in page) {
                    AddSection (section);
                }

                if (page.ChildPages.Count > 0) {
                    Notebook notebook = new Notebook ();
                    notebook.ShowBorder = false;
                    notebook.ShowTabs = false;
                    notebook.Show ();

                    var hbox = new HBox () { Spacing = 6 };
                    // FIXME this shouldn't be hard-coded to 'Source:', but this is the only
                    // user of this code atm...
                    var page_label = new Label (Mono.Unix.Catalog.GetString ("Source:"));
                    var page_combo = new PageComboBox (page.ChildPages, notebook);
                    hbox.PackStart (page_label, false, false, 0);
                    hbox.PackStart (page_combo, true, true, 0);
                    hbox.ShowAll ();

                    PackStart (hbox, false, false, 0);

                    HSeparator sep = new HSeparator ();
                    sep.Show ();
                    PackStart (sep, false, false, 0);

                    foreach (Page child_page in page.ChildPages) {
                        NotebookPage page_ui = new NotebookPage (child_page);
                        page_ui.BorderWidth = 0;
                        page_ui.Show ();
                        notebook.AppendPage (page_ui, null);
                    }

                    PackStart (notebook, true, true, 0);
                }
            }
        }
Exemplo n.º 2
0
        public NotebookPage(Page page)
        {
            this.page = page;

            BorderWidth = 5;
            Spacing     = 10;

            tab_widget = new Label(page.Name);
            tab_widget.Show();

            Widget page_widget = page.DisplayWidget as Widget;

            if (page_widget != null)
            {
                page_widget.Show();
                PackStart(page_widget, true, true, 0);
            }
            else
            {
                foreach (Section section in page)
                {
                    AddSection(section);
                }

                if (page.ChildPages.Count > 0)
                {
                    Notebook notebook = new Notebook();
                    notebook.ShowBorder = false;
                    notebook.ShowTabs   = false;
                    notebook.Show();

                    PageComboBox page_combo = new PageComboBox(page.ChildPages, notebook);
                    PackStart(page_combo, false, false, 0);

                    HSeparator sep = new HSeparator();
                    sep.Show();
                    PackStart(sep, false, false, 0);

                    foreach (Page child_page in page.ChildPages)
                    {
                        NotebookPage page_ui = new NotebookPage(child_page);
                        page_ui.BorderWidth = 0;
                        page_ui.Show();
                        notebook.AppendPage(page_ui, null);
                    }

                    PackStart(notebook, true, true, 0);
                }
            }
        }
Exemplo n.º 3
0
        public NotebookPage(Page page)
        {
            this.page = page;

            BorderWidth = 5;
            Spacing     = 10;

            tab_widget = new Label(page.Name);
            tab_widget.Show();

            Widget page_widget = page.DisplayWidget as Widget;

            if (page_widget != null)
            {
                page_widget.Show();
                PackStart(page_widget, true, true, 0);
            }
            else
            {
                foreach (Section section in page)
                {
                    AddSection(section);
                }

                if (page.ChildPages.Count > 0)
                {
                    Notebook notebook = new Notebook();
                    notebook.ShowBorder = false;
                    notebook.ShowTabs   = false;
                    notebook.Show();

                    var hbox = new HBox()
                    {
                        Spacing = 6
                    };
                    // FIXME this shouldn't be hard-coded to 'Source:', but this is the only
                    // user of this code atm...
                    var page_label = new Label(Mono.Unix.Catalog.GetString("Source:"));
                    var page_combo = new PageComboBox(page.ChildPages, notebook);
                    hbox.PackStart(page_label, false, false, 0);
                    hbox.PackStart(page_combo, true, true, 0);
                    hbox.ShowAll();

                    PackStart(hbox, false, false, 0);

                    HSeparator sep = new HSeparator();
                    sep.Show();
                    PackStart(sep, false, false, 0);

                    foreach (Page child_page in page.ChildPages)
                    {
                        NotebookPage page_ui = new NotebookPage(child_page);
                        page_ui.BorderWidth = 0;
                        page_ui.Show();
                        notebook.AppendPage(page_ui, null);
                    }

                    PackStart(notebook, true, true, 0);
                }
            }
        }