本文整理汇总了C#中TreeModel.IterParent方法的典型用法代码示例。如果您正苦于以下问题:C# TreeModel.IterParent方法的具体用法?C# TreeModel.IterParent怎么用?C# TreeModel.IterParent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TreeModel
的用法示例。
在下文中一共展示了TreeModel.IterParent方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PixbufCellDataFunc
void PixbufCellDataFunc (TreeViewColumn col, CellRenderer cell, TreeModel model, TreeIter iter)
{
TreeIter parent;
bool toplevel = !model.IterParent (out parent, iter);
var crp = (CellRendererPixbuf) cell;
crp.Visible = !toplevel;
if (toplevel) {
return;
}
var section = (OptionsDialogSection) model.GetValue (iter, 0);
//HACK: The mimetype panels can't register a single fake stock ID for all the possible image size.
// Instead, give this some awareness of the mime system.
var mimeSection = section as MonoDevelop.Ide.Projects.OptionPanels.MimetypeOptionsDialogSection;
if (mimeSection != null && !string.IsNullOrEmpty (mimeSection.MimeType)) {
var pix = DesktopService.GetPixbufForType (mimeSection.MimeType, treeIconSize);
if (pix != null) {
crp.Pixbuf = pix;
} else {
crp.Pixbuf = ImageService.GetPixbuf (emptyCategoryIcon, treeIconSize);
}
} else {
string icon = section.Icon.IsNull? emptyCategoryIcon : section.Icon.ToString ();
crp.Pixbuf = ImageService.GetPixbuf (icon, treeIconSize);
}
}
示例2: TextCellDataFunc
void TextCellDataFunc (TreeViewColumn col, CellRenderer cell, TreeModel model, TreeIter iter)
{
TreeIter parent;
bool toplevel = !model.IterParent (out parent, iter);
var crt = (CellRendererText) cell;
var section = (OptionsDialogSection) model.GetValue (iter, 0);
if (toplevel) {
crt.Markup = "<b>" + GLib.Markup.EscapeText (section.Label) + "</b>";
} else {
crt.Text = section.Label;
}
}
示例3: PixbufDataFunc
void PixbufDataFunc(TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter)
{
CellRendererPixbuf renderer = cell as CellRendererPixbuf;
string stock;
var uri = folder_tree_model.GetUriByIter (iter);
if (uri == null)
return;
File file = FileFactory.NewForUri (uri);
try {
FileInfo info =
file.QueryInfo ("standard::icon", FileQueryInfoFlags.None, null);
ThemedIcon themed_icon = info.Icon as ThemedIcon;
if (themed_icon != null && themed_icon.Names.Length > 0)
stock = themed_icon.Names[0];
else
stock = "gtk-directory";
} catch (Exception) {
stock = "gtk-directory";
}
TreeIter tmp;
if (tree_model.IterParent (out tmp, iter)) {
renderer.IconName = stock;
renderer.CellBackground = null;
} else {
renderer.IconName = stock;
renderer.CellBackgroundGdk = Style.Background (StateType.Selected);
}
}
示例4: FolderDataFunc
void FolderDataFunc(TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter)
{
CellRendererTextProgress renderer = cell as CellRendererTextProgress;
int progress_value = 0;
int count = (tree_model as FolderTreeModel).Count;
if (count != 0)
progress_value = (int) ((100.0 * folder_tree_model.GetPhotoCountByIter (iter)) / count);
renderer.Value = progress_value;
string text = folder_tree_model.GetFolderNameByIter (iter);
TreeIter tmp;
if (tree_model.IterParent (out tmp, iter)) {
renderer.UseMarkup = false;
renderer.Text = text;
renderer.CellBackground = null;
} else {
renderer.UseMarkup = true;
/* since import do not use GIO at the moment, no other prefix than file:/// is
* possible.
*/
if (text == Uri.UriSchemeFile)
renderer.Text = String.Format ("<b>{0}</b>", Catalog.GetString ("Filesystem"));
else
renderer.Text = String.Format ("<b>{0}</b>", text);
renderer.CellBackgroundGdk = Style.Background (StateType.Selected);
}
}
示例5: FilterEmptySections
// Widget: tvBgList
// Don't show sections that are empty
private bool FilterEmptySections(TreeModel model, TreeIter iter)
{
TreeIter parent;
string key = (string) model.GetValue(iter, 0);
// Always draw all wallpapers
if (key != null)
return true;
if (model.IterParent(out parent, iter)) {
if (model.IterNChildren(parent) >= 2)
return false;
}
return true;
}
示例6: OnGameSelected
/// <summary>
/// Called when a game is selected in the libaray
/// </summary>
/// <param name="game">Game.</param>
protected void OnGameSelected(Game game, TreeModel model, TreeIter child)
{
activeEmulator = null;
activeGame = game;
TreeIter iter;
if (model.IterParent (out iter, child))
activeEmulator = (Emulator)model.GetValue (iter, 0);
GameView.SetModels (activeGame, activeEmulator);
SetActionSensitivity ();
}
示例7: ShowItemMarketDetails
void ShowItemMarketDetails(ECM.EveItem item, TreeModel model, TreeIter iter)
{
ntbMarketDetails.CurrentPage = 0;
foreach (Widget w in hbxItemPath.Children)
{
hbxItemPath.Remove(w);
w.Destroy();
}
// First work out the tree path
TreeIter parentIter;
string path = "";
long ID = 0;
while (model.IterParent(out parentIter, iter))
{
iter = parentIter;
path = model.GetValue(parentIter, 1).ToString();
ID = Convert.ToInt64(model.GetValue(iter, 2));
ECM.EveMarketGroup g = ECM.ItemDatabase.MarketGroups[ID];
Button btn = new Button(new Label(path));
btn.Relief = ReliefStyle.None;
btn.Clicked += delegate(object sender, EventArgs e)
{
SelectItemInMarket(g);
};
hbxItemPath.PackEnd(new Label("\\"));
hbxItemPath.PackEnd(btn);
}
hbxItemPath.ShowAll();
lblItemNameDetails.Markup = string.Format("<b>{0}</b>", item.Name);
imgItemIconDetails.PixbufAnimation = new Gdk.PixbufAnimation(ECM.Core.LoadingSpinnerGIF);
BackgroundWorker fetchImage = new BackgroundWorker();
fetchImage.DoWork += delegate(object sender, DoWorkEventArgs e)
{
imgItemIconDetails.Pixbuf = ECM.API.ImageApi.GetItemImageGTK(item.ID, ECM.API.ImageApi.ImageRequestSize.Size64x64);
};
btnShowRender.Name = item.ID.ToString();
btnShowRender.Sensitive = true;
fetchImage.RunWorkerAsync();
//lblItemTreeDetails.Visible = true;
imgItemIconDetails.Visible = true;
btnItemInfo.Visible = true;
vbxBuySell.Visible = true;
frmItemImage.ShadowType = ShadowType.EtchedOut;
}