本文整理汇总了C#中Gtk.ListStore.SetValue方法的典型用法代码示例。如果您正苦于以下问题:C# ListStore.SetValue方法的具体用法?C# ListStore.SetValue怎么用?C# ListStore.SetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.ListStore
的用法示例。
在下文中一共展示了ListStore.SetValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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());
}
示例3: MainWindow
public MainWindow()
{
XML gxml = new XML(null, "MultiMC.GTKGUI.MainWindow.glade",
"mainVBox", null);
gxml.Toplevel = this;
gxml.Autoconnect(this);
XML gxml2 = new XML(null, "MultiMC.GTKGUI.InstContextMenu.glade",
"instContextMenu", null);
gxml2.Autoconnect(this);
/*
* HACK: the nested menu isn't picked up by the first gxml object. It is probably a GTK# bug.
* This is the fix - manually asking for the menu and connecting it.
*/
XML gxml3 = new XML(null, "MultiMC.GTKGUI.MainWindow.glade",
"menunew", null);
gxml3.Autoconnect(this);
newInstButton.Menu = menunew;
this.Add(mainVBox);
ShowAll();
this.WidthRequest = 620;
this.HeightRequest = 380;
DeleteEvent += (o, args) => Application.Quit();
// Set up the instance icon view
instListStore = new ListStore(
typeof(string), typeof(Gdk.Pixbuf), typeof(Instance));
instView.Model = instListStore;
instView.TextColumn = 0;
instView.PixbufColumn = 1;
instView.ItemWidth = -1;
Gtk.CellRendererText crt = instView.Cells[0] as CellRendererText;
crt.Editable = true;
crt.Edited += (object o, EditedArgs args) =>
{
int EditedIndex = int.Parse(args.Path);
TreeIter iter;
// don't allow bad names
if(!Instance.NameIsValid(args.NewText))
return;
System.Console.WriteLine("Path: " + args.Path + " New text: " + args.NewText);
if(instListStore.GetIterFromString(out iter,args.Path))
{
instListStore.SetValue(iter, 0, args.NewText);
Instance inst = instListStore.GetValue(iter, 2) as Instance;
inst.Name = args.NewText;
}
};
instView.Orientation = Orientation.Vertical;
instView.ButtonPressEvent += (o, args) =>
{
if (args.Event.Button == 3 &&
instView.GetPathAtPos((int)args.Event.X,
(int)args.Event.Y) != null)
{
instView.SelectPath(instView.GetPathAtPos(
(int)args.Event.X, (int)args.Event.Y));
instContextMenu.Popup();
}
};
instView.KeyPressEvent += (object o, KeyPressEventArgs args) =>
{
if(args.Event.Key == Gdk.Key.F2)
{
if(instView.SelectedItems.Count() != 0)
instView.SetCursor(instView.SelectedItems[0], instView.Cells[0], true);
}
else if(args.Event.Key == Gdk.Key.Escape)
{
if(EscPressed != null)
EscPressed(this, EventArgs.Empty);
}
};
// Set up the task list
EventfulList<Task> tList = new EventfulList<Task>();
tList.Added += TaskAdded;
tList.Removed += TaskRemoved;
TaskList = tList;
taskProgBars = new Dictionary<int, Box>();
// Set up the instance list
EventfulList<Instance> iList = new EventfulList<Instance>();
iList.Added += InstAdded;
iList.Removed += InstRemoved;
InstanceList = iList;
helpButton.Sensitive = false;
if(OSUtils.OS == OSEnum.Linux)
//.........这里部分代码省略.........
示例4: GenerateNotebookPages
//.........这里部分代码省略.........
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);
}
}
}
};
int cntOfAdded = 0;
foreach (CombinePublish cp in lcp){
bool isValid = cp.IsSelected;
示例5: 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];
//.........这里部分代码省略.........
示例6: AddTagsTab
private void AddTagsTab()
{
Table tags_table = new Table(1, 2, false);
tags_table.BorderWidth = 5;
tags_table.ColumnSpacing = 10;
tags_table.RowSpacing = 10;
ScrolledWindow tags_swin = new ScrolledWindow();
tags_swin.ShadowType = ShadowType.In;
tags_swin.SetPolicy(PolicyType.Automatic, PolicyType.Automatic);
tags_table.Attach(tags_swin, 0, 1, 0, 1);
cr_toggle = new CellRendererToggle();
cr_toggle.Activatable = true;
cr_toggle.Toggled += new ToggledHandler(OnCrToggleToggled);
tv_tags = new TreeView();
tags_swin.Add(tv_tags);
store_tags = new ListStore(typeof(bool), typeof(string));
tv_tags.Model = store_tags;
// set up the columns for the view
TreeViewColumn column_Read = new TreeViewColumn("Use", cr_toggle, "active", 0);
tv_tags.AppendColumn(column_Read);
TreeViewColumn column_Name = new TreeViewColumn("Title", new CellRendererText(), "text", 1);
tv_tags.AppendColumn(column_Name);
foreach ( string tag in Feeds.GetTags() ) {
TreeIter iter = store_tags.Append();
if ( feed.Tags.Contains(tag) ) {
store_tags.SetValue(iter, 0, true);
} else {
store_tags.SetValue(iter, 0, false);
}
store_tags.SetValue(iter, 1, tag);
}
ButtonBox tags_bbox = new HButtonBox();
tags_bbox.Layout = ButtonBoxStyle.End;
tags_table.Attach(tags_bbox, 0, 1, 1, 2);
Button add_button = new Button(Stock.Add);
add_button.Clicked += new EventHandler(OnAddButtonClicked);
tags_bbox.PackStart(add_button);
notebook.AppendPage(tags_table, new Label("Tags"));
}
示例7: FilterComboBox
private Gtk.ComboBox FilterComboBox ()
{
filter_data = new Gtk.ListStore (new Type[] { typeof (string), typeof (string) });
Gtk.TreeIter iter;
iter = filter_data.Append ();
filter_data.SetValue (iter, 0, Catalog.GetString ("Anywhere"));
filter_data.SetValue (iter, 1, null);
iter = filter_data.Append ();
filter_data.SetValue (iter, 0, Catalog.GetString ("in Files"));
filter_data.SetValue (iter, 1, "File");
iter = filter_data.Append ();
filter_data.SetValue (iter, 0, Catalog.GetString ("in Addressbook"));
filter_data.SetValue (iter, 1, "Contact");
iter = filter_data.Append ();
filter_data.SetValue (iter, 0, Catalog.GetString ("in Mail"));
filter_data.SetValue (iter, 1, "MailMessage");
iter = filter_data.Append ();
filter_data.SetValue (iter, 0, Catalog.GetString ("in Web Pages"));
filter_data.SetValue (iter, 1, "WebHistory");
iter = filter_data.Append ();
filter_data.SetValue (iter, 0, Catalog.GetString ("in Chats"));
filter_data.SetValue (iter, 1, "IMLog");
Gtk.ComboBox combo = new Gtk.ComboBox (filter_data);
combo.Active = 0;
Gtk.CellRendererText renderer = new Gtk.CellRendererText ();
combo.PackStart (renderer, false);
combo.SetAttributes (renderer, new object[] { "text", 0 });
return combo;
}
示例8: LaunchDialogue
public override void LaunchDialogue ()
{
//the Type in the collection
IList collection = (IList) Value;
string displayName = Property.DisplayName;
//populate list with existing items
ListStore itemStore = new ListStore (typeof (object), typeof (int), typeof (string));
for (int i=0; i<collection.Count; i++)
itemStore.AppendValues(collection [i], i, collection [i].ToString ());
#region Building Dialogue
TreeView itemTree;
PropertyGrid grid;
TreeIter previousIter = TreeIter.Zero;
//dialogue and buttons
Dialog dialog = new Dialog () {
Title = displayName + " Editor",
Modal = true,
AllowGrow = true,
AllowShrink = true,
};
var toplevel = this.Container.Toplevel as Window;
if (toplevel != null)
dialog.TransientFor = toplevel;
dialog.AddActionWidget (new Button (Stock.Cancel), ResponseType.Cancel);
dialog.AddActionWidget (new Button (Stock.Ok), ResponseType.Ok);
//three columns for items, sorting, PropGrid
HBox hBox = new HBox ();
dialog.VBox.PackStart (hBox, true, true, 5);
//propGrid at end
grid = new PropertyGrid (base.EditorManager) {
CurrentObject = null,
WidthRequest = 200,
ShowHelp = false
};
hBox.PackEnd (grid, true, true, 5);
//followed by a ButtonBox
VBox buttonBox = new VBox ();
buttonBox.Spacing = 6;
hBox.PackEnd (buttonBox, false, false, 5);
//add/remove buttons
Button addButton = new Button (new Image (Stock.Add, IconSize.Button));
buttonBox.PackStart (addButton, false, false, 0);
if (types [0].IsAbstract)
addButton.Sensitive = false;
Button removeButton = new Button (new Gtk.Image (Stock.Remove, IconSize.Button));
buttonBox.PackStart (removeButton, false, false, 0);
//sorting buttons
Button upButton = new Button (new Image (Stock.GoUp, IconSize.Button));
buttonBox.PackStart (upButton, false, false, 0);
Button downButton = new Button (new Image (Stock.GoDown, IconSize.Button));
buttonBox.PackStart (downButton, false, false, 0);
//Third column has list (TreeView) in a ScrolledWindow
ScrolledWindow listScroll = new ScrolledWindow ();
listScroll.WidthRequest = 200;
listScroll.HeightRequest = 320;
hBox.PackStart (listScroll, false, false, 5);
itemTree = new TreeView (itemStore);
itemTree.Selection.Mode = SelectionMode.Single;
itemTree.HeadersVisible = false;
listScroll.AddWithViewport (itemTree);
//renderers and attribs for TreeView
CellRenderer rdr = new CellRendererText ();
itemTree.AppendColumn (new TreeViewColumn ("Index", rdr, "text", 1));
rdr = new CellRendererText ();
itemTree.AppendColumn (new TreeViewColumn ("Object", rdr, "text", 2));
#endregion
#region Events
addButton.Clicked += delegate {
//create the object
object instance = System.Activator.CreateInstance (types[0]);
//get existing selection and insert after it
TreeIter oldIter, newIter;
if (itemTree.Selection.GetSelected (out oldIter))
newIter = itemStore.InsertAfter (oldIter);
//or append if no previous selection
else
newIter = itemStore.Append ();
itemStore.SetValue (newIter, 0, instance);
//select, set name and update all the indices
itemTree.Selection.SelectIter (newIter);
UpdateName (itemStore, newIter);
UpdateIndices (itemStore);
//.........这里部分代码省略.........
示例9: Append
private void Append (ListStore store, MemberRecord mr, Type type)
{
TreeIter iter;
store.Append (out iter);
store.SetValue (iter, 0, new GLib.Value (mr.Label));
store.SetValue (iter, 1, new GLib.Value (type.FullName));
store.SetValue (iter, 2, new GLib.Value (mr.Icon));
store.SetValue (iter, 3, new GLib.Value (mr.GetType () == typeof (TypeRecord)));
}
示例10: ShowContributors
public static void ShowContributors(TreeView treeview)
{
#if DEBUG
Console.WriteLine("TreeViewHelper.ShowContributors");
#endif
string helpFile = FileHelper.FindSupportFile("bygfoot_help", true);
if (string.IsNullOrEmpty(helpFile))
{
GameGUI.ShowWarning(Mono.Unix.Catalog.GetString("Didn't find file 'bygfoot_help'."));
return;
}
OptionList helpList = null;
FileHelper.LoadOptFile(helpFile, ref helpList, false);
// Set treeview properties
treeview.Selection.Mode = SelectionMode.None;
treeview.RulesHint = false;
treeview.HeadersVisible = false;
TreeViewColumn column = new TreeViewColumn();
treeview.AppendColumn(column);
CellRenderer cell = TreeViewHelper.TextCellRenderer();
column.PackStart(cell, true);
column.AddAttribute(cell, "markup", 0);
ListStore ls = new ListStore(typeof(string));
for (int i = 0; i < helpList.list.Count; i++)
{
TreeIter iter = ls.Append();
OptionStruct option = (OptionStruct)helpList.list[i];
if (option.name.StartsWith("string_contrib_title"))
{
string value = string.Format("\n<span {0}>{1}</span>", Option.ConstApp("string_help_window_title_attribute"), option.stringValue);
ls.SetValue(iter, 0, value);
}
else
{
ls.SetValue(iter, 0, option.stringValue);
}
}
treeview.Model = ls;
}
示例11: MakeSyncPane
public Gtk.Widget MakeSyncPane ()
{
Gtk.VBox vbox = new Gtk.VBox (false, 0);
vbox.Spacing = 4;
vbox.BorderWidth = 8;
Gtk.HBox hbox = new Gtk.HBox (false, 4);
Gtk.Label label = new Gtk.Label (Catalog.GetString ("Ser_vice:"));
label.Xalign = 0;
label.Show ();
hbox.PackStart (label, false, false, 0);
// Populate the store with all the available SyncServiceAddins
syncAddinStore = new Gtk.ListStore (typeof (SyncServiceAddin));
syncAddinIters = new Dictionary<string,Gtk.TreeIter> ();
SyncServiceAddin [] addins = Tomboy.DefaultNoteManager.AddinManager.GetSyncServiceAddins ();
Array.Sort (addins, CompareSyncAddinsByName);
foreach (SyncServiceAddin addin in addins) {
Gtk.TreeIter iter = syncAddinStore.Append ();
syncAddinStore.SetValue (iter, 0, addin);
syncAddinIters [addin.Id] = iter;
}
syncAddinCombo = new Gtk.ComboBox (syncAddinStore);
label.MnemonicWidget = syncAddinCombo;
Gtk.CellRendererText crt = new Gtk.CellRendererText ();
syncAddinCombo.PackStart (crt, true);
syncAddinCombo.SetCellDataFunc (crt,
new Gtk.CellLayoutDataFunc (ComboBoxTextDataFunc));
// Read from Preferences which service is configured and select it
// by default. Otherwise, just select the first one in the list.
string addin_id = Preferences.Get (
Preferences.SYNC_SELECTED_SERVICE_ADDIN) as String;
Gtk.TreeIter active_iter;
if (addin_id != null && syncAddinIters.ContainsKey (addin_id)) {
active_iter = syncAddinIters [addin_id];
syncAddinCombo.SetActiveIter (active_iter);
} else {
if (syncAddinStore.GetIterFirst (out active_iter) == true) {
syncAddinCombo.SetActiveIter (active_iter);
}
}
syncAddinCombo.Changed += OnSyncAddinComboChanged;
syncAddinCombo.Show ();
hbox.PackStart (syncAddinCombo, true, true, 0);
hbox.Show ();
vbox.PackStart (hbox, false, false, 0);
// Get the preferences GUI for the Sync Addin
if (active_iter.Stamp != Gtk.TreeIter.Zero.Stamp)
selectedSyncAddin = syncAddinStore.GetValue (active_iter, 0) as SyncServiceAddin;
if (selectedSyncAddin != null)
syncAddinPrefsWidget = selectedSyncAddin.CreatePreferencesControl (OnSyncAddinPrefsChanged);
if (syncAddinPrefsWidget == null) {
Gtk.Label l = new Gtk.Label (Catalog.GetString ("Not configurable"));
l.Yalign = 0.5f;
l.Yalign = 0.5f;
syncAddinPrefsWidget = l;
}
if (syncAddinPrefsWidget != null && addin_id != null &&
syncAddinIters.ContainsKey (addin_id) && selectedSyncAddin.IsConfigured)
syncAddinPrefsWidget.Sensitive = false;
syncAddinPrefsWidget.Show ();
syncAddinPrefsContainer = new Gtk.VBox (false, 0);
syncAddinPrefsContainer.PackStart (syncAddinPrefsWidget, false, false, 0);
syncAddinPrefsContainer.Show ();
vbox.PackStart (syncAddinPrefsContainer, true, true, 10);
// Autosync preference
int timeout = (int) Preferences.Get (Preferences.SYNC_AUTOSYNC_TIMEOUT);
if (timeout > 0 && timeout < 5) {
timeout = 5;
Preferences.Set (Preferences.SYNC_AUTOSYNC_TIMEOUT, 5);
}
Gtk.HBox autosyncBox = new Gtk.HBox (false, 5);
// Translators: This is and the next string go together.
// Together they look like "Automatically Sync in Background Every [_] Minutes",
// where "[_]" is a GtkSpinButton.
autosyncCheck =
new Gtk.CheckButton (Catalog.GetString ("Automaticall_y Sync in Background Every"));
autosyncSpinner = new Gtk.SpinButton (5, 1000, 1);
autosyncSpinner.Value = timeout >= 5 ? timeout : 10;
Gtk.Label autosyncExtraText =
// Translators: See above comment for details on
// this string.
new Gtk.Label (Catalog.GetString ("Minutes"));
autosyncCheck.Active = autosyncSpinner.Sensitive = timeout >= 5;
EventHandler updateTimeoutPref = (o, e) => {
Preferences.Set (Preferences.SYNC_AUTOSYNC_TIMEOUT,
autosyncCheck.Active ? (int) autosyncSpinner.Value : -1);
};
autosyncCheck.Toggled += (o, e) => {
//.........这里部分代码省略.........
示例12: ICSelector
private Container ICSelector ()
{
ScrolledWindow sw = new ScrolledWindow ();
ICStore = new ListStore ((int) GLib.TypeFundamentals.TypeString, (int) GLib.TypeFundamentals.TypeInt);
ICView = new TreeView (ICStore);
TreeViewColumn col = new TreeViewColumn ();
TreeIter iter;
CellRenderer renderer = new CellRendererText ();
col.Title = "MemberType";
col.PackStart (renderer, true);
col.AddAttribute (renderer, "markup", 0);
ICView.AppendColumn (col);
ICView.HeadersVisible = false;
ICStore.Append (out iter);
ICStore.SetValue (iter, 0, new GLib.Value (ICLabel ("all", factory.staticCount + factory.instanceCount)));
ICStore.SetValue (iter, 1, new GLib.Value ((int) (BindingFlags.Static | BindingFlags.Instance)));
ICStore.Append (out iter);
ICStore.SetValue (iter, 0, new GLib.Value (ICLabel ("instance", factory.instanceCount)));
ICStore.SetValue (iter, 1, new GLib.Value ((int) BindingFlags.Instance));
ICStore.Append (out iter);
ICStore.SetValue (iter, 0, new GLib.Value (ICLabel ("class", factory.staticCount)));
ICStore.SetValue (iter, 1, new GLib.Value ((int) BindingFlags.Static));
ICView.Selection.SelectPath (new TreePath ("0"));
ICView.Selection.Changed += new EventHandler (ICSelectionChanged);
ICView.BorderWidth = 5;
sw.Add (ICView);
return sw;
}
示例13: MemberSelector
private Container MemberSelector ()
{
ScrolledWindow sw = new ScrolledWindow ();
memberStore = new ListStore ((int) GLib.TypeFundamentals.TypeString, (int) GLib.TypeFundamentals.TypeInt);
MTView = new TreeView (memberStore);
TreeViewColumn col = new TreeViewColumn ();
TreeIter iter;
CellRenderer renderer = new CellRendererText ();
col.Title = "MemberType";
col.PackStart (renderer, true);
col.AddAttribute (renderer, "markup", 0);
MTView.AppendColumn (col);
MTView.HeadersVisible = false;
foreach (MemberRecordFactory rv in recordFactory) {
memberStore.Append (out iter);
memberStore.SetValue (iter, 0, new GLib.Value (rv.FullTitle));
}
MTView.Selection.SelectPath (new TreePath ("0"));
MTView.Selection.Changed += new EventHandler (MemberFilterSelectionChanged);
MTView.BorderWidth = 5;
sw.Add (MTView);
return sw;
}
示例14: AddToStore
private void AddToStore (ListStore store, GLib.Value field, GLib.Value value, GLib.Value details, GLib.Value icon)
{
TreeIter iter = store.Append ();
store.SetValue (iter, 0, field);
store.SetValue (iter, 1, value);
store.SetValue (iter, 2, details);
store.SetValue (iter, 3, icon);
}
示例15: UpdateAttachments
void UpdateAttachments()
{
var task = SelectedTask;
var model = new ListStore (typeof (Gdk.Pixbuf),
typeof (String),
typeof (String));
if (task != null && task.Attachments != null) {
foreach (string item in task.Attachments) {
var iter = model.Append ();
var info = new System.IO.FileInfo (item);
model.SetValue (iter, 0, GetPixbuf (Stock.File));
model.SetValue (iter, 1, info.Name);
model.SetValue (iter, 2, item);
}
}
m_tasksIconView.Model = model;
}