本文整理汇总了C#中ComboBoxEntry.AppendText方法的典型用法代码示例。如果您正苦于以下问题:C# ComboBoxEntry.AppendText方法的具体用法?C# ComboBoxEntry.AppendText怎么用?C# ComboBoxEntry.AppendText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ComboBoxEntry
的用法示例。
在下文中一共展示了ComboBoxEntry.AppendText方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: StationEditor
public StationEditor (DatabaseTrackInfo track) : base()
{
AccelGroup accel_group = new AccelGroup ();
AddAccelGroup (accel_group);
Title = String.Empty;
SkipTaskbarHint = true;
Modal = true;
this.track = track;
string title = track == null
? Catalog.GetString ("Add new radio station")
: Catalog.GetString ("Edit radio station");
BorderWidth = 6;
HasSeparator = false;
DefaultResponse = ResponseType.Ok;
Modal = true;
VBox.Spacing = 6;
HBox split_box = new HBox ();
split_box.Spacing = 12;
split_box.BorderWidth = 6;
Image image = new Image ();
image.IconSize = (int)IconSize.Dialog;
image.IconName = "radio";
image.Yalign = 0.0f;
image.Show ();
VBox main_box = new VBox ();
main_box.BorderWidth = 5;
main_box.Spacing = 10;
Label header = new Label ();
header.Markup = String.Format ("<big><b>{0}</b></big>", GLib.Markup.EscapeText (title));
header.Xalign = 0.0f;
header.Show ();
Label message = new Label ();
message.Text = Catalog.GetString ("Enter the Genre, Title and URL of the radio station you wish to add. A description is optional.");
message.Xalign = 0.0f;
message.Wrap = true;
message.Show ();
table = new Table (5, 2, false);
table.RowSpacing = 6;
table.ColumnSpacing = 6;
genre_entry = ComboBoxEntry.NewText ();
foreach (string genre in ServiceManager.DbConnection.QueryEnumerable<string> ("SELECT DISTINCT Genre FROM CoreTracks ORDER BY Genre")) {
if (!String.IsNullOrEmpty (genre)) {
genre_entry.AppendText (genre);
}
}
if (track != null && !String.IsNullOrEmpty (track.Genre)) {
genre_entry.Entry.Text = track.Genre;
}
AddRow (Catalog.GetString ("Station Genre:"), genre_entry);
name_entry = AddEntryRow (Catalog.GetString ("Station Name:"));
stream_entry = AddEntryRow (Catalog.GetString ("Stream URL:"));
creator_entry = AddEntryRow (Catalog.GetString ("Station Creator:"));
description_entry = AddEntryRow (Catalog.GetString ("Description:"));
rating_entry = new RatingEntry ();
HBox rating_box = new HBox ();
rating_box.PackStart (rating_entry, false, false, 0);
AddRow (Catalog.GetString ("Rating:"), rating_box);
table.ShowAll ();
main_box.PackStart (header, false, false, 0);
main_box.PackStart (message, false, false, 0);
main_box.PackStart (table, false, false, 0);
main_box.Show ();
split_box.PackStart (image, false, false, 0);
split_box.PackStart (main_box, true, true, 0);
split_box.Show ();
VBox.PackStart (split_box, true, true, 0);
Button cancel_button = new Button (Stock.Cancel);
cancel_button.CanDefault = false;
cancel_button.UseStock = true;
cancel_button.Show ();
AddActionWidget (cancel_button, ResponseType.Close);
cancel_button.AddAccelerator ("activate", accel_group, (uint)Gdk.Key.Escape,
0, Gtk.AccelFlags.Visible);
save_button = new Button (Stock.Save);
save_button.CanDefault = true;
save_button.UseStock = true;
//.........这里部分代码省略.........
示例2: SelIterCmb
private void SelIterCmb(ComboBoxEntry cmb, string itemtoselect)
{
Boolean isSelected = false;
TreeIter cmbiter;
cmb.Model.GetIterFirst (out cmbiter);
do {
GLib.Value value = new GLib.Value();
cmb.Model.GetValue(cmbiter,0,ref value);
if ((value.Val as string).Equals(itemtoselect, StringComparison.CurrentCultureIgnoreCase)){
cmb.SetActiveIter(cmbiter);
isSelected = true;
}
} while (cmb.Model.IterNext(ref cmbiter));
if (!isSelected) {
cmb.AppendText (itemtoselect);
this.SelIterCmb (cmb, itemtoselect);
}
}
示例3: StationDialog
public StationDialog(Stations stations, Station station)
{
glade = new Glade.XML(null, "radio.glade", "StationDialog", "banshee");
glade.Autoconnect(this);
dialog = (Dialog)glade.GetWidget("StationDialog");
Banshee.Base.IconThemeUtils.SetWindowIcon(dialog);
if(station == null) {
is_new = true;
station = new Station();
}
this.stations = stations;
this.station = station;
link_store = new LinkStore(station);
view = new NodeView(link_store);
view.HeadersVisible = true;
CellRendererToggle active_renderer = new CellRendererToggle();
active_renderer.Activatable = true;
active_renderer.Radio = true;
active_renderer.Toggled += OnLinkToggled;
view.AppendColumn(Catalog.GetString("Active"), active_renderer, ActiveDataFunc);
view.AppendColumn(Catalog.GetString("Type"), new CellRendererText(), TypeDataFunc);
view.AppendColumn(Catalog.GetString("Title"), EditTextRenderer(), "text", 1);
view.AppendColumn(Catalog.GetString("URI"), EditTextRenderer(), "text", 2);
view.Show();
(glade["link_view_container"] as ScrolledWindow).Add(view);
group_combo = ComboBoxEntry.NewText();
group_combo.Show();
(glade["group_combo_container"] as Box).PackStart(group_combo, true, true, 0);
title_entry.Text = station.Title == null ? String.Empty : station.Title;
description_entry.Text = station.Description == null ? String.Empty : station.Description;
group_combo.Entry.Text = station.Group == null ? String.Empty : station.Group;
foreach(string group in stations.Groups) {
group_combo.AppendText(group);
}
}