本文整理汇总了C#中MonoDevelop.Ide.Gui.Components.PadTreeView类的典型用法代码示例。如果您正苦于以下问题:C# MonoDevelop.Ide.Gui.Components.PadTreeView类的具体用法?C# MonoDevelop.Ide.Gui.Components.PadTreeView怎么用?C# MonoDevelop.Ide.Gui.Components.PadTreeView使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MonoDevelop.Ide.Gui.Components.PadTreeView类属于命名空间,在下文中一共展示了MonoDevelop.Ide.Gui.Components.PadTreeView类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: HelpTree
public HelpTree () : base (GettextCatalog.GetString ("Help"), Gtk.Stock.Help)
{
tree_view = new MonoDevelop.Ide.Gui.Components.PadTreeView ();
tree_view.AppendColumn ("name_col", tree_view.TextRenderer, "text", 0);
tree_view.RowExpanded += new Gtk.RowExpandedHandler (RowExpanded);
tree_view.Selection.Changed += new EventHandler (RowActivated);
store = new TreeStore (typeof (string), typeof (Node));
tree_view.Model = store;
tree_view.HeadersVisible = false;
scroller = new MonoDevelop.Components.CompactScrolledWindow ();
scroller.ShadowType = Gtk.ShadowType.None;
scroller.Add (tree_view);
if (HelpService.HelpTree != null) {
root_iter = store.AppendValues (GettextCatalog.GetString ("Mono Documentation"), HelpService.HelpTree);
PopulateNode (root_iter);
tree_view.ExpandRow (new TreePath ("0"), false);
TreeIter child_iter;
start:
if (store.IterChildren (out child_iter, root_iter)) {
do {
if (!store.IterHasChild (child_iter)) {
store.Remove (ref child_iter);
goto start;
}
} while (store.IterNext (ref child_iter));
}
}
Control.ShowAll ();
}
开发者ID:RainsSoft,项目名称:playscript-monodevelop,代码行数:34,代码来源:MonodocTreePad.cs
示例2: GetOutlineWidget
public Gtk.Widget GetOutlineWidget()
{
if (TreeView != null)
return TreeView;
TreeStore = new TreeStore(typeof(object));
/*
settings = ClassOutlineSettings.Load();
comparer = new ClassOutlineNodeComparer(GetAmbience(), settings, outlineTreeModelSort);
outlineTreeModelSort.SetSortFunc(0, comparer.CompareNodes);
outlineTreeModelSort.SetSortColumnId(0, SortType.Ascending);
*/
TreeView = new MonoDevelop.Ide.Gui.Components.PadTreeView(TreeStore);
var pixRenderer = new CellRendererPixbuf();
pixRenderer.Xpad = 0;
pixRenderer.Ypad = 0;
TreeView.TextRenderer.Xpad = 0;
TreeView.TextRenderer.Ypad = 0;
TreeViewColumn treeCol = new TreeViewColumn();
treeCol.PackStart(pixRenderer, false);
treeCol.SetCellDataFunc(pixRenderer, new TreeCellDataFunc(OutlineTreeIconFunc));
treeCol.PackStart(TreeView.TextRenderer, true);
treeCol.SetCellDataFunc(TreeView.TextRenderer, new TreeCellDataFunc(OutlineTreeTextFunc));
TreeView.AppendColumn(treeCol);
TreeView.TextRenderer.Editable = true;
TreeView.TextRenderer.Edited += new EditedHandler(nameCell_Edited);
TreeView.HeadersVisible = false;
TreeView.Selection.Changed += delegate
{
if (dontJumpToDeclaration || !outlineReady)
return;
clickedOnOutlineItem = true;
JumpToDeclaration(true);
clickedOnOutlineItem = false;
};
TreeView.Realized += delegate { RefillOutlineStore(); };
//UpdateSorting();
var sw = new CompactScrolledWindow();
sw.Add(TreeView);
sw.ShowAll();
return sw;
}
开发者ID:gavin-norman,项目名称:Mono-D,代码行数:55,代码来源:DModuleOutlineExtension.cs
示例3: TreeStore
Widget MonoDevelop.DesignerSupport.IOutlinedDocument.GetOutlineWidget ()
{
if (outlineTreeView != null)
return outlineTreeView;
outlineTreeStore = new TreeStore (typeof(object));
outlineTreeView = new MonoDevelop.Ide.Gui.Components.PadTreeView (outlineTreeStore);
var pixRenderer = new CellRendererPixbuf ();
pixRenderer.Xpad = 0;
pixRenderer.Ypad = 0;
outlineTreeView.TextRenderer.Xpad = 0;
outlineTreeView.TextRenderer.Ypad = 0;
TreeViewColumn treeCol = new TreeViewColumn ();
treeCol.PackStart (pixRenderer, false);
treeCol.SetCellDataFunc (pixRenderer, new TreeCellDataFunc (OutlineTreeIconFunc));
treeCol.PackStart (outlineTreeView.TextRenderer, true);
treeCol.SetCellDataFunc (outlineTreeView.TextRenderer, new TreeCellDataFunc (OutlineTreeTextFunc));
outlineTreeView.AppendColumn (treeCol);
outlineTreeView.HeadersVisible = false;
outlineTreeView.Selection.Changed += delegate {
TreeIter iter;
if (!outlineTreeView.Selection.GetSelected (out iter))
return;
object o = outlineTreeStore.GetValue (iter, 0);
int line = -1, col = -1;
if (o is IType) {
line = ((IType)o).BodyRegion.Start.Line;
col = ((IType)o).BodyRegion.Start.Column;
} else if (o is IMember) {
line = ((IMember)o).BodyRegion.Start.Line;
col = ((IMember)o).BodyRegion.Start.Column;
}
if (line > -1) {
Editor.JumpTo (line, Math.Max (1, col));
}
};
this.lastCU = Document.ParsedDocument;
outlineTreeView.Realized += delegate { RefillOutlineStore (); };
var sw = new CompactScrolledWindow ();
sw.Add (outlineTreeView);
sw.ShowAll ();
return sw;
}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:53,代码来源:ClassOutlineTextEditorExtension.cs
示例4: TreeStore
Widget IOutlinedDocument.GetOutlineWidget()
{
if (outlineTreeView != null)
return outlineTreeView;
outlineTreeStore = new TreeStore (typeof(object));
outlineTreeView = new MonoDevelop.Ide.Gui.Components.PadTreeView (outlineTreeStore);
var pixRenderer = new CellRendererImage ();
pixRenderer.Xpad = 0;
pixRenderer.Ypad = 0;
outlineTreeView.TextRenderer.Xpad = 0;
outlineTreeView.TextRenderer.Ypad = 0;
TreeViewColumn treeCol = new TreeViewColumn ();
treeCol.PackStart (pixRenderer, false);
treeCol.SetCellDataFunc (pixRenderer, new TreeCellDataFunc (OutlineTreeIconFunc));
treeCol.PackStart (outlineTreeView.TextRenderer, true);
treeCol.SetCellDataFunc (outlineTreeView.TextRenderer, new TreeCellDataFunc (OutlineTreeTextFunc));
outlineTreeView.AppendColumn (treeCol);
outlineTreeView.HeadersVisible = false;
outlineTreeView.Selection.Changed += delegate {
JumpToDeclaration (false);
};
outlineTreeView.RowActivated += delegate {
JumpToDeclaration (true);
};
this.lastCU = Document.ParsedDocument;
outlineTreeView.Realized += delegate { RefillOutlineStore (); };
UpdateSorting ();
var sw = new CompactScrolledWindow ();
sw.Add (outlineTreeView);
sw.ShowAll ();
return sw;
}
开发者ID:ItsVeryWindy,项目名称:Mono-Cucumber,代码行数:45,代码来源:FeatureOutlineTextEditorExtension.cs
示例5: TreeStore
Widget MonoDevelop.DesignerSupport.IOutlinedDocument.GetOutlineWidget ()
{
if (outlineTreeView != null)
return outlineTreeView;
outlineTreeStore = new TreeStore (typeof(object));
outlineTreeView = new MonoDevelop.Ide.Gui.Components.PadTreeView (outlineTreeStore);
var pixRenderer = new CellRendererPixbuf ();
pixRenderer.Xpad = 0;
pixRenderer.Ypad = 0;
outlineTreeView.TextRenderer.Xpad = 0;
outlineTreeView.TextRenderer.Ypad = 0;
TreeViewColumn treeCol = new TreeViewColumn ();
treeCol.PackStart (pixRenderer, false);
treeCol.SetCellDataFunc (pixRenderer, new TreeCellDataFunc (OutlineTreeIconFunc));
treeCol.PackStart (outlineTreeView.TextRenderer, true);
treeCol.SetCellDataFunc (outlineTreeView.TextRenderer, new TreeCellDataFunc (OutlineTreeTextFunc));
outlineTreeView.AppendColumn (treeCol);
outlineTreeView.HeadersVisible = false;
outlineTreeView.Selection.Changed += delegate {
TreeIter iter;
if (!outlineTreeView.Selection.GetSelected (out iter))
return;
object o = outlineTreeStore.GetValue (iter, 0);
IdeApp.ProjectOperations.JumpToDeclaration (o as INode);
};
this.lastCU = Document.ParsedDocument;
outlineTreeView.Realized += delegate { RefillOutlineStore (); };
var sw = new CompactScrolledWindow ();
sw.Add (outlineTreeView);
sw.ShowAll ();
return sw;
}
开发者ID:Tak,项目名称:monodevelop-novell,代码行数:44,代码来源:ClassOutlineTextEditorExtension.cs
示例6: CreateView
void CreateView ()
{
if (view != null)
return;
ReloadPriorities ();
ProjectDomService.CommentTasksChanged += OnCommentTasksChanged;
ProjectDomService.SpecialCommentTagsChanged += OnCommentTagsChanged;
IdeApp.Workspace.WorkspaceItemLoaded += OnWorkspaceItemLoaded;
IdeApp.Workspace.WorkspaceItemUnloaded += OnWorkspaceItemUnloaded;
highPrioColor = StringToColor ((string)PropertyService.Get ("Monodevelop.UserTasksHighPrioColor", ""));
normalPrioColor = StringToColor ((string)PropertyService.Get ("Monodevelop.UserTasksNormalPrioColor", ""));
lowPrioColor = StringToColor ((string)PropertyService.Get ("Monodevelop.UserTasksLowPrioColor", ""));
store = new Gtk.ListStore (
typeof (int), // line
typeof (string), // desc
typeof (string), // file
typeof (string), // path
typeof (Task), // task
typeof (Gdk.Color), // foreground color
typeof (int)); // font weight
view = new MonoDevelop.Ide.Gui.Components.PadTreeView (store);
view.RulesHint = true;
view.SearchColumn = (int)Columns.Description;
view.PopupMenu += new PopupMenuHandler (OnPopupMenu);
view.ButtonPressEvent += new ButtonPressEventHandler (OnButtonPressed);
view.RowActivated += new RowActivatedHandler (OnRowActivated);
TreeViewColumn col;
col = view.AppendColumn (GettextCatalog.GetString ("Line"), view.TextRenderer, "text", Columns.Line, "foreground-gdk", Columns.Foreground, "weight", Columns.Bold);
col.Clickable = false;
col = view.AppendColumn (GettextCatalog.GetString ("Description"), view.TextRenderer, "text", Columns.Description, "foreground-gdk", Columns.Foreground, "weight", Columns.Bold);
col.Clickable = true;
col.SortColumnId = (int)Columns.Description;
col.Resizable = true;
col.Clicked += new EventHandler (Resort);
col = view.AppendColumn (GettextCatalog.GetString ("File"), view.TextRenderer, "text", Columns.File, "foreground-gdk", Columns.Foreground, "weight", Columns.Bold);
col.Clickable = true;
col.SortColumnId = (int)Columns.File;
col.Resizable = true;
col.Clicked += new EventHandler (Resort);
col = view.AppendColumn (GettextCatalog.GetString ("Path"), view.TextRenderer, "text", Columns.Path, "foreground-gdk", Columns.Foreground, "weight", Columns.Bold);
col.Clickable = true;
col.SortColumnId = (int)Columns.Path;
col.Resizable = true;
col.Clicked += new EventHandler (Resort);
LoadColumnsVisibility ();
comments.BeginTaskUpdates ();
try {
foreach (var item in IdeApp.Workspace.Items) {
LoadWorkspaceItemContents (item);
}
} finally {
comments.EndTaskUpdates ();
}
comments.TasksAdded += (TaskEventHandler) DispatchService.GuiDispatch (new TaskEventHandler (GeneratedTaskAdded));
comments.TasksRemoved += (TaskEventHandler) DispatchService.GuiDispatch (new TaskEventHandler (GeneratedTaskRemoved));
PropertyService.PropertyChanged += (EventHandler<PropertyChangedEventArgs>) DispatchService.GuiDispatch (new EventHandler<PropertyChangedEventArgs> (OnPropertyUpdated));
CreateMenu ();
// Initialize with existing tags.
foreach (Task t in comments)
AddGeneratedTask (t);
}
开发者ID:Tak,项目名称:monodevelop-novell,代码行数:76,代码来源:CommentTasksView.cs
示例7: TreeStore
Widget MonoDevelop.DesignerSupport.IOutlinedDocument.GetOutlineWidget ()
{
if (outlineTreeView != null)
return outlineTreeView;
outlineTreeStore = new TreeStore (typeof(object));
// Initialize sorted tree model
outlineTreeModelSort = new TreeModelSort (outlineTreeStore);
sortingProperties = PropertyService.Get (
ClassOutlineSortingProperties.SORTING_PROPERTY_NAME,
ClassOutlineSortingProperties.GetDefaultInstance ());
comparer = new ClassOutlineNodeComparer (GetAmbience (), sortingProperties, outlineTreeModelSort);
outlineTreeModelSort.SetSortFunc (0, comparer.CompareNodes);
outlineTreeModelSort.SetSortColumnId (0, SortType.Ascending);
outlineTreeView = new MonoDevelop.Ide.Gui.Components.PadTreeView (outlineTreeStore);
var pixRenderer = new CellRendererPixbuf ();
pixRenderer.Xpad = 0;
pixRenderer.Ypad = 0;
outlineTreeView.TextRenderer.Xpad = 0;
outlineTreeView.TextRenderer.Ypad = 0;
TreeViewColumn treeCol = new TreeViewColumn ();
treeCol.PackStart (pixRenderer, false);
treeCol.SetCellDataFunc (pixRenderer, new TreeCellDataFunc (OutlineTreeIconFunc));
treeCol.PackStart (outlineTreeView.TextRenderer, true);
treeCol.SetCellDataFunc (outlineTreeView.TextRenderer, new TreeCellDataFunc (OutlineTreeTextFunc));
outlineTreeView.AppendColumn (treeCol);
outlineTreeView.HeadersVisible = false;
outlineTreeView.Selection.Changed += delegate {
JumpToDeclaration (false);
};
outlineTreeView.RowActivated += delegate {
JumpToDeclaration (true);
};
this.lastCU = Document.ParsedDocument;
outlineTreeView.Realized += delegate { RefillOutlineStore (); };
// Register for property changes (e.g. preferences dialog)
sortingProperties.EventSortingPropertiesChanged += OnSortingPropertiesChanged;
UpdateSorting ();
var sw = new CompactScrolledWindow ();
sw.Add (outlineTreeView);
sw.ShowAll ();
return sw;
}
开发者ID:Poiros,项目名称:monodevelop,代码行数:63,代码来源:ClassOutlineTextEditorExtension.cs
示例8: Initialize
public void Initialize (IPadWindow window)
{
this.window = window;
window.PadShown += delegate {
if (needsReload)
Refresh ();
};
DockItemToolbar toolbar = window.GetToolbar (PositionType.Top);
errorBtn = new ToggleButton ();
errorBtn.Active = (bool)PropertyService.Get (showErrorsPropertyName, true);
string errorTipText;
if ((InternalLog.EnabledLoggingLevel & EnabledLoggingLevel.Error) != EnabledLoggingLevel.Error
&& (InternalLog.EnabledLoggingLevel & EnabledLoggingLevel.Fatal) != EnabledLoggingLevel.Fatal) {
errorBtn.Sensitive = false;
errorTipText = GettextCatalog.GetString ("Logging of errors is not enabled");
} else {
errorTipText = GettextCatalog.GetString ("Show errors");
}
errorBtn.Image = new Gtk.Image (Gtk.Stock.DialogError, Gtk.IconSize.Menu);
errorBtn.Image.Show ();
errorBtn.Toggled += new EventHandler (FilterChanged);
errorBtn.TooltipText = errorTipText;
UpdateErrorsNum();
toolbar.Add (errorBtn);
warnBtn = new ToggleButton ();
warnBtn.Active = (bool)PropertyService.Get (showWarningsPropertyName, true);
string warnTipText;
if ((InternalLog.EnabledLoggingLevel & EnabledLoggingLevel.Warn) != EnabledLoggingLevel.Warn) {
warnBtn.Sensitive = false;
warnTipText = GettextCatalog.GetString ("Logging of warnings is not enabled");
} else {
warnTipText = GettextCatalog.GetString ("Show warnings");
}
warnBtn.Image = new Gtk.Image (Gtk.Stock.DialogWarning, Gtk.IconSize.Menu);
warnBtn.Image.Show ();
warnBtn.Toggled += new EventHandler (FilterChanged);
warnBtn.TooltipText = warnTipText;
UpdateWarningsNum();
toolbar.Add (warnBtn);
msgBtn = new ToggleButton ();
msgBtn.Active = (bool)PropertyService.Get (showMessagesPropertyName, true);
string msgTipText;
if ((InternalLog.EnabledLoggingLevel & EnabledLoggingLevel.Info) != EnabledLoggingLevel.Info) {
msgBtn.Sensitive = false;
msgTipText = GettextCatalog.GetString ("Logging of informational messages is not enabled");
} else {
msgTipText = GettextCatalog.GetString ("Show messages");
}
msgBtn.Image = new Gtk.Image (Gtk.Stock.DialogInfo, Gtk.IconSize.Menu);
msgBtn.Image.Show ();
msgBtn.Toggled += new EventHandler (FilterChanged);
msgBtn.TooltipText = msgTipText;
UpdateMessagesNum();
toolbar.Add (msgBtn);
debugBtn = new ToggleButton ();
debugBtn.Active = (bool)PropertyService.Get (showDebugPropertyName, true);
string debugTipText;
if ((InternalLog.EnabledLoggingLevel & EnabledLoggingLevel.Debug) != EnabledLoggingLevel.Debug) {
debugBtn.Sensitive = false;
debugTipText = GettextCatalog.GetString ("Logging of debug messages is not enabled");
} else {
debugTipText = GettextCatalog.GetString ("Show debug");
}
debugBtn.Image = new Gtk.Image (Gtk.Stock.DialogQuestion, Gtk.IconSize.Menu);
debugBtn.Image.Show ();
debugBtn.Toggled += new EventHandler (FilterChanged);
debugBtn.TooltipText = debugTipText;
UpdateDebugNum();
toolbar.Add (debugBtn);
toolbar.Add (new SeparatorToolItem ());
Gtk.Button clearBtn = new Gtk.Button (new Gtk.Image (Gtk.Stock.Clear, Gtk.IconSize.Menu));
clearBtn.Clicked += new EventHandler (OnClearList);
toolbar.Add (clearBtn);
toolbar.ShowAll ();
// Content
store = new Gtk.ListStore (typeof (Gdk.Pixbuf), // image - type
typeof (string), // desc
typeof (string), // time
typeof (string), // type string
typeof (LogMessage)); // message
TreeModelFilterVisibleFunc filterFunct = new TreeModelFilterVisibleFunc (FilterTaskTypes);
filter = new TreeModelFilter (store, null);
filter.VisibleFunc = filterFunct;
view = new MonoDevelop.Ide.Gui.Components.PadTreeView (new Gtk.TreeModelSort (filter));
view.RulesHint = true;
view.PopupMenu += new PopupMenuHandler (OnPopupMenu);
view.ButtonPressEvent += new ButtonPressEventHandler (OnButtonPressed);
view.HeadersClickable = true;
view.Selection.Mode = SelectionMode.Multiple;
//.........这里部分代码省略.........
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:101,代码来源:InternalLogPad.cs
示例9: CreateView
void CreateView ()
{
if (view != null)
return;
ReloadPriorities ();
TaskService.CommentTasksChanged += OnCommentTasksChanged;
CommentTag.SpecialCommentTagsChanged += OnCommentTagsChanged;
MonoDevelopWorkspace.LoadingFinished += OnWorkspaceItemLoaded;
IdeApp.Workspace.WorkspaceItemUnloaded += OnWorkspaceItemUnloaded;
IdeApp.Workspace.LastWorkspaceItemClosed += LastWorkspaceItemClosed;
IdeApp.Workbench.DocumentOpened += WorkbenchDocumentOpened;
IdeApp.Workbench.DocumentClosed += WorkbenchDocumentClosed;
highPrioColor = StringToColor (IdeApp.Preferences.UserTasksHighPrioColor);
normalPrioColor = StringToColor (IdeApp.Preferences.UserTasksNormalPrioColor);
lowPrioColor = StringToColor (IdeApp.Preferences.UserTasksLowPrioColor);
store = new Gtk.ListStore (
typeof (int), // line
typeof (string), // desc
typeof (string), // file
typeof (string), // path
typeof (TaskListEntry), // task
typeof (Gdk.Color), // foreground color
typeof (int)); // font weight
sortModel = new TreeModelSort (store);
view = new MonoDevelop.Ide.Gui.Components.PadTreeView (sortModel);
view.RulesHint = true;
view.SearchColumn = (int)Columns.Description;
view.DoPopupMenu = (evt) => IdeApp.CommandService.ShowContextMenu (view, evt, CreateMenu ());
view.RowActivated += new RowActivatedHandler (OnRowActivated);
TreeViewColumn col;
col = view.AppendColumn (GettextCatalog.GetString ("Line"), view.TextRenderer, "text", Columns.Line, "foreground-gdk", Columns.Foreground, "weight", Columns.Bold);
col.Clickable = false;
col = view.AppendColumn (GettextCatalog.GetString ("Description"), view.TextRenderer, "text", Columns.Description, "foreground-gdk", Columns.Foreground, "weight", Columns.Bold);
col.SortColumnId = (int)Columns.Description;
col.Resizable = true;
col = view.AppendColumn (GettextCatalog.GetString ("File"), view.TextRenderer, "text", Columns.File, "foreground-gdk", Columns.Foreground, "weight", Columns.Bold);
col.SortColumnId = (int)Columns.File;
col.Resizable = true;
col = view.AppendColumn (GettextCatalog.GetString ("Path"), view.TextRenderer, "text", Columns.Path, "foreground-gdk", Columns.Foreground, "weight", Columns.Bold);
col.SortColumnId = (int)Columns.Path;
col.Resizable = true;
LoadColumnsVisibility ();
OnWorkspaceItemLoaded (null, EventArgs.Empty);
comments.TasksAdded += GeneratedTaskAdded;
comments.TasksRemoved += GeneratedTaskRemoved;
PropertyService.PropertyChanged += OnPropertyUpdated;
// Initialize with existing tags.
foreach (TaskListEntry t in comments)
AddGeneratedTask (t);
view.Destroyed += delegate {
view.RowActivated -= OnRowActivated;
TaskService.CommentTasksChanged -= OnCommentTasksChanged;
CommentTag.SpecialCommentTagsChanged -= OnCommentTagsChanged;
MonoDevelopWorkspace.LoadingFinished -= OnWorkspaceItemLoaded;
IdeApp.Workspace.WorkspaceItemUnloaded -= OnWorkspaceItemUnloaded;
comments.TasksAdded -= GeneratedTaskAdded;
comments.TasksRemoved -= GeneratedTaskRemoved;
PropertyService.PropertyChanged -= OnPropertyUpdated;
};
}
开发者ID:zenek-y,项目名称:monodevelop,代码行数:78,代码来源:CommentTasksView.cs
示例10: TreeStore
Widget IOutlinedDocument.GetOutlineWidget ()
{
if (outlineTreeView != null)
return outlineTreeView;
outlineTreeStore = new TreeStore (typeof (object));
outlineTreeView = new MonoDevelop.Ide.Gui.Components.PadTreeView (outlineTreeStore);
System.Reflection.PropertyInfo prop = typeof (TreeView).GetProperty ("EnableTreeLines");
if (prop != null)
prop.SetValue (outlineTreeView, true, null);
outlineTreeView.Realized += delegate { refillOutlineStore (); };
InitializeOutlineColumns (outlineTreeView);
outlineTreeView.HeadersVisible = false;
outlineTreeView.Selection.Changed += delegate {
TreeIter iter;
if (!outlineTreeView.Selection.GetSelected (out iter))
return;
OutlineSelectionChanged (outlineTreeStore.GetValue (iter, 0));
};
refillOutlineStore ();
var sw = new CompactScrolledWindow ();
sw.Add (outlineTreeView);
sw.ShowAll ();
return sw;
}
开发者ID:gAdrev,项目名称:monodevelop,代码行数:32,代码来源:BaseXmlEditorExtension.cs
示例11: typeof
Gtk.Widget IOutlinedDocument.GetOutlineWidget ()
{
if (outlineTreeView != null)
return outlineTreeView;
outlineTreeStore = new Gtk.TreeStore (typeof(string), typeof (Gdk.Color), typeof (Mono.TextTemplating.ISegment));
outlineTreeView = new MonoDevelop.Ide.Gui.Components.PadTreeView (outlineTreeStore);
outlineTreeView.Realized += delegate { RefillOutlineStore (); };
outlineTreeView.TextRenderer.Xpad = 0;
outlineTreeView.TextRenderer.Ypad = 0;
outlineTreeView.AppendColumn ("Node", outlineTreeView.TextRenderer, "text", 0, "foreground-gdk", 1);
outlineTreeView.HeadersVisible = false;
outlineTreeView.Selection.Changed += delegate {
Gtk.TreeIter iter;
if (!outlineTreeView.Selection.GetSelected (out iter))
return;
SelectSegment ((Mono.TextTemplating.ISegment )outlineTreeStore.GetValue (iter, 2));
};
RefillOutlineStore ();
var sw = new MonoDevelop.Components.CompactScrolledWindow ();;
sw.Add (outlineTreeView);
sw.ShowAll ();
return sw;
}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:28,代码来源:T4EditorExtension.cs
示例12: Exception
Widget IOutlinedDocument.GetOutlineWidget ()
{
if (outlineView != null)
return outlineView;
if (outlineStore == null)
throw new Exception ("The treestore should be built, before initializing the TreeView of the DocumentOutline");
outlineView = new MonoDevelop.Ide.Gui.Components.PadTreeView (outlineStore);
System.Reflection.PropertyInfo prop = typeof(Gtk.TreeView).GetProperty ("EnableTreeLines");
if (prop != null)
prop.SetValue (outlineView, true, null);
outlineView.TextRenderer.Xpad = 0;
outlineView.TextRenderer.Ypad = 0;
outlineView.ExpandAll ();
outlineView.AppendColumn ("Node", outlineView.TextRenderer, new Gtk.TreeCellDataFunc (OutlineTreeDataFunc));
outlineView.HeadersVisible = false;
outlineView.Selection.Changed += delegate {
Gtk.TreeIter iter = Gtk.TreeIter.Zero;
outlineView.Selection.GetSelected (out iter);
DocumentOutlineSelectionChanged (outlineStore.GetValue (iter, 0) as XNode);
};
var sw = new MonoDevelop.Components.CompactScrolledWindow ();
sw.Add (outlineView);
sw.ShowAll ();
return sw;
}
开发者ID:segaman,项目名称:monodevelop,代码行数:29,代码来源:AspNetEditViewContent.cs
示例13: UserTasksView
public UserTasksView ()
{
highPrioColor = StringToColor ((string)PropertyService.Get ("Monodevelop.UserTasksHighPrioColor", ""));
normalPrioColor = StringToColor ((string)PropertyService.Get ("Monodevelop.UserTasksNormalPrioColor", ""));
lowPrioColor = StringToColor ((string)PropertyService.Get ("Monodevelop.UserTasksLowPrioColor", ""));
store = new ListStore (
typeof (string), // priority
typeof (bool), // completed
typeof (string), // desc
typeof (Task), // user task
typeof (Gdk.Color), // foreground color
typeof (int)); // font style
view = new MonoDevelop.Ide.Gui.Components.PadTreeView (store);
view.RulesHint = true;
view.SearchColumn = (int)Columns.Description;
view.Selection.Changed += new EventHandler (SelectionChanged);
view.PopupMenu += new PopupMenuHandler (OnUserPopupMenu);
view.ButtonPressEvent += new ButtonPressEventHandler (OnUserButtonPressed);
TreeViewColumn col;
CellRendererComboBox cellRendPriority = new CellRendererComboBox ();
cellRendPriority.Values = priorities;
cellRendPriority.Editable = true;
cellRendPriority.Changed += new ComboSelectionChangedHandler (UserTaskPriorityEdited);
col = view.AppendColumn (GettextCatalog.GetString ("Priority"), cellRendPriority, "text", Columns.Priority, "foreground-gdk", Columns.Foreground, "weight", Columns.Bold);
col.Clickable = true;
col.Resizable = true;
TreeIterCompareFunc sortFunc = new TreeIterCompareFunc (PrioirtySortFunc);
store.SetSortFunc ((int)Columns.Priority, sortFunc);
col.Clicked += new EventHandler (UserTaskPriorityResort);
CellRendererToggle cellRendCompleted = new CellRendererToggle ();
cellRendCompleted.Toggled += new ToggledHandler (UserTaskCompletedToggled);
cellRendCompleted.Activatable = true;
col = view.AppendColumn (String.Empty, cellRendCompleted, "active", Columns.Completed);
col.Clickable = true;
col.Clicked += new EventHandler (UserTaskCompletedResort);
cellRendDesc = view.TextRenderer;
cellRendDesc.Editable = true;
cellRendDesc.Edited += new EditedHandler (UserTaskDescEdited);
col = view.AppendColumn (GettextCatalog.GetString ("Description"), cellRendDesc, "text", Columns.Description, "strikethrough", Columns.Completed, "foreground-gdk", Columns.Foreground, "weight", Columns.Bold);
col.Clickable = true;
col.Resizable = true;
col.Clicked += new EventHandler (UserTaskDescResort);
newButton = new Button ();
newButton.Image = new Gtk.Image (Gtk.Stock.New, IconSize.Button);
newButton.Label = GettextCatalog.GetString ("New Task");
newButton.ImagePosition = PositionType.Left;
newButton.Clicked += new EventHandler (NewUserTaskClicked);
newButton.TooltipText = GettextCatalog.GetString ("Create New Task");
delButton = new Button (new Gtk.Image (Gtk.Stock.Delete, IconSize.Button));
delButton.Clicked += new EventHandler (DeleteUserTaskClicked);
delButton.TooltipText = GettextCatalog.GetString ("Delete Task");
TaskService.UserTasks.TasksChanged += (TaskEventHandler) DispatchService.GuiDispatch (new TaskEventHandler (UserTasksChanged));
TaskService.UserTasks.TasksAdded += (TaskEventHandler) DispatchService.GuiDispatch (new TaskEventHandler (UserTasksChanged));
TaskService.UserTasks.TasksRemoved += (TaskEventHandler) DispatchService.GuiDispatch (new TaskEventHandler (UserTasksChanged));
IdeApp.Workspace.FirstWorkspaceItemOpened += CombineOpened;
IdeApp.Workspace.LastWorkspaceItemClosed += CombineClosed;
PropertyService.PropertyChanged += (EventHandler<PropertyChangedEventArgs>) DispatchService.GuiDispatch (new EventHandler<PropertyChangedEventArgs> (OnPropertyUpdated));
ValidateButtons ();
// Initialize with existing tags.
UserTasksChanged (this, null);
}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:71,代码来源:UserTasksView.cs
示例14: TreeStore
Widget MonoDevelop.DesignerSupport.IOutlinedDocument.GetOutlineWidget ()
{
if (outlineTreeView != null)
return outlineTreeView;
outlineTreeStore = new TreeStore (typeof(object));
outlineTreeModelSort = new TreeModelSort (outlineTreeStore);
settings = ClassOutlineSettings.Load ();
comparer = new ClassOutlineNodeComparer (GetAmbience (), settings, outlineTreeModelSort);
outlineTreeModelSort.SetSortFunc (0, comparer.CompareNodes);
outlineTreeModelSort.SetSortColumnId (0, SortType.Ascending);
outlineTreeView = new MonoDevelop.Ide.Gui.Components.PadTreeView (outlineTreeStore);
var pixRenderer = new CellRendererPixbuf ();
pixRenderer.Xpad = 0;
pixRenderer.Ypad = 0;
outlineTreeView.TextRenderer.Xpad = 0;
outlineTreeView.TextRenderer.Ypad = 0;
TreeViewColumn treeCol = new TreeViewColumn ();
treeCol.PackStart (pixRenderer, false);
treeCol.SetCellDataFunc (pixRenderer, new TreeCellDataFunc (OutlineTreeIconFunc));
treeCol.PackStart (outlineTreeView.TextRenderer, true);
treeCol.SetCellDataFunc (outlineTreeView.TextRenderer, new TreeCellDataFunc (OutlineTreeTextFunc));
outlineTreeView.AppendColumn (treeCol);
outlineTreeView.HeadersVisible = false;
outlineTreeView.Selection.Changed += delegate {
JumpToDeclaration (false);
};
outlineTreeView.RowActivated += delegate {
JumpToDeclaration (true);
};
this.lastCU = Document.ParsedDocument;
outlineTreeView.Realized += delegate { RefillOutlineStore (); };
UpdateSorting ();
var sw = new CompactScrolledWindow ();
sw.Add (outlineTreeView);
sw.ShowAll ();
return sw;
}
开发者ID:hduregger,项目名称:monodevelop,代码行数:52,代码来源:ClassOutlineTextEditorExtension.cs
示例15: UserTasksView
public UserTasksView ()
{
highPrioColor = StringToColor (IdeApp.Preferences.UserTasksHighPrioColor);
normalPrioColor = StringToColor (IdeApp.Preferences.UserTasksNormalPrioColor);
lowPrioColor = StringToColor (IdeApp.Preferences.UserTasksLowPrioColor);
store = new ListStore (
typeof (string), // priority
typeof (bool), // completed
typeof (string), // desc
typeof (TaskListEntry), // user task
typeof (Gdk.Color), // foreground color
typeof (int)); // font style
sortModel = new TreeModelSort (store);
view = new MonoDevelop.Ide.Gui.Components.PadTreeView (sortModel);
view.RulesHint = true;
view.SearchColumn = (int)Columns.Description;
view.Selection.Changed += new EventHandler (SelectionChanged);
TreeViewColumn col;
CellRendererComboBox cellRendPriority = new CellRendererComboBox ();
cellRendPriority.Values = priorities;
cellRendPriority.Editable = true;
cellRendPriority.Changed += new ComboSelectionChangedHandler (UserTaskPriorityEdited);
col = view.AppendColumn (GettextCatalog.GetString ("Priority"), cellRendPriority, "text", Columns.Priority, "foreground-gdk", Columns.Foreground, "weight", Columns.Bold);
col.Resizable = true;
col.SortColumnId = (int)Columns.Priority;
CellRendererToggle cellRendCompleted = new CellRendererToggle ();
cellRendCompleted.Toggled += new ToggledHandler (UserTaskCompletedToggled);
cellRendCompleted.Activatable = true;
col = view.AppendColumn (String.Empty, cellRendCompleted, "active", Columns.Completed);
col.SortColumnId = (int)Columns.Completed;
cellRendDesc = view.TextRenderer;
cellRendDesc.Editable = true;
cellRendDesc.Edited += new EditedHandler (UserTaskDescEdited);
col = view.AppendColumn (GettextCatalog.GetString ("Description"), cellRendDesc, "text", Columns.Description, "strikethrough", Columns.Completed, "foreground-gdk", Columns.Foreground, "weight", Columns.Bold);
col.Resizable = true;
col.SortColumnId = (int)Columns.Description;
newButton = new Button ();
newButton.Label = GettextCatalog.GetString ("New Task");
newButton.Image = new ImageView (Gtk.Stock.New, IconSize.Menu);
newButton.Image.Show ();
newButton.Clicked += new EventHandler (NewUserTaskClicked);
newButton.TooltipText = GettextCatalog.GetString ("Create New Task");
copyButton = new Button ();
copyButton.Label = GettextCatalog.GetString ("Copy Task");
copyButton.Image = new ImageView (Gtk.Stock.Copy, IconSize.Menu);
copyButton.Image.Show ();
copyButton.Clicked += CopyUserTaskClicked;
copyButton.TooltipText = GettextCatalog.GetString ("Copy Task Description");
delButton = new Button ();
delButton.Label = GettextCatalog.GetString ("Delete Task");
delButton.Image = new ImageView (Gtk.Stock.Delete, IconSize.Menu);
delButton.Image.Show ();
delButton.Clicked += new EventHandler (DeleteUserTaskClicked);
delButton.TooltipText = GettextCatalog.GetString ("Delete Task");
TaskService.UserTasks.TasksChanged += UserTasksChanged;
TaskService.UserTasks.TasksAdded += UserTasksChanged;
TaskService.UserTasks.TasksRemoved += UserTasksChanged;
if (IdeApp.Workspace.IsOpen)
solutionLoaded = true;
IdeApp.Workspace.FirstWorkspaceItemOpened += CombineOpened;
IdeApp.Workspace.LastWorkspaceItemClosed += CombineClosed;
IdeApp.Preferences.UserTasksLowPrioColor.Changed += OnPropertyUpdated;
IdeApp.Preferences.UserTasksNormalPrioColor.Changed += OnPropertyUpdated;
IdeApp.Preferences.UserTasksHighPrioColor.Changed += OnPropertyUpdated;
ValidateButtons ();
// Initialize with existing tags.
UserTasksChanged (this, null);
}
开发者ID:vvarshne,项目名称:monodevelop,代码行数:82,代码来源:UserTasksView.cs
示例16: TestResultsPad
public TestResultsPad ()
{
UnitTestService.TestSuiteChanged += new EventHandler (OnTestSuiteChanged);
IdeApp.Workspace.WorkspaceItemClosed += OnWorkspaceItemClosed;
panel = new VBox { Name = "testResultBox" };
// Results notebook
book = new HPaned ();
panel.PackStart (book, true, true, 0);
panel.FocusChain = new Gtk.Widget [] { book };
// Failures tree
failuresTreeView = new MonoDevelop.Ide.Gui.Components.PadTreeView { Name = "testResultsTree" };
failuresTreeView.HeadersVisible = false;
failuresStore = new TreeStore (typeof(Xwt.Drawing.Image), typeof(string), typeof(object), typeof(string), typeof(int), typeof(int));
SemanticModelAttribute modelAttr = new SemanticModelAttribute ("store__Image", "store__Message","store__RootTest",
"store__FileName", "store__FileNumber", "store__ErrorOrStackTrace");
TypeDescriptor.AddAttributes (failuresStore, modelAttr);
var pr = new CellRendererImage ();
CellRendererText tr = new CellRendererText ();
TreeViewColumn col = new TreeViewColumn ();
col.PackStart (pr, false);
col.AddAttribute (pr, "image", 0);
col.PackStart (tr, false);
col.AddAttribute (tr, "markup", 1);
failuresTreeView.AppendColumn (col);
failuresTreeView.Model = failuresStore;
var sw = new MonoDevelop.Components.CompactScrolledWindow ();
sw.ShadowType = ShadowType.None;
sw.Add (failuresTreeView);
book.Pack1 (sw, true, true);
outputView = new MonoDevelop.Ide.Gui.Components.LogView.LogTextView { Name = "testResultOutput" };
outputView.ModifyFont (FontService.MonospaceFont);
outputView.Editable = false;
bold = new TextTag ("bold");
bold.Weight = Pango.Weight.Bold;
outputView.Buffer.TagTable.Add (bold);
sw = new MonoDevelop.Components.CompactScrolledWindow ();
sw.ShadowType = ShadowType.None;
sw.Add (outputView);
book.Pack2 (sw, true, true);
outputViewScrolled = sw;
failuresTreeView.RowActivated += OnRowActivated;
failuresTreeView.Selection.Changed += OnRowSelected;
failuresTreeView.DoPopupMenu = delegate (EventButton evt) {
IdeApp.CommandService.ShowContextMenu (failuresTreeView, evt,
"/MonoDevelop/UnitTesting/ContextMenu/TestResultsPad");
};
panel.ShowAll ();
outputViewScrolled.Hide ();
}
开发者ID:pjcollins,项目名称:monodevelop,代码行数:59,代码来源:TestResultsPad.cs
示例17: TestResultsPad
public TestResultsPad ()
{
testService.TestSuiteChanged += new EventHandler (OnTestSuiteChanged);
panel = new VBox ();
// Results notebook
book = new HPaned ();
panel.PackStart (book, true, true, 0);
panel.FocusChain = new Gtk.Widget [] { book };
// Failures tree
failuresTreeView = new MonoDevelop.Ide.Gui.Components.PadTreeView ();
failuresTreeView.HeadersVisible = false;
failuresStore = new TreeStore (typeof(Xwt.Drawing.Image), typeof(string), typeof(object), typeof(string), typeof(int));
var pr = new CellRendererImage ();
CellRendererText tr = new CellRendererText ();
TreeViewColumn col = new TreeViewColumn ();
col.PackStart (pr, false);
col.AddAttribute (pr, "image", 0);
col.PackStart (tr, false);
col.AddAttribute (tr, "markup", 1);
failuresTreeView.AppendColumn (col);
failuresTreeView.Model = failuresStore;
var sw = new MonoDevelop.Components.CompactScrolledWindow ();
sw.ShadowType = ShadowType.None;
sw.Add (failuresTreeView);
book.Pack1 (sw, true, true);
outputView = new MonoDevelop.Ide.Gui.Components.LogView.LogTextView ();
outputView.Editable = false;
bold = new TextTag ("bold");
bold.Weight = Pango.Weight.Bold;
outputView.Buffer.TagTable.Add (bold);
sw = new MonoDevelop.Components.CompactScrolledWindow ();
sw.ShadowType = ShadowType.None;
sw.Add (outputView);
book.Pack2 (sw, true, true);
outputViewScrolled = sw;
failuresTreeView.RowActivated += OnRowActivated;
failuresTreeView.Selection.Changed += OnRowSelected;
failuresTreeView.DoPopupMenu = delegate (EventButton evt) {
IdeApp.CommandService.ShowContextMenu (failuresTreeView, evt,
"/MonoDevelop/NUnit/ContextMenu/TestResultsPad");
};
Control.ShowAll ();
outputViewScrolled.Hide ();
}
开发者ID:brantwedel,项目名称:monodevelop,代码行数:53,代码来源:TestResultsPad.cs
示例18: TreeStore
Widget IOutlinedDocument.GetOutlineWidget ()
{
if (outlineTreeView != null)
return outlineTreeView;
outlineTreeStore = new TreeStore (typeof(object));
outlineTreeModelSort = new TreeModelSort (outlineTreeStore);
settings = OutlineSettings.Load ();
comparer = new OutlineNodeComparer (new AstAmbience (TypeSystemService.Workspace.Options), settings, outlineTreeModelSort);
outlineTreeModelSort.SetSortFunc (0, comparer.CompareNodes);
outlineTreeModelSort.SetSortColumnId (0, SortType.Ascending);
outlineTreeView = new MonoDevelop.Ide.Gui.Components.PadTreeView (outlineTreeStore);
var pixRenderer = new CellRendererImage ();
pixRenderer.Xpad = 0;
pixRenderer.Ypad = 0;
outlineTreeView.TextRenderer.Xpad = 0;
outlineTreeView.TextRenderer.Ypad = 0;
TreeViewColumn treeCol = new TreeViewColumn ();
treeCol.PackStart (pixRenderer, false);
treeCol.SetCellDataFunc (pixRenderer, new TreeCellDataFunc (OutlineTreeIconFunc));
treeCol.PackStart (outlineTreeView.TextRenderer, true);
treeCol.SetCellDataFunc (outlineTreeView.TextRenderer, new
|
请发表评论