Ejemplo n.º 1
0
        void OnDoubleClick()
        {
            TreeModel model;
            TreeIter  iter;

            if (!tree.Selection.GetSelected(out model, out iter))
            {
                return;
            }

            GLib.Value value = new GLib.Value();
            model.GetValue(iter, 4, ref value);
            object item = value.Val;

            if (item is MethodItem)
            {
                MethodItem   method     = (MethodItem)item;
                SourceWindow sourceView = ShowSourceFor(method.ParentClass);
                sourceView.CenterOnMethod(method);
            }
            else
            {
                TreePath treePath = model.GetPath(iter);

                if (tree.GetRowExpanded(treePath))
                {
                    tree.CollapseRow(treePath);
                }
                else
                {
                    tree.ExpandRow(treePath, false);
                }
            }
        }
Ejemplo n.º 2
0
        void OnDoubleClick()
        {
            TreeModel model;
            TreeIter  iter;

            if (!tree.Selection.GetSelected(out model, out iter))
            {
                return;
            }

            GLib.Value value = new GLib.Value();
            model.GetValue(iter, 4, ref value);
            object item = value.Val;

            if (item is MethodItem)
            {
                MethodItem   method     = (MethodItem)item;
                SourceWindow sourceView = ShowSourceFor(method.ParentClass);
                sourceView.CenterOnMethod(method);
            }
            else
            {
                if (tree.ExpandRow(model.GetPath(iter), true))
                {
                    // LAME: This seems to collapse the entire tree...
                    tree.CollapseRow(model.GetPath(iter));
                }
                else
                {
                    tree.ExpandRow(model.GetPath(iter), false);
                }
            }
        }
Ejemplo n.º 3
0
        SourceWindow ShowSourceFor(ClassItem item)
        {
            SourceWindow SourceView = (SourceWindow)source_views [item.Model.sourceFile];

            if (SourceView != null)
            {
                SourceView.Show();
            }
            else
            {
                SourceView = new SourceWindow(item);
                source_views [item.Model.sourceFile] = SourceView;
                window_maps [SourceView]             = item.Model.sourceFile;
                SourceView.Show();
                SourceView.DeleteEvent += new DeleteEventHandler(OnDeleteEvent);
            }
            return(SourceView);
        }
Ejemplo n.º 4
0
        private void OnShowSource(object sender, CoverageView.ShowSourceEventArgs e)
        {
            foreach (Widget widget in notebook1.Children) {
                SourceWindow notebookSourceWindow = widget as SourceWindow;
                if (notebookSourceWindow == null)
                    continue;

                if (notebookSourceWindow.classItem.Model.sourceFile.sourceFile != e.methodItem.ParentClass.Model.sourceFile.sourceFile)
                    continue;

                notebook1.CurrentPage = notebook1.PageNum (notebookSourceWindow);
                notebookSourceWindow.CenterOnMethod (e.methodItem);
                return;
            }

            SourceWindow sourceWindow = new SourceWindow (e.methodItem.ParentClass);
            sourceWindow.CenterOnMethod (e.methodItem);

            string sourceFile = e.methodItem.ParentClass.Model.sourceFile.sourceFile;
            sourceFile = Path.GetFileName (sourceFile);

            NotebookTabLabel notebookTabLabel = new NotebookTabLabel (sourceFile);
            int index = notebook1.AppendPage (sourceWindow, notebookTabLabel);
            notebook1.CurrentPage = index;
            notebookTabLabel.CloseClicked += delegate(object obj, EventArgs eventArgs) {
                notebook1.CurrentPage = notebook1.PageNum (sourceWindow);
                OnCloseTab (this, EventArgs.Empty);
            };
        }
Ejemplo n.º 5
0
	SourceWindow ShowSourceFor (ClassItem item)
	{
		SourceWindow SourceView = (SourceWindow)source_views [item.Model.sourceFile];
		if (SourceView != null) {
			SourceView.Show ();
		} else {
			SourceView = new SourceWindow (item);
			source_views [item.Model.sourceFile] = SourceView;
			window_maps [SourceView] = item.Model.sourceFile;
			SourceView.Show ();
			SourceView.DeleteEvent += new DeleteEventHandler (OnDeleteEvent);
		}
		return SourceView;

	}