本文整理汇总了C#中Menu.ShowAll方法的典型用法代码示例。如果您正苦于以下问题:C# Menu.ShowAll方法的具体用法?C# Menu.ShowAll怎么用?C# Menu.ShowAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Menu
的用法示例。
在下文中一共展示了Menu.ShowAll方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IconPopupHandler
void IconPopupHandler (object o, PopupMenuArgs args)
{
Menu popup = new Menu ();
MenuItem item = new MenuItem ("About");
item.Activated += new EventHandler (OnMenuAbout);
popup.Append (item);
item = new MenuItem ("Quit");
item.Activated += new EventHandler (OnCloseButtonClicked);
popup.Append (item);
popup.ShowAll ();
statusIcon.PresentMenu (popup, 3, Gtk.Global.CurrentEventTime);
// popup.Popup ();
}
示例2: PopulateCategoryOptionMenu
private void PopulateCategoryOptionMenu ()
{
categories = new ArrayList ();
categories.Add (tag_store.RootCategory);
PopulateCategories (categories, tag_store.RootCategory);
Menu menu = new Menu ();
foreach (Category category in categories)
menu.Append (TagMenu.TagMenuItem.IndentedItem (category));
category_option_menu.Sensitive = true;
menu.ShowAll ();
category_option_menu.Menu = menu;
}
示例3: OnConfigListTreeviewButtonPressEvent
protected void OnConfigListTreeviewButtonPressEvent(object o, ButtonPressEventArgs args)
{
if (args.Event.Button == 3)
{
Menu m = new Menu();
MenuItem ViewInfo = new MenuItem("View Config Pack Information");
ViewInfo.ButtonPressEvent += (sender, argss) =>
{
TreeSelection selection = (o as TreeView).Selection;
TreeModel model;
TreeIter iter;
if(selection.GetSelected(out model, out iter))
{
var match = ConfigList.FirstOrDefault(x => x.FriendlyName.Equals(model.GetValue(iter, 0).ToString()));
ViewPackInfoWindow vpi = new ViewPackInfoWindow(ReadPackInformation(match));
vpi.Show();
}
};
m.Add(ViewInfo);
m.ShowAll();
m.Popup();
}
}
示例4: ShowPopupMenu
private void ShowPopupMenu()
{
Menu popupMenu = new Menu();
MenuItem editPathItem = new MenuItem("Edit Path");
editPathItem.Activated += OnEditPath;
editPathItem.Sensitive = currentObject is IPathObject;
popupMenu.Append(editPathItem);
MenuItem deletePathItem = new MenuItem("Delete Path");
deletePathItem.Activated += OnDeletePath;
deletePathItem.Sensitive = currentObject is IPathObject;
popupMenu.Append(deletePathItem);
MenuItem deleteItem = new ImageMenuItem(Stock.Delete, null);
deleteItem.Activated += OnDelete;
popupMenu.Append(deleteItem);
popupMenu.ShowAll();
popupMenu.Popup();
}
示例5: OnTogglebuttonToggled
protected void OnTogglebuttonToggled(object sender, System.EventArgs e)
{
if (addNewOperation_togglebutton.Active)
{
Menu menu = new Menu();
int w, h;
menu.GetSizeRequest(out w, out h);
int menu_width = left_vbox.Allocation.Width;
menu.SetSizeRequest(menu_width, h);
Dictionary<MenuItem, Type> stage_operation_types = new Dictionary<MenuItem, Type>();
for (int i = 0; i < mStageOperationTypes.Length; i++)
{
string name = StageOperationDescriptionAttribute.GetName(mStageOperationTypes[i]);
if (name == null) name = mStageOperationTypes[i].Name;
string description = StageOperationDescriptionAttribute.GetDescription(mStageOperationTypes[i]);
MenuItem item = new MenuItem();
VBox item_vbox = new VBox();
item_vbox.BorderWidth = 4;
item_vbox.Show();
Label lbl_name = new Label();
lbl_name.Text = name;
lbl_name.Justify = Justification.Left;
lbl_name.Xalign = 0;
// Setting the name font
double name_size_k = 1.1;
Pango.FontDescription name_fd = FontHelpers.ScaleFontSize(lbl_name, name_size_k);
name_fd.Weight = Pango.Weight.Bold;
lbl_name.ModifyFont(name_fd);
item_vbox.Add(lbl_name);
lbl_name.Show();
if (description != null && description != "")
{
Label lbl_desc = new Label(description);
lbl_desc.LineWrapMode = Pango.WrapMode.Word;
lbl_desc.LineWrap = true;
lbl_desc.Wrap = true;
// Setting the description font
double desc_size_k = 0.9;
Pango.FontDescription desc_fd = FontHelpers.ScaleFontSize(lbl_desc, desc_size_k);
lbl_desc.ModifyFont(desc_fd);
item_vbox.Add(lbl_desc);
lbl_desc.Show();
item_vbox.SizeAllocated += delegate(object o, SizeAllocatedArgs args) {
lbl_desc.WidthRequest = args.Allocation.Width - 10;
};
}
item.Child = item_vbox;
stage_operation_types.Add(item, mStageOperationTypes[i]);
item.Activated += delegate(object s, EventArgs ea) {
mStage.CreateAndAddNewItem(stage_operation_types[(MenuItem)s]).Active = true;
GtkScrolledWindow.HscrollbarPolicy = PolicyType.Never;
GtkScrolledWindow.Vadjustment.Value = GtkScrolledWindow.Vadjustment.Upper;
ArrangeVBoxes();
};
menu.Append(item);
item_vbox.CheckResize();
//lbl_desc.WidthRequest = ww;
}
menu.Deactivated += delegate {
addNewOperation_togglebutton.Active = false;
};
menu.ShowAll();
menu.Popup(null, null, delegate (Menu m, out int x, out int y, out bool push_in) {
int x1, y1, x0, y0;
GdkWindow.GetOrigin(out x0, out y0);
left_vbox.TranslateCoordinates(this, 0, 0, out x1, out y1);
x = x0 + x1;
y = y0 + y1;
push_in = false;
}, 0, 0);
}
}
示例6: InitMenu
private void InitMenu()
{
popupMenu = new Menu();
MenuItem item = new MenuItem ( Catalog.GetString ("_Subscriptions"));
item.Activated += new EventHandler (this.OnSubscriptions);
popupMenu.Add (item);
MenuItem item2 = new MenuItem ( Catalog.GetString ("Show _Podcasts"));
item2.Activated += new EventHandler (this.OnShowPodcasts);
popupMenu.Add (item2);
#if USING_IPOD
MenuItem item3 = new MenuItem ( Catalog.GetString ("_Update iPod"));
item3.Activated += new EventHandler (this.OnUpdateIPod);
popupMenu.Add (item3);
#endif
ImageMenuItem aboutItem = new ImageMenuItem (Catalog.GetString ("_About"));
aboutItem.Image = new Image (Gnome.Stock.About, IconSize.Menu);
popupMenu.Add (aboutItem);
ImageMenuItem menuPopup1 = new ImageMenuItem (Catalog.GetString ("_Quit"));
Image appimg = new Image (Gtk.Stock.Quit, IconSize.Menu );
menuPopup1.Image = appimg;
popupMenu.Add(menuPopup1);
menuPopup1.Activated += OnQuit;
aboutItem.Activated += OnAbout;
popupMenu.ShowAll();
}
示例7: ShowPopupMenu
private void ShowPopupMenu()
{
Menu popupMenu = new Menu();
MenuItem editPathItem = new MenuItem("Edit Path");
editPathItem.Activated += OnEditPath;
popupMenu.Append(editPathItem);
MenuItem deletePathItem = new MenuItem("Delete Path");
deletePathItem.Activated += OnDeletePath;
popupMenu.Append(deletePathItem);
MenuItem CheckIDsItem = new MenuItem("Check tile IDs");
CheckIDsItem.Activated += OnCheckIDs;
popupMenu.Append(CheckIDsItem);
MenuItem deleteItem = new ImageMenuItem(Stock.Delete, null);
deleteItem.Activated += OnDelete;
popupMenu.Append(deleteItem);
popupMenu.ShowAll();
popupMenu.Popup();
}
示例8: DragDataToCreateFileMenu
/** DESCTRUCTIVE, BLOCKING */
void DragDataToCreateFileMenu(string target, byte[] data)
{
Menu menu = new Menu();
MenuItem newfile = new MenuItem("Create file from data");
newfile.Activated += delegate {
Helpers.TextPrompt ("Create file", "Filename for data",
target + Helpers.DirSepS + "new_file", "Create",
target.Length+1, target.Length+1, -1,
delegate (string filename) {
Helpers.NewFileWith(filename, data);
});
};
menu.Append (newfile);
menu.ShowAll ();
menu.Popup ();
}
示例9: InitContextMenu
private Menu InitContextMenu(IChartDrawable primitive)
{
string displayName = (primitive as DSView).DisplayName;
var menu = new Menu();
ImageMenuItem mi;
mi = new ImageMenuItem(string.Format("Delete {0}", displayName));
mi.Activated += OnDeleteMenuItemClick;
menu.Append(mi);
menu.Append(new SeparatorMenuItem());
mi = new ImageMenuItem(string.Format("Properties {0}", displayName));
mi.Activated += OnPropertiesMenuItemClick;
menu.Append(mi);
menu.ShowAll();
return menu;
}
示例10: treeviewPersonsContextMenu
private void treeviewPersonsContextMenu(Person myPerson)
{
Menu myMenu = new Menu ();
Gtk.MenuItem myItem;
myItem = new MenuItem ( Catalog.GetString("Edit") + " " + myPerson.Name);
myItem.Activated += on_edit_current_person_clicked;
myMenu.Attach( myItem, 0, 1, 0, 1 );
myItem = new MenuItem ( Catalog.GetString("Show all tests of") + " " + myPerson.Name);
myItem.Activated += on_show_all_person_events_activate;
myMenu.Attach( myItem, 0, 1, 1, 2 );
Gtk.SeparatorMenuItem mySep = new SeparatorMenuItem();
myMenu.Attach( mySep, 0, 1, 2, 3 );
myItem = new MenuItem ( string.Format(Catalog.GetString("Delete {0} from this session"),myPerson.Name));
myItem.Activated += on_delete_current_person_from_session_clicked;
myMenu.Attach( myItem, 0, 1, 3, 4 );
myMenu.Popup();
myMenu.ShowAll();
}
示例11: PopupMenu
private void PopupMenu(int button)
{
if(selectedObjects.Count == 0)
return;
if(activeObject is ControlPoint)
return;
bool groupCloneable = true; //foreach cycle to get required statistics
foreach (IObject selectedObject in selectedObjects) {
groupCloneable &= selectedObject is ICloneable;
}
Menu popupMenu = new Menu();
MenuItem cloneItem = new MenuItem("Clone");
cloneItem.Activated += OnClone;
cloneItem.Sensitive = groupCloneable;
popupMenu.Append(cloneItem);
if(selectedObjects.Count == 1 && selectedObjects[0] is IPathObject) {
IPathObject pathObject = (IPathObject) selectedObjects[0];
MenuItem editPathItem = new MenuItem("Edit Path");
editPathItem.Activated += OnEditPath;
popupMenu.Append(editPathItem);
if (pathObject.PathRemovable) {
MenuItem deletePathItem = new MenuItem("Delete Path");
deletePathItem.Sensitive = pathObject.Path != null;
deletePathItem.Activated += OnDeletePath;
popupMenu.Append(deletePathItem);
}
}
MenuItem deleteItem = new ImageMenuItem(Stock.Delete, null);
deleteItem.Activated += OnDelete;
popupMenu.Append(deleteItem);
popupMenu.ShowAll();
popupMenu.Popup();
}
示例12: PopupMenu
private void PopupMenu(int button)
{
if(! (activeObject is IGameObject))
return;
Menu popupMenu = new Menu();
MenuItem cloneItem = new MenuItem("Clone");
cloneItem.Activated += OnClone;
cloneItem.Sensitive = activeObject is ICloneable;
popupMenu.Append(cloneItem);
if(activeObject is IPathObject) {
MenuItem editPathItem = new MenuItem("Edit Path");
editPathItem.Activated += OnEditPath;
popupMenu.Append(editPathItem);
}
MenuItem deleteItem = new ImageMenuItem(Stock.Delete, null);
deleteItem.Activated += OnDelete;
popupMenu.Append(deleteItem);
popupMenu.ShowAll();
popupMenu.Popup();
}
示例13: ShowContextMenu
private void ShowContextMenu()
{
Gtk.Menu contextMenu = new Menu();
//AddContextMenuButton(contextMenu,"run",Lng.Translate("Run"));
AddRunContextMenu(contextMenu);
AddSortContextMenu(contextMenu);
contextMenu.ShowAll();
contextMenu.Popup();
contextMenu.Dispose();
}
示例14: DragURIMenu
/** ASYNC */
void DragURIMenu(string[] sources, string target)
{
Menu menu = new Menu();
MenuItem move = new MenuItem("_Move");
MenuItem copy = new MenuItem("_Copy");
move.Activated += delegate { moveUris (sources, target); };
copy.Activated += delegate { copyUris (sources, target); };
menu.Append (move);
menu.Append (copy);
menu.ShowAll ();
menu.Popup ();
}
示例15: DragDataToFileMenu
/** DESCTRUCTIVE, BLOCKING */
void DragDataToFileMenu(string targetFile, byte[] data)
{
Menu menu = new Menu();
MenuItem newfile = new MenuItem("Create file from data");
string target = Helpers.Dirname(targetFile);
newfile.Activated += delegate {
Helpers.TextPrompt ("Create file", "Filename for data",
target + Helpers.DirSepS + "new_file", "Create",
target.Length+1, target.Length+1, -1,
delegate (string filename) {
Helpers.NewFileWith(filename, data);
});
};
MenuItem replace = new MenuItem(String.Format("_Replace contents of {0}", Helpers.Basename(targetFile)));
replace.Activated += delegate { Helpers.ReplaceFileWith(targetFile, data); };
MenuItem append = new MenuItem(String.Format("_Append to {0}", Helpers.Basename(targetFile)));
append.Activated += delegate { Helpers.AppendToFile(targetFile, data); };
menu.Append (newfile);
menu.Append (new SeparatorMenuItem ());
menu.Append (replace);
menu.Append (append);
menu.ShowAll ();
menu.Popup ();
}