예제 #1
0
        void ShowTypeTree(string typeName, bool inverse)
        {
            foreach (object child in notebook.Children)
            {
                ReferenceTreeViewer tree = child as ReferenceTreeViewer;
                if (tree != null && tree.RootTypeName == typeName)
                {
                    tree.InverseReferences = inverse;
                    notebook.Page          = notebook.PageNum(tree);
                    return;
                }
            }

            ReferenceTreeViewer viewer = new ReferenceTreeViewer();

            viewer.FillType(GetCurrentObjectMap(), typeName);
            viewer.Show();
            viewer.TypeActivated += delegate {
                ShowTypeTree(viewer.SelectedType, viewer.InverseReferences);
            };
            HBox label = new HBox();

            label.Spacing = 3;
            label.PackStart(new Gtk.Image("class", Gtk.IconSize.Menu), false, false, 0);
            label.PackStart(new Gtk.Label(typeName), true, true, 0);
            Button but = new Button(new Gtk.Image(Gtk.Stock.Close, Gtk.IconSize.Menu));

            but.Relief = ReliefStyle.None;
            but.SetSizeRequest(18, 18);
            label.PackStart(but, false, false, 0);
            but.Clicked += delegate {
                notebook.Remove(viewer);
                viewer.Destroy();
            };
            label.ShowAll();
            int i = notebook.AppendPage(viewer, label);

            notebook.Page = i;
        }
예제 #2
0
        void ShowTypeTree(string typeName, bool inverse)
        {
            foreach (object child in notebook.Children) {
                ReferenceTreeViewer tree = child as ReferenceTreeViewer;
                if (tree != null && tree.RootTypeName == typeName) {
                    tree.InverseReferences = inverse;
                    notebook.Page = notebook.PageNum (tree);
                    return;
                }
            }

            ReferenceTreeViewer viewer = new ReferenceTreeViewer ();
            viewer.FillType (GetCurrentObjectMap (), typeName);
            viewer.Show ();
            viewer.TypeActivated += delegate {
                ShowTypeTree (viewer.SelectedType, viewer.InverseReferences);
            };
            HBox label = new HBox ();
            label.Spacing = 3;
            label.PackStart (new Gtk.Image ("class", Gtk.IconSize.Menu), false, false, 0);
            label.PackStart (new Gtk.Label (typeName), true, true, 0);
            Button but = new Button (new Gtk.Image (Gtk.Stock.Close, Gtk.IconSize.Menu));
            but.Relief = ReliefStyle.None;
            but.SetSizeRequest (18, 18);
            label.PackStart (but, false, false, 0);
            but.Clicked += delegate {
                notebook.Remove (viewer);
                viewer.Destroy ();
            };
            label.ShowAll ();
            int i = notebook.AppendPage (viewer, label);
            notebook.Page = i;
        }