本文整理汇总了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类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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 ();
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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;
//.........这里部分代码省略.........
示例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;
};
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例14: AspNetEditViewContent
internal AspNetEditViewContent (IViewContent viewContent)
{
this.viewContent = viewContent;
designerFrame = new Frame ();
designerFrame.CanFocus = true;
designerFrame.Shadow = ShadowType.Out;
designerFrame.BorderWidth = 1;
viewContent.WorkbenchWindow.Closing += new WorkbenchWindowEventHandler(workbenchWindowClosingHandler);
outlineStore = null;
outlineView = null;
designerFrame.Show ();
}
示例15:
void IOutlinedDocument.ReleaseOutlineWidget()
{
if (TreeView == null)
return;
var w = (ScrolledWindow)TreeView.Parent;
w.Destroy();
TreeStore.Dispose();
TreeStore = null;
TreeView = null;
//settings = null;
if(toolbarWidgets!=null)
foreach (var tw in toolbarWidgets)
w.Destroy();
toolbarWidgets = null;
//comparer = null;
}