本文整理汇总了C#中Gtk.ListStore.GetIter方法的典型用法代码示例。如果您正苦于以下问题:C# ListStore.GetIter方法的具体用法?C# ListStore.GetIter怎么用?C# ListStore.GetIter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.ListStore
的用法示例。
在下文中一共展示了ListStore.GetIter方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EditModsDialog
public EditModsDialog(Instance inst, Gtk.Window parent = null)
: base("Edit Mods", parent, DialogFlags.Modal)
{
Inst = inst;
this.Build();
#region We have to make the treeview ourselves since monodevelop is absolute shit...
this.editModScroll = new ScrolledWindow();
this.editModScroll.HscrollbarPolicy = PolicyType.Never;
this.modView = new Gtk.TreeView();
this.modView.CanFocus = true;
this.modView.Name = "modView";
this.editModScroll.Add(this.modView);
this.VBox.Add(this.editModScroll);
Gtk.Box.BoxChild w3 = ((Gtk.Box.BoxChild)(this.VBox[this.editModScroll]));
w3.Position = 0;
this.ShowAll();
#endregion
modList = new ListStore(typeof(string), typeof(string), typeof(bool), typeof(DateTime));
modView.Model = modList;
modView.AppendColumn("File", new CellRendererText(), "text", 0);
modView.AppendColumn("Install Date", new CellRendererText(), "text", 1);
CellRendererToggle toggleRenderer = new CellRendererToggle();
toggleRenderer.Activatable = true;
toggleRenderer.Sensitive = true;
toggleRenderer.Toggled += (object o, ToggledArgs args) =>
{
TreeIter iter;
if (modList.GetIter(out iter, new TreePath(args.Path)))
modList.SetValue(iter, 2, !(bool)modList.GetValue(iter, 2));
};
modView.AppendColumn("Delete?", toggleRenderer, "active", 2);
modView.Columns[0].Alignment = 0.0f;
modView.Columns[0].Expand = true;
modView.Columns[1].Alignment = 1.0f;
modView.Columns[2].Alignment = 1.0f;
LoadMods();
}
示例2: POEditorWidget
public POEditorWidget (TranslationProject project)
{
this.project = project;
this.Build ();
//FIXME: avoid unnecessary creation of old treeview
scrolledwindow1.Remove (treeviewEntries);
treeviewEntries.Destroy ();
treeviewEntries = new MonoDevelop.Components.ContextMenuTreeView ();
treeviewEntries.ShowAll ();
scrolledwindow1.Add (treeviewEntries);
((MonoDevelop.Components.ContextMenuTreeView)treeviewEntries).DoPopupMenu = ShowPopup;
this.headersEditor = new CatalogHeadersWidget ();
this.notebookPages.AppendPage (headersEditor, new Gtk.Label ());
updateTaskThread = new BackgroundWorker ();
updateTaskThread.WorkerSupportsCancellation = true;
updateTaskThread.DoWork += TaskUpdateWorker;
AddButton (GettextCatalog.GetString ("Translation")).Active = true;
AddButton (GettextCatalog.GetString ("Headers")).Active = false;
// entries tree view
store = new ListStore (typeof(CatalogEntry));
this.treeviewEntries.Model = store;
TreeViewColumn fuzzyColumn = new TreeViewColumn ();
fuzzyColumn.SortIndicator = true;
fuzzyColumn.SortColumnId = 0;
fuzzyColumn.Title = GettextCatalog.GetString ("Fuzzy");
var iconRenderer = new CellRendererImage ();
fuzzyColumn.PackStart (iconRenderer, false);
fuzzyColumn.SetCellDataFunc (iconRenderer, CatalogIconDataFunc);
CellRendererToggle cellRendFuzzy = new CellRendererToggle ();
cellRendFuzzy.Activatable = true;
cellRendFuzzy.Toggled += HandleCellRendFuzzyToggled;
fuzzyColumn.PackStart (cellRendFuzzy, false);
fuzzyColumn.SetCellDataFunc (cellRendFuzzy, FuzzyToggleDataFunc);
treeviewEntries.AppendColumn (fuzzyColumn);
TreeViewColumn originalColumn = new TreeViewColumn ();
originalColumn.Expand = true;
originalColumn.SortIndicator = true;
originalColumn.SortColumnId = 1;
originalColumn.Title = GettextCatalog.GetString ("Original string");
CellRendererText original = new CellRendererText ();
original.Ellipsize = Pango.EllipsizeMode.End;
originalColumn.PackStart (original, true);
originalColumn.SetCellDataFunc (original, OriginalTextDataFunc);
treeviewEntries.AppendColumn (originalColumn);
TreeViewColumn translatedColumn = new TreeViewColumn ();
translatedColumn.Expand = true;
translatedColumn.SortIndicator = true;
translatedColumn.SortColumnId = 2;
translatedColumn.Title = GettextCatalog.GetString ("Translated string");
CellRendererText translation = new CellRendererText ();
translation.Ellipsize = Pango.EllipsizeMode.End;
translatedColumn.PackStart (translation, true);
translatedColumn.SetCellDataFunc (translation, TranslationTextDataFunc);
treeviewEntries.AppendColumn (translatedColumn);
treeviewEntries.Selection.Changed += OnEntrySelected;
// found in tree view
foundInStore = new ListStore (typeof(string), typeof(string), typeof(string), typeof(Xwt.Drawing.Image));
this.treeviewFoundIn.Model = foundInStore;
TreeViewColumn fileColumn = new TreeViewColumn ();
var pixbufRenderer = new CellRendererImage ();
fileColumn.PackStart (pixbufRenderer, false);
fileColumn.SetAttributes (pixbufRenderer, "image", FoundInColumns.Pixbuf);
CellRendererText textRenderer = new CellRendererText ();
fileColumn.PackStart (textRenderer, true);
fileColumn.SetAttributes (textRenderer, "text", FoundInColumns.File);
treeviewFoundIn.AppendColumn (fileColumn);
treeviewFoundIn.AppendColumn ("", new CellRendererText (), "text", FoundInColumns.Line);
treeviewFoundIn.HeadersVisible = false;
treeviewFoundIn.GetColumn (1).FixedWidth = 100;
treeviewFoundIn.RowActivated += delegate(object sender, RowActivatedArgs e) {
Gtk.TreeIter iter;
foundInStore.GetIter (out iter, e.Path);
string line = foundInStore.GetValue (iter, (int)FoundInColumns.Line) as string;
string file = foundInStore.GetValue (iter, (int)FoundInColumns.FullFileName) as string;
int lineNr = 1;
try {
lineNr = 1 + int.Parse (line);
} catch {
}
IdeApp.Workbench.OpenDocument (file, lineNr, 1);
};
this.notebookTranslated.RemovePage (0);
this.searchEntryFilter.Entry.Text = "";
searchEntryFilter.Entry.Changed += delegate {
//.........这里部分代码省略.........
示例3: NewProjectWizzard_New
public NewProjectWizzard_New(Window parent)
{
if (parent != null)
this.TransientFor =parent;
else
this.TransientFor = MainClass.MainWindow;
this.Build();
atrApplication = new FileTemplate.Attribute();
atrApplication.Name = "application";
atrApplication.Type = "text";
this.DefaultHeight = 390 ;
this.Title = MainClass.Languages.Translate("moscrif_ide_title_f1");
ntbWizzard.ShowTabs = false;
Pango.FontDescription customFont = lblNewProject.Style.FontDescription.Copy();// Pango.FontDescription.FromString(MainClass.Settings.ConsoleTaskFont);
customFont.Size = customFont.Size+(int)(customFont.Size/2);
customFont.Weight = Pango.Weight.Bold;
lblNewProject.ModifyFont(customFont);
storeTyp = new ListStore (typeof (string), typeof (string), typeof (Gdk.Pixbuf), typeof (string),typeof(ProjectTemplate),typeof (bool));
storeOrientation = new ListStore (typeof (string), typeof (string), typeof (Gdk.Pixbuf), typeof (string));
storeOutput = new ListStore (typeof (string), typeof (string), typeof (Gdk.Pixbuf));
nvOutput.Model = storeOutput;
nvOutput.AppendColumn ("", new Gtk.CellRendererText (), "text", 0);
nvOutput.AppendColumn ("", new Gtk.CellRendererText (), "text", 1);
nvOutput.AppendColumn ("", new Gtk.CellRendererPixbuf (), "pixbuf", 2);
nvOutput.Columns[1].Expand = true;
ivSelectTyp.Model = storeTyp;
ivSelectTyp.SelectionMode = SelectionMode.Single;
ivSelectTyp.Orientation = Orientation.Horizontal;
CellRendererText rendererSelectTyp = new CellRendererText();
rendererSelectTyp.Ypad =0;
ivSelectTyp.PackEnd(rendererSelectTyp,false);
ivSelectTyp.SetCellDataFunc(rendererSelectTyp, new Gtk.CellLayoutDataFunc(RenderTypProject));
ivSelectTyp.PixbufColumn = COL_PIXBUF;
ivSelectTyp.TooltipColumn = COL_DISPLAY_TEXT;
ivSelectTyp.AddAttribute(rendererSelectTyp, "sensitive", 5);
Gdk.Pixbuf icon0 = MainClass.Tools.GetIconFromStock("project.png",IconSize.LargeToolbar);
storeTyp.AppendValues ("New Empty Project", "Create empty application", icon0, "", null,true);
DirectoryInfo[] diTemplates = GetDirectory(MainClass.Paths.FileTemplateDir);
foreach (DirectoryInfo di in diTemplates) {
string name = di.Name;
string iconFile = System.IO.Path.Combine(di.FullName,"icon.png");
string descFile = System.IO.Path.Combine(di.FullName,"description.xml");
if(!File.Exists(iconFile) || !File.Exists(descFile))
continue;
string descr = name;
ProjectTemplate pt = null;
if(File.Exists(descFile)){
pt = ProjectTemplate.OpenProjectTemplate(descFile);
if((pt!= null))
descr = pt.Description;
}
Gdk.Pixbuf icon = new Gdk.Pixbuf(iconFile);
DirectoryInfo[] templates = di.GetDirectories();
bool sensitive = true;
if(templates.Length<1)
sensitive = false;
else
sensitive = true;
storeTyp.AppendValues (name, descr, icon, di.FullName,pt,sensitive);
}
ivSelectTyp.SelectionChanged+= delegate(object sender, EventArgs e)
{
Gtk.TreePath[] selRow = ivSelectTyp.SelectedItems;
if(selRow.Length<1){
lblHint.Text = " ";
btnNext.Sensitive = false;
return;
}
Gtk.TreePath tp = selRow[0];
TreeIter ti = new TreeIter();
storeTyp.GetIter(out ti,tp);
if(tp.Equals(TreeIter.Zero))return;
//string typ = storeTyp.GetValue (ti, 3).ToString();
string text1 = (string) storeTyp.GetValue (ti, 0);
string text2 = (string) storeTyp.GetValue (ti, 1);
bool sensitive = Convert.ToBoolean(storeTyp.GetValue (ti, 5));
if(!sensitive){
ivSelectTyp.SelectPath(selectedTypPrj);
return;
//.........这里部分代码省略.........
示例4: EditModsDialog
public EditModsDialog(Instance inst, Gtk.Window parent = null)
: base("Edit Mods", parent, DialogFlags.Modal)
{
Inst = inst;
using (Button buttonRefresh = new Button("gtk-refresh"))
{
buttonRefresh.Clicked += (sender, e) =>
{
LoadMods();
};
ActionArea.Homogeneous = false;
ActionArea.PackEnd(buttonRefresh, false, true, 0);
buttonRefresh.Visible = true;
}
this.Build();
#region We have to make the treeview ourselves since monodevelop is absolute shit...
this.editModScroll = new ScrolledWindow();
this.editModScroll.HscrollbarPolicy = PolicyType.Never;
this.modView = new Gtk.TreeView();
this.modView.CanFocus = true;
this.modView.Name = "modView";
this.editModScroll.Add(this.modView);
this.VBox.Add(this.editModScroll);
Gtk.Box.BoxChild w3 = ((Gtk.Box.BoxChild)(this.VBox[this.editModScroll]));
w3.Position = 0;
this.ShowAll();
#endregion
modList = new ListStore(typeof(string), typeof(int), typeof(bool));
modView.Model = modList;
using (CellRendererText cr = new CellRendererText())
modView.AppendColumn("Index", cr, "text", 1);
using (CellRendererText cr = new CellRendererText())
modView.AppendColumn("File", cr, "text", 0);
CellRendererToggle toggleRenderer = new CellRendererToggle();
toggleRenderer.Activatable = true;
toggleRenderer.Sensitive = true;
toggleRenderer.Toggled += (object o, ToggledArgs args) =>
{
TreeIter iter;
using (TreePath tp = new TreePath(args.Path))
if (modList.GetIter(out iter, tp))
modList.SetValue(iter, 2, !(bool) modList.GetValue(iter, 2));
};
modView.AppendColumn("Delete?", toggleRenderer, "active", 2);
modView.Columns[0].Alignment = 0.0f;
modView.Columns[1].Alignment = 0.0f;
modView.Columns[1].Expand = true;
modView.Columns[2].Alignment = 1.0f;
modView.Reorderable = true;
LoadMods();
// Auto-refresh
Inst.InstMods.ModFileChanged += (sender, e) =>
Application.Invoke((sender2, e2) => LoadMods());
}
示例5: GenerateNotebookPages
//.........这里部分代码省略.........
tvList.Columns[2].SetCellDataFunc(collumnResolRenderer, new Gtk.TreeCellDataFunc(RenderResolution));
// povolene resolution pre danu platformu
PlatformResolution listPR = MainClass.Settings.PlatformResolutions.Find(x=>x.IdPlatform ==deviceTyp);
Device dvc = project.DevicesSettings.Find(x=>x.TargetPlatformId ==deviceTyp);
string stringTheme = "";
List<System.IO.DirectoryInfo> themeResolution = new List<System.IO.DirectoryInfo>(); // resolution z adresara themes po novom
if((project.NewSkin) && (dvc != null)){
Skin skin =dvc.Includes.Skin;
if((skin != null) && ( !String.IsNullOrEmpty(skin.Name)) && (!String.IsNullOrEmpty(skin.Theme)) ){
string skinDir = System.IO.Path.Combine(MainClass.Workspace.RootDirectory, MainClass.Settings.SkinDir);
stringTheme = System.IO.Path.Combine(skinDir,skin.Name);
stringTheme = System.IO.Path.Combine(stringTheme, "themes");
stringTheme = System.IO.Path.Combine(stringTheme, skin.Theme);
if (System.IO.Directory.Exists(stringTheme)){
System.IO.DirectoryInfo di = new System.IO.DirectoryInfo(stringTheme);
themeResolution = new List<System.IO.DirectoryInfo>(di.GetDirectories());
}
}
}
crt.Toggled += delegate(object o, ToggledArgs args) {
if((deviceTyp == (int)DeviceType.Windows)||(deviceTyp == (int)DeviceType.MacOs)){
if(!MainClass.LicencesSystem.CheckFunction("windowsandmac",this)){
return;
}
}
TreeIter iter;
if (ls.GetIter (out iter, new TreePath(args.Path))) {
bool old = (bool) ls.GetValue(iter,0);
CombinePublish cp =(CombinePublish) ls.GetValue(iter,2);
cp.IsSelected = !old;
ls.SetValue(iter,0,!old);
List<CombinePublish> tmp2 = lcp.FindAll(x=>x.IsSelected == true);
nl.SetLabel (String.Format("{0} ({1})",deviceName,tmp2.Count ));
//if(dvc == null) return;
//if(dvc.Includes == null) return;
if(dvc.Includes.Skin == null) return;
if(String.IsNullOrEmpty(dvc.Includes.Skin.Name) || String.IsNullOrEmpty(dvc.Includes.Skin.Theme)) return;
if(cp.IsSelected){
// Najdem ake je rozlisenie v danej combinacii
CombineCondition cc = cp.combineRule.Find(x=>x.ConditionId == MainClass.Settings.Resolution.Id);
if(cc == null) return; /// nema ziadne rozlisenie v combinacii
int indxResol = themeResolution.FindIndex(x=>x.Name.ToLower() == cc.RuleName.ToLower());
if(indxResol<0){
// theme chyba prislusne rozlisenie
string error =String.Format("Invalid {0} Skin and {1} Theme, using in {2}. Missing resolutions: {3}. ",dvc.Includes.Skin.Name,dvc.Includes.Skin.Theme,deviceName,cc.RuleName.ToLower());
MainClass.MainWindow.OutputConsole.WriteError(error+"\n");
List<string> lst = new List<string>();
lst.Add(error);
MainClass.MainWindow.ErrorWritte("","",lst);
}
}
}
};
示例6: RenderablesList
public RenderablesList(string file_name)
{
m_unit_file = new UnitFile (file_name);
m_renderables_names = new List<string> (m_unit_file.renderables_names());
m_renderables = new List<Renderable> (m_unit_file.renderables());
Console.Write (m_renderables_names[0]);
m_renderables_store = new ListStore (typeof (string), typeof (string), typeof (string), typeof(string), typeof(bool));
TreeView tree = new TreeView ();
this.Add (tree);
TreeViewColumn nameColumn = new TreeViewColumn ();
nameColumn.Title = "Name";
nameColumn.Alignment = 0.5f;
TreeViewColumn nodeColumn = new TreeViewColumn ();
nodeColumn.Title = "Node";
nodeColumn.Alignment = 0.5f;
TreeViewColumn typeColumn = new TreeViewColumn ();
typeColumn.Title = "Type";
typeColumn.Alignment = 0.5f;
TreeViewColumn resourceColumn = new TreeViewColumn ();
resourceColumn.Title = "Resource";
resourceColumn.Alignment = 0.5f;
TreeViewColumn visibleColumn = new TreeViewColumn ();
visibleColumn.Title = "Visible";
visibleColumn.Alignment = 0.5f;
// Assign the model to the TreeView
tree.Model = m_renderables_store;
CellRendererText nameCell = new CellRendererText ();
nameCell.Editable = true;
nameCell.Edited += delegate (object o, EditedArgs e) {
TreePath path = new TreePath (e.Path);
TreeIter iter;
m_renderables_store.GetIter (out iter, path);
int i = path.Indices[0];
string r = e.NewText;
m_renderables_names[i] = r;
m_renderables_store.SetValue (iter, 0, r);
};
nameColumn.PackStart (nameCell, true);
CellRendererText nodeCell = new CellRendererText ();
nodeCell.Editable = true;
nodeCell.Edited += delegate (object o, EditedArgs e) {
TreePath path = new TreePath (e.Path);
TreeIter iter;
m_renderables_store.GetIter (out iter, path);
int i = path.Indices[0];
Renderable r = m_renderables[i];
r.node = e.NewText;
m_renderables_store.SetValue (iter, 1, r.node);
};
nodeColumn.PackStart (nodeCell, true);
CellRendererText typeCell = new CellRendererText ();
typeCell.Editable = true;
typeCell.Edited += delegate (object o, EditedArgs e) {
TreePath path = new TreePath (e.Path);
TreeIter iter;
m_renderables_store.GetIter (out iter, path);
int i = path.Indices[0];
Renderable r = m_renderables[i];
r.type = e.NewText;
m_renderables_store.SetValue (iter, 2, r.type);
};
typeColumn.PackStart (typeCell, true);
CellRendererText resourceCell = new CellRendererText ();
resourceCell.Editable = true;
resourceCell.Edited += delegate (object o, EditedArgs e) {
TreePath path = new TreePath (e.Path);
TreeIter iter;
m_renderables_store.GetIter (out iter, path);
int i = path.Indices[0];
Renderable r = m_renderables[i];
r.resource = e.NewText;
m_renderables_store.SetValue (iter, 3, r.resource);
};
resourceColumn.PackStart (resourceCell, true);
CellRendererToggle visibleCell = new CellRendererToggle ();
visibleCell.Activatable = true;
visibleCell.Toggled += delegate (object o, ToggledArgs e) {
TreePath path = new TreePath (e.Path);
TreeIter iter;
m_renderables_store.GetIter (out iter, path);
int i = path.Indices[0];
//.........这里部分代码省略.........
示例7: POEditorWidget
public POEditorWidget (TranslationProject project)
{
this.project = project;
this.Build ();
this.headersEditor = new CatalogHeadersWidget ();
this.notebookPages.AppendPage (headersEditor, new Gtk.Label ());
updateThread = new BackgroundWorker ();
updateThread.WorkerSupportsCancellation = true;
updateThread.DoWork += FilterWorker;
updateTaskThread = new BackgroundWorker ();
updateTaskThread.WorkerSupportsCancellation = true;
updateTaskThread.DoWork += TaskUpdateWorker;
AddButton (GettextCatalog.GetString ("Translation")).Active = true;
AddButton (GettextCatalog.GetString ("Headers")).Active = false;
// entries tree view
store = new ListStore (typeof(string), typeof(bool), typeof(string), typeof(string), typeof(CatalogEntry), typeof(Gdk.Color), typeof(int), typeof(Gdk.Color));
this.treeviewEntries.Model = store;
treeviewEntries.AppendColumn (String.Empty, new CellRendererIcon (), "stock_id", Columns.Stock, "cell-background-gdk", Columns.RowColor);
CellRendererToggle cellRendFuzzy = new CellRendererToggle ();
cellRendFuzzy.Toggled += new ToggledHandler (FuzzyToggled);
cellRendFuzzy.Activatable = true;
treeviewEntries.AppendColumn (GettextCatalog.GetString ("Fuzzy"), cellRendFuzzy, "active", Columns.Fuzzy, "cell-background-gdk", Columns.RowColor);
CellRendererText original = new CellRendererText ();
original.Ellipsize = Pango.EllipsizeMode.End;
treeviewEntries.AppendColumn (GettextCatalog.GetString ("Original string"), original, "text", Columns.String, "cell-background-gdk", Columns.RowColor, "foreground-gdk", Columns.ForeColor);
CellRendererText translation = new CellRendererText ();
translation.Ellipsize = Pango.EllipsizeMode.End;
treeviewEntries.AppendColumn (GettextCatalog.GetString ("Translated string"), translation, "text", Columns.Translation, "cell-background-gdk", Columns.RowColor, "foreground-gdk", Columns.ForeColor);
treeviewEntries.Selection.Changed += new EventHandler (OnEntrySelected);
treeviewEntries.GetColumn (0).SortIndicator = true;
treeviewEntries.GetColumn (0).SortColumnId = (int)Columns.TypeSortIndicator;
treeviewEntries.GetColumn (1).SortIndicator = true;
treeviewEntries.GetColumn (1).SortColumnId = (int)Columns.Fuzzy;
treeviewEntries.GetColumn (2).SortIndicator = true;
treeviewEntries.GetColumn (2).SortColumnId = (int)Columns.String;
treeviewEntries.GetColumn (2).Resizable = true;
treeviewEntries.GetColumn (2).Expand = true;
treeviewEntries.GetColumn (3).SortIndicator = true;
treeviewEntries.GetColumn (3).SortColumnId = (int)Columns.Translation;
treeviewEntries.GetColumn (3).Resizable = true;
treeviewEntries.GetColumn (3).Expand = true;
// found in tree view
foundInStore = new ListStore (typeof(string), typeof(string), typeof(string), typeof(Pixbuf));
this.treeviewFoundIn.Model = foundInStore;
TreeViewColumn fileColumn = new TreeViewColumn ();
var pixbufRenderer = new CellRendererPixbuf ();
fileColumn.PackStart (pixbufRenderer, false);
fileColumn.SetAttributes (pixbufRenderer, "pixbuf", FoundInColumns.Pixbuf);
CellRendererText textRenderer = new CellRendererText ();
fileColumn.PackStart (textRenderer, true);
fileColumn.SetAttributes (textRenderer, "text", FoundInColumns.File);
treeviewFoundIn.AppendColumn (fileColumn);
treeviewFoundIn.AppendColumn ("", new CellRendererText (), "text", FoundInColumns.Line);
treeviewFoundIn.HeadersVisible = false;
treeviewFoundIn.GetColumn (1).FixedWidth = 100;
treeviewFoundIn.RowActivated += delegate(object sender, RowActivatedArgs e) {
Gtk.TreeIter iter;
foundInStore.GetIter (out iter, e.Path);
string line = foundInStore.GetValue (iter, (int)FoundInColumns.Line) as string;
string file = foundInStore.GetValue (iter, (int)FoundInColumns.FullFileName) as string;
int lineNr = 1;
try {
lineNr = 1 + int.Parse (line);
} catch {
}
IdeApp.Workbench.OpenDocument (file, lineNr, 1, true);
};
this.notebookTranslated.RemovePage (0);
this.searchEntryFilter.Entry.Text = "";
searchEntryFilter.Entry.Changed += delegate {
UpdateFromCatalog ();
};
this.togglebuttonFuzzy.Active = PropertyService.Get ("Gettext.ShowFuzzy", true);
this.togglebuttonFuzzy.TooltipText = GettextCatalog.GetString ("Show fuzzy translations");
this.togglebuttonFuzzy.Toggled += delegate {
MonoDevelop.Core.PropertyService.Set ("Gettext.ShowFuzzy", this.togglebuttonFuzzy.Active);
UpdateFromCatalog ();
};
this.togglebuttonMissing.Active = PropertyService.Get ("Gettext.ShowMissing", true);
this.togglebuttonMissing.TooltipText = GettextCatalog.GetString ("Show missing translations");
this.togglebuttonMissing.Toggled += delegate {
MonoDevelop.Core.PropertyService.Set ("Gettext.ShowMissing", this.togglebuttonMissing.Active);
//.........这里部分代码省略.........
示例8: LoadPluginsTreeview
/// <summary>
/// Loads the plugins treeview.
/// </summary>
private void LoadPluginsTreeview()
{
ListStore store = new ListStore(typeof(PluginTreeviewContainer));
foreach (IBase plug in Plugins.LoadAllPlugins())
{
bool loaded = true;
IBase loaded_plug = this.ui.Plugins.FirstOrDefault(p => p.GetType().Assembly.GetName().Name == plug.GetType().Assembly.GetName().Name);
if (loaded_plug == null)
loaded_plug = this.ui.Trays.FirstOrDefault(p => p.GetType().Assembly.GetName().Name == plug.GetType().Assembly.GetName().Name);
if (loaded_plug == null)
{
loaded_plug = plug;
loaded = false;
}
store.AppendValues(new PluginTreeviewContainer()
{
Enabled = loaded,
Name = plug.Name,
Description = plug.Description,
DllName = plug.GetType().Assembly.GetName().Name,
Plugin = loaded_plug
});
}
TreeViewColumn column = new TreeViewColumn();
column.Title = Catalog.GetString("Enabled");
CellRendererToggle toggle_cell = new CellRendererToggle();
toggle_cell.Toggled += (s, e) =>
{
TreeIter iter;
store.GetIter(out iter, new TreePath(e.Path));
PluginTreeviewContainer item = (PluginTreeviewContainer)store.GetValue(iter, 0);
item.Enabled = !((CellRendererToggle)s).Active;
Type t = item.Plugin.GetType();
string[] plugins = Core.Settings.Instance[Core.Settings.Keys.Plugins.List].AsString().Split('|');
string name = t.Assembly.GetName().Name;
((CellRendererToggle)s).Active = !((CellRendererToggle)s).Active;
if (((CellRendererToggle)s).Active)
{
try
{
if (t.GetInterface(typeof(IPlugin).Name) != null)
{
IPlugin plugin = (IPlugin)item.Plugin;
plugin.Load();
this.ui.Plugins.Add(plugin);
this.ui.Plugins = this.ui.Plugins.OrderBy(p => p.Name).ToList();
this.ui.RebuildMenu();
this.ReloadPluginPreferencesPages();
}
else if (t.GetInterface(typeof(ITray).Name) != null)
{
ITray plugin = (ITray)item.Plugin;
plugin.Load(this.ui.Menu, this.ui.RebuildMenu);
this.ui.Trays.Add((ITray)item.Plugin);
}
if (!plugins.Contains(name))
Core.Settings.Instance[Core.Settings.Keys.Plugins.List] = plugins[0] != string.Empty ? string.Join("|", plugins) + "|" + name : name;
}
catch (Exception ex)
{
Tools.PrintInfo(ex, this.GetType());
if (plugins.Contains(name))
Core.Settings.Instance[Core.Settings.Keys.Plugins.List] = string.Join("|", plugins.Where(p => p != name).ToArray());
}
}
else
{
try
{
if (t.GetInterface(typeof(IPlugin).Name) != null)
{
IPlugin plugin = (IPlugin)item.Plugin;
this.ui.Plugins.Remove(plugin);
plugin.Dispose();
this.ui.RebuildMenu();
this.ReloadPluginPreferencesPages();
}
else if (t.GetInterface(typeof(ITray).Name) != null)
{
ITray plugin = (ITray)item.Plugin;
this.ui.Trays.Remove(plugin);
plugin.Unload();
}
}
catch (Exception ex)
{
//.........这里部分代码省略.........
示例9: TorrentTreeView
public TorrentTreeView()
: base()
{
Torrents = new ListStore (typeof (Download), typeof (string), typeof (string),
typeof (int), typeof (string), typeof (string),
typeof (string), typeof (string), typeof (string),
typeof (string), typeof (string), typeof (string), typeof (string));
FilterModel = new Gtk.TreeModelFilter (Torrents, null);
FilterModel.VisibleFunc = delegate (TreeModel model, TreeIter iter) {
return Filter == null ? true : Filter ((Download) model.GetValue (iter, 0));
};
Model = FilterModel;
this.torrentController = ServiceManager.Get <TorrentController> ();
buildColumns();
Reorderable = true;
HeadersVisible = true;
HeadersClickable = true;
Selection.Mode = SelectionMode.Multiple;
Selection.Changed += Event.Wrap (delegate (object o, EventArgs e) {
TreeIter iter;
TreePath [] selectedTorrents = Selection.GetSelectedRows ();
List <Download> downloads = new List<Download> ();
foreach (TreePath path in Selection.GetSelectedRows ()) {
if (Torrents.GetIter (out iter, path)) {
downloads.Add ((Download) Torrents.GetValue (iter, 0));
}
}
torrentController.Select (downloads);
});
sourceEntries = new TargetEntry [] {
new TargetEntry(RowAtom.Name, TargetFlags.App, 0)
};
targetEntries = new TargetEntry [] {
new TargetEntry(RowAtom.Name, TargetFlags.Widget, 0),
new TargetEntry(FileAtom.Name, TargetFlags.OtherApp, 0)
};
EnableModelDragSource(Gdk.ModifierType.Button1Mask, sourceEntries, Gdk.DragAction.Copy);
EnableModelDragDest(targetEntries, Gdk.DragAction.Copy);
DragDataGet += OnTorrentDragDataGet;
menu = new TorrentContextMenu ();
torrentController.Added += delegate(object sender, DownloadAddedEventArgs e) {
AddDownload (e.Download);
};
torrentController.Removed += delegate(object sender, DownloadAddedEventArgs e) {
RemoveDownload (e.Download);
};
LabelController lc = ServiceManager.Get <LabelController> ();
lc.SelectionChanged += delegate {
TorrentLabel label = lc.Selection;
Filter = delegate (Download download) {
return label.Torrents.Contains (download);
};
};
// FIXME: This shouldn't be necessary
torrentController.Torrents.ForEach (AddDownload);
}
示例10: IPhoneBuildOptionsWidget
public IPhoneBuildOptionsWidget ()
{
this.Build ();
extraArgsEntry.AddOptions (menuOptions);
linkCombo.AppendText ("Don't link"); //MtouchLinkMode.None
linkCombo.AppendText ("Link SDK assemblies only"); //MtouchLinkMode.SdkOnly
linkCombo.AppendText ("Link all assemblies"); //MtouchLinkMode.All
foreach (var v in IPhoneFramework.InstalledSdkVersions)
sdkComboEntry.AppendText (v.ToString ());
sdkComboEntry.Changed += HandleSdkComboEntryChanged;
store = new ListStore (typeof (string), typeof (bool));
i18nTreeView.Model = store;
var toggle = new CellRendererToggle ();
i18nTreeView.AppendColumn ("", toggle, "active", 1);
i18nTreeView.AppendColumn ("", new CellRendererText (), "text", 0);
i18nTreeView.HeadersVisible = false;
toggle.Toggled += delegate (object o, ToggledArgs args) {
TreeIter iter;
if (store.GetIter (out iter, new TreePath (args.Path)))
store.SetValue (iter, 1, !(bool)store.GetValue (iter, 1));
};
this.ShowAll ();
}
示例11: FileExplorer
//.........这里部分代码省略.........
mi.Activated += OnOutputClicked;
menu.Insert (mi, -1);
menu.ShowAll ();
if(MainClass.Platform.IsWindows){
SeparatorMenuItem smi = new SeparatorMenuItem();
menu.Insert (smi, -1);
string[] drives = Environment.GetLogicalDrives();
foreach(string strDrive in drives)
{
mi = new MenuItem (strDrive);
mi.TooltipText = strDrive;
mi.Activated += delegate(object sender, EventArgs e)
{
string drive = (sender as MenuItem).TooltipText;
parent = new DirectoryInfo(drive);
FillStore (true);
upButton.Sensitive = false;
};
menu.Insert (mi, -1);
menu.ShowAll ();
};
}
MenusToolButton gotoButton= new MenusToolButton(menu,"workspace.png");
gotoButton.IsImportant = true;
gotoButton.Label = "Go To";
toolbar.Insert (gotoButton, -1);
Gtk.Menu menuAdd = new Gtk.Menu ();
mi = new MenuItem (MainClass.Languages.Translate("menu_create_file"));
mi.Activated += OnCreateFileClicked;
menuAdd.Insert (mi, -1);
mi = new MenuItem (MainClass.Languages.Translate("menu_create_dir"));
mi.Activated += OnCreateDirectoryClicked;
menuAdd.Insert (mi, -1);
menuAdd.ShowAll ();
MenusToolButton mtbCreate= new MenusToolButton(menuAdd,"file-new.png");
mtbCreate.IsImportant = true;
mtbCreate.Label = "Create";
toolbar.Insert (mtbCreate, -1);
fileIcon = GetIcon ("file.png");//Stock.File);
dirIcon = GetIcon ("folder.png");//Stock.Open);
upIcon = GetIcon ("go-up.png");
ScrolledWindow sw = new ScrolledWindow ();
sw.ShadowType = ShadowType.EtchedIn;
sw.SetPolicy (PolicyType.Automatic, PolicyType.Automatic);
this.PackStart (sw, true, true, 0);
// Create the store and fill it with the contents of '/'
store = CreateStore ();
iconView = new IconView (store);
iconView.ButtonReleaseEvent+= OnButtonRelease;
iconView.SelectionMode = SelectionMode.Single;
iconView.Columns = 1;
iconView.Orientation = Orientation.Horizontal;
upButton.Clicked += new EventHandler (OnUpClicked);
iconView.TextColumn = COL_DISPLAY_NAME;
iconView.PixbufColumn = COL_PIXBUF;
iconView.TooltipColumn = COL_PATH;
iconView.RowSpacing = -6;
iconView.Spacing = -1;
iconView.ColumnSpacing=0;
iconView.Margin=-5;
iconView.ItemActivated += new ItemActivatedHandler (OnItemActivated);
sw.Add (iconView);
iconView.SelectionChanged+= delegate(object sender, EventArgs e) {
Gtk.TreePath[] selRow = iconView.SelectedItems;
if(selRow.Length<1) return;
Gtk.TreePath tp = selRow[0];
TreeIter ti = new TreeIter();
store.GetIter(out ti,tp);
if(tp.Equals(TreeIter.Zero))return;
string name = store.GetValue(ti, 1).ToString();
if(name == ".."){
selectedItem = null;
} else {
selectedItem = store.GetValue(ti, 0).ToString();
isDir = (bool)store.GetValue(ti, 3);
}
};
this.PackEnd (navigBar, false, false, 0);
}
示例12: buildColumns
private void buildColumns()
{
Model = new ListStore (typeof (TorrentLabel), typeof (Gdk.Pixbuf),
typeof (string), typeof (string), typeof (bool));
iconColumn = new TreeViewColumn();
nameColumn = new TreeViewColumn();
sizeColumn = new TreeViewColumn();
Gtk.CellRendererPixbuf iconRendererCell = new Gtk.CellRendererPixbuf ();
Gtk.CellRendererText nameRendererCell = new Gtk.CellRendererText { Editable = true };
Gtk.CellRendererText sizeRendererCell = new Gtk.CellRendererText();
iconColumn.PackStart(iconRendererCell, true);
nameColumn.PackStart(nameRendererCell, true);
sizeColumn.PackStart(sizeRendererCell, true);
iconColumn.AddAttribute (iconRendererCell, "pixbuf", 1);
nameColumn.AddAttribute (nameRendererCell, "text", 2);
sizeColumn.AddAttribute (sizeRendererCell, "text", 3);
nameColumn.AddAttribute (nameRendererCell, "editable", 4);
AppendColumn (iconColumn);
AppendColumn (nameColumn);
AppendColumn (sizeColumn);
nameRendererCell.Edited += Event.Wrap ((EditedHandler) delegate (object o, Gtk.EditedArgs args) {
Gtk.TreeIter iter;
if (Model.GetIter (out iter, new Gtk.TreePath (args.Path))) {
TorrentLabel label = (TorrentLabel) Model.GetValue (iter, 0);
label.Name = args.NewText;
}
});
}
示例13: RemoveItems
private void RemoveItems(ref Contacts cnts, ref ListStore lstore, TreePath[] tPath)
{
for(int p=(tPath.Length-1); p>=0; p--)
{
// remove contact from list
cnts.SimContacts.RemoveAt(tPath[p].Indices[0]);
}
for(int p=(tPath.Length-1); p>=0; p--)
{
// remove contact from list
TreeIter ti;
bool isIter = lstore.GetIter(out ti, tPath[p]);
if (isIter)
{
lstore.Remove(ref ti);
}
}
}