本文整理汇总了C#中Gtk.ListStore.IterNext方法的典型用法代码示例。如果您正苦于以下问题:C# ListStore.IterNext方法的具体用法?C# ListStore.IterNext怎么用?C# ListStore.IterNext使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.ListStore
的用法示例。
在下文中一共展示了ListStore.IterNext方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MoveItem
void MoveItem (TreeView sourceList, ListStore sourceStore, TreeView targetList, ListStore targetStore)
{
TreeModel model;
TreeIter iter;
if (sourceList.Selection.GetSelected (out model, out iter)) {
TreeIter newiter = targetStore.AppendValues (sourceStore.GetValue (iter, 0), sourceStore.GetValue (iter, 1));
targetList.Selection.SelectIter (newiter);
TreeIter oldIter = iter;
if (sourceStore.IterNext (ref iter))
sourceList.Selection.SelectIter (iter);
sourceStore.Remove (ref oldIter);
}
}
示例2: CodeIssuePanelWidget
public CodeIssuePanelWidget (string mimeType)
{
this.mimeType = mimeType;
// ReSharper disable once DoNotCallOverridableMethodsInConstructor
Build ();
// ensure selected row remains visible
treeviewInspections.SizeAllocated += (o, args) => {
TreeIter iter;
if (treeviewInspections.Selection.GetSelected (out iter)) {
var path = treeviewInspections.Model.GetPath (iter);
treeviewInspections.ScrollToCell (path, treeviewInspections.Columns[0], false, 0f, 0f);
}
};
treeviewInspections.TooltipColumn = 2;
treeviewInspections.HasTooltip = true;
var toggleRenderer = new CellRendererToggle ();
toggleRenderer.Toggled += delegate(object o, ToggledArgs args) {
TreeIter iter;
if (treeStore.GetIterFromString (out iter, args.Path)) {
var provider = (BaseCodeIssueProvider)treeStore.GetValue (iter, 1);
enableState[provider] = !enableState[provider];
}
};
var titleCol = new TreeViewColumn ();
treeviewInspections.AppendColumn (titleCol);
titleCol.PackStart (toggleRenderer, false);
titleCol.Sizing = TreeViewColumnSizing.Autosize;
titleCol.SetCellDataFunc (toggleRenderer, delegate (TreeViewColumn treeColumn, CellRenderer cell, TreeModel model, TreeIter iter) {
var provider = (BaseCodeIssueProvider)model.GetValue (iter, 1);
if (provider == null) {
toggleRenderer.Visible = false;
return;
}
toggleRenderer.Visible = true;
toggleRenderer.Active = enableState[provider];
});
var cellRendererText = new CellRendererText {
Ellipsize = Pango.EllipsizeMode.End
};
titleCol.PackStart (cellRendererText, true);
titleCol.AddAttribute (cellRendererText, "markup", 0);
titleCol.Expand = true;
searchentryFilter.ForceFilterButtonVisible = true;
searchentryFilter.RoundedShape = true;
searchentryFilter.HasFrame = true;
searchentryFilter.Ready = true;
searchentryFilter.Visible = true;
searchentryFilter.Entry.Changed += ApplyFilter;
var comboRenderer = new CellRendererCombo {
Alignment = Pango.Alignment.Center
};
var col = treeviewInspections.AppendColumn ("Severity", comboRenderer);
col.Sizing = TreeViewColumnSizing.GrowOnly;
col.MinWidth = 100;
col.Expand = false;
var comboBoxStore = new ListStore (typeof(string), typeof(Severity));
// comboBoxStore.AppendValues (GetDescription (Severity.None), Severity.None);
comboBoxStore.AppendValues (GetDescription (Severity.Error), Severity.Error);
comboBoxStore.AppendValues (GetDescription (Severity.Warning), Severity.Warning);
comboBoxStore.AppendValues (GetDescription (Severity.Hint), Severity.Hint);
comboBoxStore.AppendValues (GetDescription (Severity.Suggestion), Severity.Suggestion);
comboRenderer.Model = comboBoxStore;
comboRenderer.Mode = CellRendererMode.Activatable;
comboRenderer.TextColumn = 0;
comboRenderer.Editable = true;
comboRenderer.HasEntry = false;
comboRenderer.Edited += delegate(object o, EditedArgs args) {
TreeIter iter;
if (!treeStore.GetIterFromString (out iter, args.Path))
return;
TreeIter storeIter;
if (!comboBoxStore.GetIterFirst (out storeIter))
return;
do {
if ((string)comboBoxStore.GetValue (storeIter, 0) == args.NewText) {
var provider = (BaseCodeIssueProvider)treeStore.GetValue (iter, 1);
var severity = (Severity)comboBoxStore.GetValue (storeIter, 1);
severities[provider] = severity;
return;
}
} while (comboBoxStore.IterNext (ref storeIter));
};
col.SetCellDataFunc (comboRenderer, delegate (TreeViewColumn treeColumn, CellRenderer cell, TreeModel model, TreeIter iter) {
var provider = (BaseCodeIssueProvider)model.GetValue (iter, 1);
if (provider == null) {
comboRenderer.Visible = false;
return;
//.........这里部分代码省略.........
示例3: CodeIssuePanelWidget
public CodeIssuePanelWidget (string mimeType)
{
this.mimeType = mimeType;
Build ();
var col1 = treeviewInspections.AppendColumn ("Title", new CellRendererText (), "markup", 0);
col1.Expand = true;
searchentryFilter.Ready = true;
searchentryFilter.Visible = true;
searchentryFilter.Entry.Changed += ApplyFilter;
var comboRenderer = new CellRendererCombo ();
comboRenderer.Alignment = Pango.Alignment.Center;
var col = treeviewInspections.AppendColumn ("Severity", comboRenderer);
col.Sizing = TreeViewColumnSizing.GrowOnly;
col.MinWidth = 100;
col.Expand = false;
var comboBoxStore = new ListStore (typeof(string), typeof(Severity));
comboBoxStore.AppendValues (GetDescription (Severity.None), Severity.None);
comboBoxStore.AppendValues (GetDescription (Severity.Error), Severity.Error);
comboBoxStore.AppendValues (GetDescription (Severity.Warning), Severity.Warning);
comboBoxStore.AppendValues (GetDescription (Severity.Hint), Severity.Hint);
comboBoxStore.AppendValues (GetDescription (Severity.Suggestion), Severity.Suggestion);
comboRenderer.Model = comboBoxStore;
comboRenderer.Mode = CellRendererMode.Activatable;
comboRenderer.TextColumn = 0;
comboRenderer.Editable = true;
comboRenderer.HasEntry = false;
comboRenderer.Edited += delegate(object o, Gtk.EditedArgs args) {
Gtk.TreeIter iter;
if (!treeStore.GetIterFromString (out iter, args.Path))
return;
Gtk.TreeIter storeIter;
if (!comboBoxStore.GetIterFirst (out storeIter))
return;
do {
if ((string)comboBoxStore.GetValue (storeIter, 0) == args.NewText) {
var provider = (BaseCodeIssueProvider)treeStore.GetValue (iter, 1);
var severity = (Severity)comboBoxStore.GetValue (storeIter, 1);
severities[provider] = severity;
return;
}
} while (comboBoxStore.IterNext (ref storeIter));
};
col.SetCellDataFunc (comboRenderer, delegate (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter) {
var provider = (BaseCodeIssueProvider)model.GetValue (iter, 1);
if (provider == null) {
comboRenderer.Visible = false;
return;
}
var severity = severities[provider];
comboRenderer.Visible = true;
comboRenderer.Text = GetDescription (severity);
comboRenderer.BackgroundGdk = GetColor (severity);
});
treeviewInspections.HeadersVisible = false;
treeviewInspections.Model = treeStore;
treeviewInspections.Selection.Changed += HandleSelectionChanged;
GetAllSeverities ();
FillInspectors (null);
}
示例4: MainWindow
public MainWindow()
: base(Gtk.WindowType.Toplevel)
{
Build ();
List<Categoria> categorias = new List<Categoria> ();
categorias.Add (new Categoria (1, "Uno"));
categorias.Add (new Categoria (2, "Dos"));
categorias.Add (new Categoria (3, "Tres"));
categorias.Add (new Categoria (4, "Cuatro"));
int categoriaId = -1;
CellRendererText cellRendererText = new CellRendererText ();
comboBox.PackStart (cellRendererText, false);
comboBox.AddAttribute (cellRendererText, "text", 1);
// CellRendererText cellRendererText2 = new CellRendererText ();
// comboBox.PackStart (cellRendererText2, false);
// comboBox.AddAttribute (cellRendererText2, "text", 1);
ListStore listStore = new ListStore (typeof(int), typeof(string));
TreeIter treeIterInicial = listStore.AppendValues ((ulong)0, "<sin asignar>");
IDbCommand dbCommand = AppDomain.Instance.DvConnection.CreateCommand ();
dbCommand.CommandText = "selected id, nombre from categoria";
IDataReader dataReader = dbCommand.ExecuteReader ();
while (dataReader.Read()) {
object id = dataReader ["id"];
object nombre = dataReader ["nombre"];
foreach (Categoria categoria in categorias) {
TreeIter currentIter = listStore.AppendValues (categoria.Id, categoria.Nombre);
if (categoria.Id == categoriaId)
treeIterInicial = currentIter;
}
// listStore.AppendValues (1, "Uno");
// listStore.AppendValues (2, "Dos");
comboBox.Model = listStore;
comboBox.SetActiveIter (treeIterInicial);
TreeIter currentTreeIter;
listStore.GetIterFirst (out currentTreeIter);
listStore.GetIterFirst (out currentTreeIter);
do {
if(categoriaId.Equals(listStore.GetValue(treeIterInicial, 0))) {
comboBox.SetActiveIter(currentTreeIter);
break;
}
}
while (listStore.IterNext (ref currentTreeIter));
//listStore.GetValue (currentTreeIter, 0);
propertiesAction.Activated += delegate {
TreeIter treeIter;
bool activeIter = comboBox.GetActiveIter (out treeIter);
object id = activeIter ? listStore.GetValue (treeIter, 0) : null;
// ? significa el boolean si tiene algo dentro ejecuta la primera orden y sino, es null.
Console.WriteLine ("id={0}", id);
};
}
示例5: FindTask
static TreeIter FindTask (ListStore store, Task task)
{
TreeIter iter;
if (!store.GetIterFirst (out iter))
return TreeIter.Zero;
do {
Task t = store.GetValue (iter, (int)Columns.Task) as Task;
if (t == task)
return iter;
}
while (store.IterNext (ref iter));
return TreeIter.Zero;
}
示例6: UpdateIndices
static void UpdateIndices (ListStore itemStore)
{
TreeIter iter;
int i = 0;
if (!itemStore.GetIterFirst (out iter))
return;
do {
itemStore.SetValue (iter, 1, i);
i++;
} while (itemStore.IterNext (ref iter));
}
示例7: LaunchDialogue
//.........这里部分代码省略.........
#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);
};
removeButton.Clicked += delegate {
//get selected iter and the replacement selection
TreeIter iter, newSelection;
if (!itemTree.Selection.GetSelected (out iter))
return;
newSelection = iter;
if (!IterPrev (itemStore, ref newSelection)) {
newSelection = iter;
if (!itemStore.IterNext (ref newSelection))
newSelection = TreeIter.Zero;
}
//new selection. Zeroing previousIter prevents trying to update name of deleted iter.
previousIter = TreeIter.Zero;
if (itemStore.IterIsValid (newSelection))
itemTree.Selection.SelectIter (newSelection);
//and the removal and index update
itemStore.Remove (ref iter);
UpdateIndices (itemStore);
};
upButton.Clicked += delegate {
TreeIter iter, prev;
if (!itemTree.Selection.GetSelected (out iter))
return;
//get previous iter
prev = iter;
if (!IterPrev (itemStore, ref prev))
return;
//swap the two
itemStore.Swap (iter, prev);
//swap indices too
object prevVal = itemStore.GetValue (prev, 1);
object iterVal = itemStore.GetValue (iter, 1);
itemStore.SetValue (prev, 1, iterVal);
itemStore.SetValue (iter, 1, prevVal);
};
示例8: PdfExportDialog
public PdfExportDialog(GameManager manager, ITranslations translations)
: base(translations, "PdfExportDialog.ui", "pdfexportbox")
{
pdfExporter = new PdfExporter (translations);
this.manager = manager;
games_spinbutton.Value = 10;
checkbox_logic.Active = checkbox_calculation.Active = checkbox_verbal.Active = true;
// Use defaults from Preferences
switch ((GameDifficulty) Preferences.Get <int> (Preferences.DifficultyKey)) {
case GameDifficulty.Easy:
rb_easy.Active = rb_easy.HasFocus = true;
break;
case GameDifficulty.Medium:
rb_medium.Active = rb_medium.HasFocus = true;
break;
case GameDifficulty.Master:
rb_master.Active = rb_master.HasFocus = true;
break;
}
// File selection
string def_file;
def_file = System.IO.Path.Combine (
Environment.GetFolderPath (Environment.SpecialFolder.MyDocuments),
// Translators: default file name used when exporting PDF files (keep the pdf extension please)
Catalog.GetString ("games.pdf"));
file = new BrowseFile (hbox_file, def_file, true);
FileFilter[] filters = new FileFilter [2];
filters[0] = new FileFilter ();
filters[0].AddPattern ("*.pdf");
filters[0].Name = Catalog.GetString ("PDF files");
filters[1] = new FileFilter ();
filters[1].AddPattern ("*.*");
filters[1].Name = Catalog.GetString ("All files");
file.Filters = filters;
ListStore layout_store = new ListStore (typeof (string), typeof (int)); // DisplayName, index to array
CellRenderer layout_cell = new CellRendererText ();
layout_combo.Model = layout_store;
layout_combo.PackStart (layout_cell, true);
layout_combo.SetCellDataFunc (layout_cell, ComboBoxCellFunc);
int [] per_side = pdfExporter.PagesPerSide;
for (int i = 0; i < per_side.Length; i++)
layout_store.AppendValues (per_side[i].ToString (), per_side[i]);
// Default value
TreeIter iter;
bool more = layout_store.GetIterFirst (out iter);
while (more)
{
if ((int) layout_store.GetValue (iter, COLUMN_VALUE) == DEF_SIDEVALUE) {
layout_combo.SetActiveIter (iter);
break;
}
more = layout_store.IterNext (ref iter);
}
}
示例9: PreferencesDialog
public PreferencesDialog(PlayerHistory history)
: base("PreferencesDialog.ui", "preferences")
{
this.history = history;
prefspinbutton.Value = Preferences.Get <int> (Preferences.MemQuestionTimeKey);
prefcheckbutton.Active = Preferences.Get <bool> (Preferences.MemQuestionWarnKey);
maxstoredspinbutton.Value = Preferences.Get <int> (Preferences.MaxStoredGamesKey);
minplayedspinbutton.Value = Preferences.Get <int> (Preferences.MinPlayedGamesKey);
colorblindcheckbutton.Active = Preferences.Get <bool> (Preferences.ColorBlindKey);
english_checkbutton.Active = Preferences.Get <bool> (Preferences.EnglishKey);
switch ((GameDifficulty) Preferences.Get <int> (Preferences.DifficultyKey)) {
case GameDifficulty.Easy:
rb_easy.Active = rb_easy.HasFocus = true;
break;
case GameDifficulty.Medium:
rb_medium.Active = rb_medium.HasFocus = true;
break;
case GameDifficulty.Master:
rb_master.Active = rb_master.HasFocus = true;
break;
}
ListStore store = new ListStore (typeof (string), typeof (Theme)); // DisplayName, theme reference
CellRenderer layout_cell = new CellRendererText ();
themes_combobox.Model = store;
themes_combobox.PackStart (layout_cell, true);
themes_combobox.SetCellDataFunc (layout_cell, ComboBoxCellFunc);
foreach (Theme theme in ThemeManager.Themes)
store.AppendValues (Catalog.GetString(theme.LocalizedName), theme);
// Default value
TreeIter iter;
bool more = store.GetIterFirst (out iter);
while (more)
{
Theme theme = (Theme) store.GetValue (iter, COLUMN_VALUE);
if (String.Compare (theme.Name, Preferences.Get <string> (Preferences.ThemeKey), true) == 0)
{
themes_combobox.SetActiveIter (iter);
break;
}
more = store.IterNext (ref iter);
}
}
示例10: NewProjectDialog
public NewProjectDialog()
: base("NewProjectDialog.ui", "newproject")
{
TreeIter iter;
// Comboboxes are added with a HBox to be able to align them
pal_radio = new Gtk.RadioButton (Catalog.GetString ("PAL (Europe)"));
AddRadioButton (videoformat_vbox, pal_radio, 24);
ntsc_radio = new Gtk.RadioButton (pal_radio, Catalog.GetString ("NTSC"));
AddRadioButton (videoformat_vbox, ntsc_radio, 24);
fourbythree_radio = new Gtk.RadioButton (Catalog.GetString ("4:3 (TV)"));
AddRadioButton (aspectratio_vbox, fourbythree_radio, 10);
sixteenbynine_radio = new Gtk.RadioButton (fourbythree_radio, Catalog.GetString ("16:9 (Widescreen)"));
AddRadioButton (aspectratio_vbox, sixteenbynine_radio, 10);
resolution_store = new ListStore (typeof (string), typeof (int)); // DisplayName, index to array
CellRenderer resolution_combocell = new CellRendererText ();
resolution_combobox.Model = resolution_store;
resolution_combobox.PackStart (resolution_combocell, true);
resolution_combobox.SetCellDataFunc (resolution_combocell, Utils.ComboBoxCellFunc);
LoadResolutionIntoCombo ();
// Select default item in the combobox list
bool more = resolution_store.GetIterFirst (out iter);
while (more)
{
int idx = (int) resolution_store.GetValue (iter, COL_INDEX);
if (ResolutionManager.List[idx].Width == ResolutionManager.Default.Width &&
ResolutionManager.List[idx].Height == ResolutionManager.Default.Height) {
resolution_combobox.SetActiveIter (iter);
break;
}
more = resolution_store.IterNext (ref iter);
}
// Translators: This is the default project name for a new project
name.Text = Catalog.GetString ("Project");
output_dir.Text = OutputDirFromName ();
name.Changed += OnChangedProjectName;
output_dir.Changed += OnChangedOutputDir;
changed = false;
slideshows_radio.Toggled += new EventHandler (OnProjectTypeToggled);
ProjectTypeSensitive ();
}
示例11: ProjectPropertiesDialog
public ProjectPropertiesDialog(Project project)
: base("ProjectPropertiesDialog.ui", "projectproperties")
{
Gtk.Box.BoxChild child;
TreeIter iter;
bool more;
this.project = project;
dvd_project = project.Details.Type == ProjectType.DVD;
// General tab
name.Text = project.Details.Name;
output_dir.Text = project.Details.OutputDir;
fontslides_button.FontName = project.Details.SlideshowsFontName;
backslides_button.UseAlpha = foreslides_button.UseAlpha = true;
foreslides_button.Alpha = (ushort) (project.Details.SlideshowsForeColor.A * 65535);
backslides_button.Alpha = (ushort) (project.Details.SlideshowsBackColor.A * 65535);
foreslides_button.Color = Utils.CairoToGdkColor (project.Details.SlideshowsForeColor);
backslides_button.Color = Utils.CairoToGdkColor (project.Details.SlideshowsBackColor);
if (dvd_project == true) // DVD tab
{
notebook.RemovePage (PAGE_THEORA);
fontbuttons_button.FontName = project.Details.ButtonsFontName;
forebuttons_button.UseAlpha = backbuttons_button.UseAlpha = true;
forebuttons_button.Alpha = (ushort) (project.Details.ButtonsForeColor.A * 65535);
backbuttons_button.Alpha = (ushort) (project.Details.ButtonsBackColor.A * 65535);
forebuttons_button.Color = Utils.CairoToGdkColor (project.Details.ButtonsForeColor);
backbuttons_button.Color = Utils.CairoToGdkColor (project.Details.ButtonsBackColor);
pal_radio.Active = project.Details.Format == VideoFormat.PAL;
ntsc_radio.Active = project.Details.Format == VideoFormat.NTSC;
fourbythree_radio.Active = project.Details.AspectRatio == AspectRatio.FourByThree;
sixteenbynine_radio.Active = project.Details.AspectRatio == AspectRatio.SixteenByNine;
thumbnail_store = new ListStore (typeof (string), typeof (int)); // DisplayName, int
CellRenderer thumbnail_cell = new CellRendererText ();
thumbnail_combo.Model = thumbnail_store;
thumbnail_combo.PackStart (thumbnail_cell, true);
thumbnail_combo.SetCellDataFunc (thumbnail_cell, Utils.ComboBoxCellFunc);
LoadThumbnailsIntoCombo ();
// Default thumbnail size
int thumbnail = project.Details.ButtonThumbnailSize;
int current;
more = thumbnail_store.GetIterFirst (out iter);
while (more)
{
current = (int) thumbnail_store.GetValue (iter, COLUMN_ID);
if (thumbnail == current) {
thumbnail_combo.SetActiveIter (iter);
break;
}
more = thumbnail_store.IterNext (ref iter);
}
// Margins
child = (Gtk.Box.BoxChild) (fourbythree_hbox [fourbythree_radio]);
child.Padding = PADDING + OFFSET;
child = (Gtk.Box.BoxChild) (sixteenbynine_hbox [sixteenbynine_radio]);
child.Padding = PADDING + OFFSET;
child = (Gtk.Box.BoxChild) (pal_hbox [pal_radio]);
child.Padding = PADDING + OFFSET;
child = (Gtk.Box.BoxChild) (ntsc_hbox [ntsc_radio]);
child.Padding = PADDING + OFFSET;
} else { // Theora tab
notebook.RemovePage (PAGE_DVD);
resolution_store = new ListStore (typeof (string), typeof (int)); // DisplayName, index to array
CellRenderer resolution_cell = new CellRendererText ();
resolution_combobox.Model = resolution_store;
resolution_combobox.PackStart (resolution_cell, true);
resolution_combobox.SetCellDataFunc (resolution_cell, Utils.ComboBoxCellFunc);
LoadResolutionIntoCombo ();
// Select default item in the combobox list
more = resolution_store.GetIterFirst (out iter);
while (more)
{
int idx = (int) resolution_store.GetValue (iter, COL_INDEX);
if (ResolutionManager.List[idx].Width == project.Details.Width &&
ResolutionManager.List[idx].Height == project.Details.Height) {
resolution_combobox.SetActiveIter (iter);
break;
}
more = resolution_store.IterNext (ref iter);
}
//.........这里部分代码省略.........
示例12: PreferencesDialog
public PreferencesDialog()
: base("PreferencesDialog.ui", "preferences")
{
bool more;
TreeIter iter;
string effect, selected;
transition_store = new ListStore (typeof (string), typeof (string)); // DisplayName, Name
CellRenderer transition_cell = new CellRendererText ();
transition_combo.Model = transition_store;
transition_combo.PackStart (transition_cell, true);
transition_combo.SetCellDataFunc (transition_cell, Utils.ComboBoxCellFunc);
LoadTransitionsIntoCombo ();
thumbnail_store = new ListStore (typeof (string), typeof (int)); // DisplayName, int
CellRenderer thumbnail_cell = new CellRendererText ();
thumbnail_combo.Model = thumbnail_store;
thumbnail_combo.PackStart (thumbnail_cell, true);
thumbnail_combo.SetCellDataFunc (thumbnail_cell, Utils.ComboBoxCellFunc);
LoadThumbnailsIntoCombo ();
textposition_store = new ListStore (typeof (string), typeof (int)); // DisplayName, int
CellRenderer textposition_cell = new CellRendererText ();
textposition_combo.Model = textposition_store;
textposition_combo.PackStart (textposition_cell, true);
textposition_combo.SetCellDataFunc (textposition_cell, Utils.ComboBoxCellFunc);
LoadTextPositionsIntoCombo ();
projectsdir = new BrowseFile (projectsdir_hbox, Mistelix.Preferences.GetStringValue (Preferences.ProjectsDirectoryKey), false);
videosdir = new BrowseFile (videosdir_hbox, Mistelix.Preferences.GetStringValue (Preferences.VideosDirectoryKey), false);
imagesdir = new BrowseFile (imagesdir_hbox, Mistelix.Preferences.GetStringValue (Preferences.ImagesDirectoryKey), false);
audiodir = new BrowseFile (audiodir_hbox, Mistelix.Preferences.GetStringValue (Preferences.AudioDirectoryKey), false);
duration_spin.Value = Mistelix.Preferences.GetIntValue (Preferences.DefaultDurationKey);
// Default Transition effect
selected = Mistelix.Preferences.GetStringValue (Preferences.DefaultTransitionKey);
more = transition_store.GetIterFirst (out iter);
while (more)
{
effect = (string) transition_store.GetValue (iter, (int) ColumnsCombo.Column_Name);
if (effect.Equals (selected)) {
transition_combo.SetActiveIter (iter);
break;
}
more = transition_store.IterNext (ref iter);
}
// Default thumbnail size
int thumbnail = Mistelix.Preferences.GetIntValue (Preferences.ThumbnailSizeKey);
int current;
more = thumbnail_store.GetIterFirst (out iter);
while (more)
{
current = (int) thumbnail_store.GetValue (iter, (int) ColumnsCombo.Column_Name);
if (thumbnail == current) {
thumbnail_combo.SetActiveIter (iter);
break;
}
more = thumbnail_store.IterNext (ref iter);
}
// Default text position box
int position = Mistelix.Preferences.GetIntValue (Preferences.DefaultTextPositionKey);
more = textposition_store.GetIterFirst (out iter);
while (more)
{
current = (int) textposition_store.GetValue (iter, (int) ColumnsCombo.Column_Name);
if (position == current) {
textposition_combo.SetActiveIter (iter);
break;
}
more = textposition_store.IterNext (ref iter);
}
}
示例13: InspectionPanelWidget
public InspectionPanelWidget (string mimeType)
{
this.Build ();
// this.mimeType = mimeType;
treeviewInspections.AppendColumn ("Title", new CellRendererText (), "text", 0);
var comboRenderer = new CellRendererCombo ();
var col = treeviewInspections.AppendColumn ("Severity", comboRenderer);
var comboBoxStore = new ListStore (typeof(string), typeof(QuickTaskSeverity));
comboBoxStore.AppendValues (GetDescription (QuickTaskSeverity.None), QuickTaskSeverity.None);
comboBoxStore.AppendValues (GetDescription (QuickTaskSeverity.Error), QuickTaskSeverity.Error);
comboBoxStore.AppendValues (GetDescription (QuickTaskSeverity.Warning), QuickTaskSeverity.Warning);
comboBoxStore.AppendValues (GetDescription (QuickTaskSeverity.Hint), QuickTaskSeverity.Hint);
comboBoxStore.AppendValues (GetDescription (QuickTaskSeverity.Suggestion), QuickTaskSeverity.Suggestion);
comboRenderer.Model = comboBoxStore;
comboRenderer.Mode = CellRendererMode.Activatable;
comboRenderer.TextColumn = 0;
comboRenderer.Editable = true;
comboRenderer.HasEntry = false;
comboRenderer.Edited += delegate(object o, Gtk.EditedArgs args) {
Gtk.TreeIter iter;
if (!treeStore.GetIterFromString (out iter, args.Path))
return;
Gtk.TreeIter storeIter;
if (!comboBoxStore.GetIterFirst (out storeIter))
return;
Console.WriteLine ("new text:" + args.NewText);
do {
if ((string)comboBoxStore.GetValue (storeIter, 0) == args.NewText) {
treeStore.SetValue (iter, 1, (QuickTaskSeverity)comboBoxStore.GetValue (storeIter, 1));
return;
}
} while (comboBoxStore.IterNext (ref storeIter));
};
col.SetCellDataFunc (comboRenderer, delegate (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter) {
var severity = (QuickTaskSeverity)treeStore.GetValue (iter, 1);
comboRenderer.Text = GetDescription (severity);
});
treeviewInspections.HeadersVisible = false;
treeviewInspections.Model = treeStore;
treeviewInspections.Selection.Changed += HandleSelectionChanged;
foreach (var node in RefactoringService.GetInspectors (mimeType)) {
treeStore.AppendValues (node.Title, node.GetSeverity (), node);
}
}
示例14: UpdateCombo
protected void UpdateCombo()
{
ListStore store = new ListStore (typeof(string));
comboboxConnections.Model = store;
foreach (Connection c in Connections)
store.AppendValues (c.ConnectionName);
SelectedConnection = (String)MachineConfig.ConfigSource.Configs ["Default"].Get ("ConnectionName", String.Empty);
if (SelectedConnection != String.Empty) {
if (Connections.Find (m => m.ConnectionName == SelectedConnection) == null) {
MachineConfig.ConfigSource.Configs ["Default"].Set ("ConnectionName", String.Empty);
MachineConfig.ConfigSource.Save ();
SelectedConnection = String.Empty;
} else {
TreeIter tempIter;
store.GetIterFirst (out tempIter);
do {
if ((string)store.GetValue (tempIter, 0) == SelectedConnection) {
comboboxConnections.SetActiveIter (tempIter);
break;
}
} while (store.IterNext (ref tempIter));
}
} else
comboboxConnections.Active = 0;
if (comboboxConnections.Active == -1)
server = entryUser.Text = entryPassword.Text = "";
}