本文整理汇总了C#中Gtk.VBox.ReorderChild方法的典型用法代码示例。如果您正苦于以下问题:C# VBox.ReorderChild方法的具体用法?C# VBox.ReorderChild怎么用?C# VBox.ReorderChild使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.VBox
的用法示例。
在下文中一共展示了VBox.ReorderChild方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: create_element
private Gtk.HBox create_element(Item item, string search_text, string snippet_text, VoidFunction update)
{
Gtk.HBox element = new Gtk.HBox();
Gtk.VBox lines = new Gtk.VBox();
Gtk.HBox title_date = new Gtk.HBox();
Gtk.EventBox title_wrapper = new Gtk.EventBox();
Gtk.Label title = new Gtk.Label();
string str_title = item.name(40);
string capitalized = search_text.Substring(0, 1).ToUpper() + search_text.Substring(1);
if (str_title.Contains(search_text)) {
int index = str_title.IndexOf(search_text);
str_title = str_title.Substring(0, index) + "<b>" + search_text + "</b>" + str_title.Substring(index+search_text.Length);
} else if (str_title.Contains(capitalized)) {
int index = str_title.IndexOf(capitalized);
str_title = str_title.Substring(0, index) + "<b>" + capitalized + "</b>" + str_title.Substring(index+capitalized.Length);
}
title.Markup = "<big>" + str_title + "</big>";
title.UseUnderline = false;
title.SetAlignment(0, 0); // left aligned
title_wrapper.ButtonPressEvent += delegate(object sender, Gtk.ButtonPressEventArgs args) {
if (args.Event.Button == 1)
item.open();
};
title_wrapper.Add(title);
GtkCommon.set_background_color(title_wrapper, "white");
GtkCommon.show_hand_and_tooltip(title_wrapper, String.Format(Mono.Unix.Catalog.GetString("Open: {0}"), item.long_name));
GtkCommon.create_preview(item, lines, title_wrapper);
title_date.PackStart(title_wrapper, true, true, 0);
Gtk.Alignment date_alignment = new Gtk.Alignment(1, 0, 0, 0);
Gtk.Label date = new Gtk.Label();
date.Markup = "<big>" + String.Format("{0:dd/MM/yy}", item.last_modify) + "</big>";
date_alignment.Add(date);
date_alignment.LeftPadding = 10;
title_date.PackStart(date_alignment, true, true, 0);
lines.PackStart(title_date, true, true, 0);
try {
DocumentItem doc_item = item as DocumentItem;
if (doc_item != null) {
doc_item.on_snippet_callback = delegate (string snippet) {
if (!String.IsNullOrEmpty(snippet)) {
System.Console.WriteLine("got snippet: {0}", snippet);
Gtk.Label snippet_label = new Gtk.Label();
snippet_label.SetAlignment(0, 0); // left aligned
snippet_label.Markup = snippet;
lines.PackStart(snippet_label, true, true, 2);
lines.ReorderChild(snippet_label, 1);
update();
}
};
if (!String.IsNullOrEmpty(doc_item.snippet))
doc_item.on_snippet_callback(doc_item.snippet);
}
} catch (Exception) { // not document item
}
Gtk.HBox label_links = new Gtk.HBox();
Gtk.HBox bubbles = new Gtk.HBox();
foreach (UserLabel label in item.labels)
bubbles.Add(label.dot());
label_links.PackStart(bubbles, false, false, 0);
item.on_labels_callback = delegate() {
foreach (Widget w in bubbles)
w.Destroy();
foreach (UserLabel label in item.labels)
bubbles.Add(label.dot());
element.ShowAll();
};
Gtk.Alignment links_alignment = new Gtk.Alignment(1,1,0,0);
Gtk.HBox links = new Gtk.HBox();
add_link(Mono.Unix.Catalog.GetString("Go to week"), CalendarDriver.View.Week, item.last_modify, links);
add_link(Mono.Unix.Catalog.GetString("Go to month"), CalendarDriver.View.Month, item.last_modify, links);
add_link(Mono.Unix.Catalog.GetString("Go to year"), CalendarDriver.View.Year, item.last_modify, links);
links_alignment.Add(links);
label_links.PackStart(links_alignment, true, true, 0);
//.........这里部分代码省略.........