public MainUIManager(ViewGui viewGui) { this.viewGui = viewGui; actions = new ActionGroup ("Actions"); ActionEntry actionEntryQuit; actionEntryQuit = new ActionEntry("Quitter", Gtk.Stock.Quit, null, "<control>Q", "Quitter l'environnement Sofia", new EventHandler (Quit)); ActionEntry[] entries = new ActionEntry [] { new ActionEntry ("Fichier", null, "_Fichier", null, null, null), new ActionEntry ("Editer", null, "Editio_n", null, null, null), new ActionEntry ("Rechercher", null, "Recher_cher", null, null, null), new ActionEntry ("Aide", null, "_Aide", null, null, null), actionEntryQuit, new ActionEntry ("Préférences", Gtk.Stock.Preferences, null, null, "Préférences", new EventHandler (Preferences)), new ActionEntry ("RubriquesAide", Gtk.Stock.Help, "Rubriques d'_aide", "F1", "Aide - Rubriques d'aide", new EventHandler (Help)), new ActionEntry ("APropos", Gtk.Stock.About, null, null, "A propos de l'environnement Sofia", new EventHandler (About)) }; actions.Add (entries); InsertActionGroup(actions, 0); this.viewGui.AddAccelGroup(AccelGroup); uint id = 0; try { id = AddUiFromFile("MainUIDef.xml"); } catch { RemoveUi(id); } }
public Navbar (Gtk.IconSize size) { address = new Entry ("address"); // FIXME: this doesnt't seem to work yet // address.Completion = new EntryCompletion (); address.WidthChars = 50; address.Activated += new EventHandler (OnGoUrl); ActionEntry[] actions = new ActionEntry[] { new ActionEntry ("back", Gtk.Stock.GoBack, null, null, GettextCatalog.GetString ("Go back"), new EventHandler (OnBackClicked)), new ActionEntry ("forward", Gtk.Stock.GoForward, null, null, GettextCatalog.GetString ("Go forward"), new EventHandler (OnForwardClicked)), new ActionEntry ("stop", Gtk.Stock.Stop, null, null, GettextCatalog.GetString ("Stop loading"), new EventHandler (OnStopClicked)), new ActionEntry ("reload", Gtk.Stock.Refresh, null, null, GettextCatalog.GetString ("Address"), new EventHandler (OnReloadClicked)), new ActionEntry ("go", Gtk.Stock.Ok, null, null, GettextCatalog.GetString ("Load address"), new EventHandler (OnGoUrl)) }; ActionGroup ag = new ActionGroup ("navbarGroup"); ag.Add (actions); UIManager uim = new UIManager (); uim.InsertActionGroup (ag, 0); uim.AddWidget += new AddWidgetHandler (OnAddWidget); uim.AddUiFromString (uiInfo); ToolItem item = new ToolItem (); item.Add (address); Toolbar tb = uim.GetWidget ("/ui/toolbar") as Toolbar; tb.IconSize = size; tb.Add (item); this.ShowAll (); }
public void ShowWindow () { Application.Init (); gxml = new Glade.XML ("contactviewer.glade", "MainWindow"); gxml.Autoconnect (this); ActionEntry[] entries = new ActionEntry [] { new ActionEntry ("FileMenuAction", null, "_File", null, null, null), new ActionEntry ("OpenAction", Gtk.Stock.Open, "_Open", "<control>O", Catalog.GetString ("Open..."), new EventHandler (OnOpenDatabase)), new ActionEntry ("QuitAction", Gtk.Stock.Quit, "_Quit", "<control>Q", Catalog.GetString ("Quit"), new EventHandler (OnQuit)), new ActionEntry ("HelpMenuAction", null, "_Help", null, null, null), new ActionEntry ("AboutAction", Gnome.Stock.About, "_About", null, Catalog.GetString ("About"), new EventHandler (OnAbout)) }; ActionGroup grp = new ActionGroup ("MainGroup"); grp.Add (entries); ui_manager = new UIManager (); ui_manager.InsertActionGroup(grp, 0); ui_manager.AddUiFromResource ("menu.xml"); MenubarHolder.Add (ui_manager.GetWidget ("/MainMenu")); // Fix the TreeView that will contain all contacts contact_store = new ListStore (typeof (string), typeof (string)); ContactList.Model = contact_store; ContactList.RulesHint = true; ContactList.AppendColumn (Catalog.GetString ("Contacts"), new CellRendererText (), "text", 1); ContactList.ButtonReleaseEvent += OnContactSelected; // This ListStore will let the user choose what to see in the contact list contact_show_type_store = new ListStore (typeof (string), typeof (string)); contact_show_type_store.AppendValues ("DisplayName", Catalog.GetString ("Display name")); contact_show_type_store.AppendValues ("PrimaryEmail", Catalog.GetString ("Primary E-mail")); contact_show_type_store.AppendValues ("SecondEmail", Catalog.GetString ("Secondary E-mail")); contact_show_type_store.AppendValues ("NickName", Catalog.GetString ("Nickname")); CellRendererText cell = new CellRendererText (); ListIdentifier.PackStart (cell, false); ListIdentifier.AddAttribute (cell, "text", 1); ListIdentifier.Model = contact_show_type_store; ListIdentifier.Active = 0; ListIdentifier.Changed += OnContactListTypeChanged; MainWindow.Icon = Beagle.Images.GetPixbuf ("contact-icon.png"); MainWindow.DeleteEvent += OnDeleteEvent; LoadDatabase (); Application.Run (); }
public void Add (ActionEntry[] entries) { foreach (ActionEntry entry in entries) { Action action = new Action (entry.name, entry.label, entry.tooltip, entry.stock_id); if (entry.activated != null) action.Activated += entry.activated; if (entry.accelerator == null) Add (action); else Add (action, entry.accelerator); } }
// ============================================ // PRIVATE Methods // ============================================ private void InitializeMenu() { ActionEntry[] entries = new ActionEntry[] { new ActionEntry("DownloadManager", "Download", "Download Manager", null, "Open Download Manager", new EventHandler(OnDlManager)) }; string ui = "<ui>" + " <menubar name='MenuBar'>" + " <menu action='ToolMenu'>" + " <menuitem action='DownloadManager' />" + " </menu>" + " </menubar>" + "</ui>"; nyFolder.Window.Menu.AddMenus(ui, entries); }
public UIManager (SearchWindow search) { this.search = search; this.actions = new ActionGroup ("Actions"); ActionEntry quit_action_entry; if (search.IconEnabled) { quit_action_entry = new ActionEntry ("Quit", Gtk.Stock.Close, null, "<control>Q", Catalog.GetString ("Close Desktop Search"), Quit); } else { quit_action_entry = new ActionEntry ("Quit", Gtk.Stock.Quit, null, "<control>Q", Catalog.GetString ("Exit Desktop Search"), Quit); } Gtk.ActionEntry[] entries = new ActionEntry[] { new ActionEntry ("Search", null, Catalog.GetString ("_Search"), null, null, null), new ActionEntry ("Domain", null, Catalog.GetString ("Search _Domains"), null, null, null), new ActionEntry ("Actions", null, Catalog.GetString ("_Actions"), null, null, null), new ActionEntry ("View", null, Catalog.GetString ("_View"), null, null, null), new ActionEntry ("Service", null, Catalog.GetString ("Service _Options"), null, null, null), new ActionEntry ("Help", null, Catalog.GetString ("_Help"), null, null, null), quit_action_entry, new ActionEntry ("Preferences", Gtk.Stock.Preferences, null, null, Catalog.GetString ("Exit Desktop Search"), Preferences), new ActionEntry ("StartService", Gtk.Stock.Execute, Catalog.GetString ("Start service"), null, null, StartService), new ActionEntry ("StopService", Gtk.Stock.Stop, Catalog.GetString ("Stop service"), null, null, StopService), new ActionEntry ("IndexInfo", Gtk.Stock.Index, Catalog.GetString ("Index information"), null, null, IndexInfo), new ActionEntry ("Contents", Gtk.Stock.Help, Catalog.GetString ("_Contents"), "F1", Catalog.GetString ("Help - Table of Contents"), Help), new ActionEntry ("About", Gnome.Stock.About, null, null, Catalog.GetString ("About Desktop Search"), About), new ActionEntry ("QuickTips", null, Catalog.GetString ("Quick Tips"), null, null, QuickTips), new ActionEntry ("FocusSearchEntry", null, "", "<control>K", null, OnFocusSearchEntry), new ActionEntry ("FocusSearchEntry2", null, "", "<control>L", null, OnFocusSearchEntry), new ActionEntry ("HideWindow", null, "", "Escape", null, OnHideWindow), new ActionEntry ("HideWindow2", null, "", "<control>W", null, OnHideWindow) }; actions.Add (entries); sort_entries = new RadioActionEntry[] { new RadioActionEntry ("SortModified", null, Catalog.GetString ("Sort by Date _Modified"), null, Catalog.GetString ("Sort the most-recently-modified matches first"), (int)SortType.Modified), new RadioActionEntry ("SortName", null, Catalog.GetString ("Sort by _Name"), null, Catalog.GetString ("Sort matches by name"), (int)SortType.Name), new RadioActionEntry ("SortRelevance", null, Catalog.GetString ("Sort by _Relevance"), null, Catalog.GetString ("Sort the best matches first"), (int)SortType.Relevance), }; actions.Add (sort_entries, (int)SortType.Modified, OnSortChanged); domain_entries = new ToggleActionEntry [] { new ToggleActionEntry ("Local", null, Catalog.GetString ("_Local"), null, Catalog.GetString ("Search in personal data in this computer"), /* personal files, emails */ OnDomainChanged, true), new ToggleActionEntry ("System", null, Catalog.GetString ("_System"), null, Catalog.GetString ("Search in system data on this computer"), /* system manpages, applications */ OnDomainChanged, true), new ToggleActionEntry ("Global", null, Catalog.GetString ("_Global"), null, Catalog.GetString ("Search in internet services"), /* gmail and other web services */ OnDomainChanged, false), new ToggleActionEntry ("Neighborhood", null, Catalog.GetString ("_Neighborhood"), null, Catalog.GetString ("Search on computers near me"), /* remote beagle services */ OnDomainChanged, false) }; actions.Add (domain_entries); view_entries = new ToggleActionEntry[] { new ToggleActionEntry ("ShowDetails", null, Catalog.GetString ("Show Details"), null, null, OnToggleDetails, true) }; actions.Add (view_entries); InsertActionGroup (actions, 0); search.AddAccelGroup (AccelGroup); AddUiFromString (ui_def); }
/// <summary> /// Sets up the UI elements using the UI manager and connecting /// the events. /// </summary> private UIManager SetupUI() { // Set up our action entries ActionEntry[] entries = new ActionEntry[] { new ActionEntry("FileMenu", null, "_File", null, null, null), new ActionEntry("Reload", null, "Re_load", "<control>R", "Reload", new EventHandler(OnReload)), new ActionEntry("ZoomIn", null, "Zoom _In", "<control>I", "Zoom In", new EventHandler(OnZoomIn)), new ActionEntry("ZoomOut", null, "Zoom _Out", "<control>O", "Zoom Out", new EventHandler(OnZoomOut)), new ActionEntry("ZoomReset", null, "Zoom _Reset", "<control>0", "Zoom Reset", new EventHandler(OnZoomReset)), new ActionEntry("Quit", Stock.Quit, "_Quit", "<control>Q", "Quit", new EventHandler(OnDelete)), }; ActionGroup actions = new ActionGroup("group"); actions.Add(entries); // Create the UI to populate data uim = new UIManager(); uim.InsertActionGroup(actions, 0); AddAccelGroup(uim.AccelGroup); uim.AddUiFromResource("ui.xml"); // Return the results return uim; }
private ActionEntry[] GetActionEntries() { ActionEntry[] entries = new ActionEntry[] { new ActionEntry("FileMenu", null, "_File", null, null, null), new ActionEntry("ViewMenu", null, "_View", null, null, null), new ActionEntry("GoMenu", null, "_Go", null, null, null), new ActionEntry("ToolMenu", null, "_Tool", null, null, null), new ActionEntry("NetworkMenu", null, "_Network", null, null, null), new ActionEntry("HelpMenu", null, "_Help", null, null, null), // File Menu new ActionEntry("ProxySettings", "Proxy", "Proxy Settings", null, "Setup Proxy", new EventHandler(ActionActivated)), new ActionEntry("Logout", "Logout", "Logout", null, "Logout", new EventHandler(ActionActivated)), new ActionEntry("Quit", Gtk.Stock.Quit, "Quit", "<control>Q", "Quit NyFolder", new EventHandler(ActionActivated)), // View Menu new ActionEntry("Refresh", Gtk.Stock.Refresh, "Refresh", null, null, new EventHandler(ActionActivated)), // Go Menu new ActionEntry("GoUp", Gtk.Stock.GoUp, "UP", null, "Open The Parent Folder", new EventHandler(ActionActivated)), new ActionEntry("GoHome", Gtk.Stock.Home, "Home", null, "Open The Root Directory", new EventHandler(ActionActivated)), new ActionEntry("GoMyFolder", "StockMyFolder", "MyFolder", null, "My Shared Folder", new EventHandler(ActionActivated)), new ActionEntry("GoNetwork", "StockNetwork", "Network", null, "View Network", new EventHandler(ActionActivated)), // Network new ActionEntry("SetPort", Gtk.Stock.Preferences, "Set P2P Port", null, "Set P2P Port", new EventHandler(ActionActivated)), new ActionEntry("AddPeer", Gtk.Stock.Network, "Add Peer", null, "Add New Peer", new EventHandler(ActionActivated)), new ActionEntry("RmPeer", Gtk.Stock.Delete, "Remove Peer", null, "Remove Peer", new EventHandler(ActionActivated)), new ActionEntry("DownloadManager", "Download", "Download Manager", null, "Download Manager", new EventHandler(ActionActivated)), // Help Menu new ActionEntry("About", Gtk.Stock.About, "About", null, "About NyFolder", new EventHandler(ActionActivated)), }; return(entries); }
void AddActions () { ActionEntry[] actions = new ActionEntry[] { new ActionEntry ("FileMenu", null, "_File", null, null, null), new ActionEntry ("PreferencesMenu", null, "_Preferences", null, null, null), new ActionEntry ("ColorMenu", null, "_Color", null, null, null), new ActionEntry ("ShapeMenu", null, "_Shape", null, null, null), new ActionEntry ("HelpMenu", null, "_Help", null, null, null), new ActionEntry ("New", Stock.New, "_New", "<control>N", "Create a new file", new EventHandler (ActionActivated)), new ActionEntry ("Open", Stock.Open, "_Open", "<control>O", "Open a file", new EventHandler (ActionActivated)), new ActionEntry ("Save", Stock.Save, "_Save", "<control>S", "Save current file", new EventHandler (ActionActivated)), new ActionEntry ("SaveAs", Stock.SaveAs, "Save _As", null, "Save to a file", new EventHandler (ActionActivated)), new ActionEntry ("Quit", Stock.Quit, "_Quit", "<control>Q", "Quit", new EventHandler (ActionActivated)), new ActionEntry ("About", null, "_About", "<control>A", "About", new EventHandler (ActionActivated)), new ActionEntry ("Logo", "demo-gtk-logo", null, null, "Gtk#", new EventHandler (ActionActivated)) }; ToggleActionEntry[] toggleActions = new ToggleActionEntry[] { new ToggleActionEntry ("Bold", Stock.Bold, "_Bold", "<control>B", "Bold", new EventHandler (ActionActivated), true) }; RadioActionEntry[] colorActions = new RadioActionEntry[] { new RadioActionEntry ("Red", null, "_Red", "<control>R", "Blood", (int)Color.Red), new RadioActionEntry ("Green", null, "_Green", "<control>G", "Grass", (int)Color.Green), new RadioActionEntry ("Blue", null, "_Blue", "<control>B", "Sky", (int)Color.Blue) }; RadioActionEntry[] shapeActions = new RadioActionEntry[] { new RadioActionEntry ("Square", null, "_Square", "<control>S", "Square", (int)Shape.Square), new RadioActionEntry ("Rectangle", null, "_Rectangle", "<control>R", "Rectangle", (int)Shape.Rectangle), new RadioActionEntry ("Oval", null, "_Oval", "<control>O", "Egg", (int)Shape.Oval) }; ActionGroup group = new ActionGroup ("AppWindowActions"); group.Add (actions); group.Add (toggleActions); group.Add (colorActions, (int)Color.Red, new ChangedHandler (RadioActionActivated)); group.Add (shapeActions, (int)Shape.Square, new ChangedHandler (RadioActionActivated)); UIManager uim = new UIManager (); uim.InsertActionGroup (group, 0); uim.AddWidget += new AddWidgetHandler (AddWidget); uim.AddUiFromString (uiInfo); AddAccelGroup (uim.AccelGroup); }
void RegisterUIManager() { var newTaskAction = new ActionEntry ("NewTaskAction", Stock.New, Catalog.GetString ("New Task ..."), null, null, delegate { // Show the TaskWindow and then cause a new task to be created TaskWindow.ShowWindow (application); TaskWindow.GrabNewTaskEntryFocus (application); }); var refreshAction = new ActionEntry ("RefreshAction", Stock.Execute, Catalog.GetString ("Refresh Tasks ..."), null, null, delegate { application.BackendManager.ReInitializeBackend (); }); var trayActionGroup = new ActionGroup ("Tray"); trayActionGroup.Add (new ActionEntry [] { newTaskAction, new ActionEntry ("AboutAction", Stock.About, OnAbout), new ActionEntry ("PreferencesAction", Stock.Preferences, delegate { application.ShowPreferences (); }), refreshAction, new ActionEntry ("QuitAction", Stock.Quit, delegate { application.Exit (); }) }); ToggleTaskWindowAction = new Gtk.Action ("ToggleTaskWindowAction", Catalog.GetString ("Toggle Task Window")); ToggleTaskWindowAction.ActionGroup = trayActionGroup; ToggleTaskWindowAction.Activated += delegate { TaskWindow.ToggleWindowVisible (application); }; uiManager = new UIManager (); uiManager.AddUiFromString (MenuXml); uiManager.InsertActionGroup (trayActionGroup, 0); SwitchBackendItems (false); }
public DemoUIManager () : base ("UI Manager") { ActionEntry[] entries = new ActionEntry[] { new ActionEntry ("FileMenu", null, "_File", null, null, null), new ActionEntry ("PreferencesMenu", null, "_Preferences", null, null, null), new ActionEntry ("ColorMenu", null, "_Color", null, null, null), new ActionEntry ("ShapeMenu", null, "_Shape", null, null, null), new ActionEntry ("HelpMenu", null, "_Help", null, null, null), new ActionEntry ("New", Stock.New, "_New", "<control>N", "Create a new file", new EventHandler (ActionActivated)), new ActionEntry ("Open", Stock.Open, "_Open", "<control>O", "Open a file", new EventHandler (ActionActivated)), new ActionEntry ("Save", Stock.Save, "_Save", "<control>S", "Save current file", new EventHandler (ActionActivated)), new ActionEntry ("SaveAs", Stock.SaveAs, "Save _As", null, "Save to a file", new EventHandler (ActionActivated)), new ActionEntry ("Quit", Stock.Quit, "_Quit", "<control>Q", "Quit", new EventHandler (ActionActivated)), new ActionEntry ("About", null, "_About", "<control>A", "About", new EventHandler (ActionActivated)), new ActionEntry ("Logo", "demo-gtk-logo", null, null, "Gtk#", new EventHandler (ActionActivated)) }; ToggleActionEntry[] toggleEntries = new ToggleActionEntry[] { new ToggleActionEntry ("Bold", Stock.Bold, "_Bold", "<control>B", "Bold", new EventHandler (ActionActivated), true) }; RadioActionEntry[] colorEntries = new RadioActionEntry[] { new RadioActionEntry ("Red", null, "_Red", "<control>R", "Blood", (int)Color.Red), new RadioActionEntry ("Green", null, "_Green", "<control>G", "Grass", (int)Color.Green), new RadioActionEntry ("Blue", null, "_Blue", "<control>B", "Sky", (int)Color.Blue) }; RadioActionEntry[] shapeEntries = new RadioActionEntry[] { new RadioActionEntry ("Square", null, "_Square", "<control>S", "Square", (int)Shape.Square), new RadioActionEntry ("Rectangle", null, "_Rectangle", "<control>R", "Rectangle", (int)Shape.Rectangle), new RadioActionEntry ("Oval", null, "_Oval", "<control>O", "Egg", (int)Shape.Oval) }; ActionGroup actions = new ActionGroup ("group"); actions.Add (entries); actions.Add (toggleEntries); actions.Add (colorEntries, (int)Color.Red, new ChangedHandler (RadioActionActivated)); actions.Add (shapeEntries, (int)Shape.Oval, new ChangedHandler (RadioActionActivated)); UIManager uim = new UIManager (); uim.InsertActionGroup (actions, 0); AddAccelGroup (uim.AccelGroup); uim.AddUiFromString (uiInfo); VBox box1 = new VBox (false, 0); Add (box1); box1.PackStart (uim.GetWidget ("/MenuBar"), false, false, 0); Label label = new Label ("Type\n<alt>\nto start"); label.SetSizeRequest (200, 200); label.SetAlignment (0.5f, 0.5f); box1.PackStart (label, true, true, 0); HSeparator separator = new HSeparator (); box1.PackStart (separator, false, true, 0); VBox box2 = new VBox (false, 10); box2.BorderWidth = 10; box1.PackStart (box2, false, true, 0); Button button = new Button ("close"); button.Clicked += new EventHandler (CloseClicked); box2.PackStart (button, true, true, 0); button.CanDefault = true; button.GrabDefault (); ShowAll (); }
private void SetUpActionGroup() { ActionEntry[] entries = new ActionEntry[] { new ActionEntry ("FileMenuAction", null, "_File", null, null, null), new ActionEntry ("EditMenuAction", null, "_Edit", null, null, null), new ActionEntry ("ViewMenuAction", null, "_View", null, null, null), new ActionEntry ("HelpMenuAction", null, "_Help", null, null, null), // File new ActionEntry ("connect", Stock.Connect, null, "<control>C", "Connect to Database", new EventHandler (OnConnect)), new ActionEntry ("disconnect", Stock.Disconnect, null, "<control>D", "Disconnect from Database", new EventHandler (OnDisconnect)), new ActionEntry ("quit", Stock.Quit, null, "<control>Q", "Quit the application", new EventHandler (OnQuit)), // Edit new ActionEntry ("preferences", Stock.Preferences, null, "<control>P", "Set application preferences", new EventHandler (OnPreferences)), // View new ActionEntry ("fullscreen", Stock.Fullscreen, null, "<control>F", "Go fullscreen", new EventHandler (OnFullScreen)), // Help new ActionEntry ("about", Stock.About, null, "<control>A", "Information about the application", new EventHandler (OnAbout)), }; actgroup.Add (entries); }
public UIManager(Project project) { ActionEntry[] entries = new ActionEntry[] { new ActionEntry ("FileMenu", null, Catalog.GetString ("_File"), null, null, null), new ActionEntry ("Open", Stock.Open, null, "<control>O", Catalog.GetString ("Open a file"), OpenFile), new ActionEntry ("RecentFiles", null, Catalog.GetString ("Recent files"), null, null, null), new ActionEntry ("Save", Stock.Save, null, "<control>S", Catalog.GetString ("Save"), SaveFile), new ActionEntry ("SaveAs", Stock.SaveAs, null, "<control><shift>S", Catalog.GetString ("Save As"), SaveFileAs), new ActionEntry ("ImportGlade", null, Catalog.GetString ("_Import from Glade File..."), null, Catalog.GetString ("Import UI from a Glade file"), ImportGlade), new ActionEntry ("ExportGlade", null, Catalog.GetString ("_Export to Glade File..."), null, Catalog.GetString ("Export UI to a Glade file"), ExportGlade), new ActionEntry ("Close", Stock.Close, null, "<control>W", Catalog.GetString ("Close"), Close), new ActionEntry ("Quit", Stock.Quit, null, "<control>Q", Catalog.GetString ("Quit"), Quit), new ActionEntry ("EditMenu", null, "_Edit", null, null, null), new ActionEntry ("Undo", Stock.Undo, null, "<control>Z", Catalog.GetString ("Undo previous action"), Undo), new ActionEntry ("Redo", Stock.Redo, null, "<control><shift>Z", Catalog.GetString ("Redo previously-undone action"), Redo), new ActionEntry ("Cut", Stock.Cut, null, "<control>X", Catalog.GetString ("Cut selection to clipboard"), Cut), new ActionEntry ("Copy", Stock.Copy, null, "<control>C", Catalog.GetString ("Copy selection to clipboard"), Copy), new ActionEntry ("Paste", Stock.Paste, null, "<control>V", Catalog.GetString ("Paste from clipboard"), Paste), new ActionEntry ("Delete", Stock.Delete, null, "Delete", Catalog.GetString ("Delete selection"), Delete), new ActionEntry ("LibraryManager", null, Catalog.GetString ("Widget libraries..."), null, null, ShowLibraryManager), new ActionEntry ("ProjectMenu", null, Catalog.GetString ("Project"), null, null, null), new ActionEntry ("EditProjectIcons", null, Catalog.GetString ("Project Icons..."), null, null, EditIcons), new ActionEntry ("HelpMenu", null, Catalog.GetString ("_Help"), null, null, null), new ActionEntry ("Contents", Stock.Help, Catalog.GetString ("_Contents"), "F1", Catalog.GetString ("Help"), Help), new ActionEntry ("About", Stock.About, null, null, Catalog.GetString ("About Stetic"), About), }; ActionGroup actions = new ActionGroup ("group"); actions.Add (entries); InsertActionGroup (actions, 0); AddUiFromString (menuXml); // Not yet implemented GetAction ("/menubar/HelpMenu/Contents").Sensitive = false; GetAction ("/menubar/FileMenu/Open").IsImportant = true; GetAction ("/menubar/FileMenu/Save").IsImportant = true; // Set up Edit menu sensitivity hackery Gtk.MenuItem editMenuItem = (Gtk.MenuItem) GetWidget ("/menubar/EditMenu"); Gtk.Menu editMenu = (Gtk.Menu)editMenuItem.Submenu; editMenu.Shown += EditShown; editMenu.Hidden += EditHidden; Gtk.MenuItem recentMenuItem = (Gtk.MenuItem) GetWidget ("/menubar/FileMenu/RecentFiles"); recentFilesMenu = new Gtk.Menu (); recentMenuItem.Submenu = recentFilesMenu; recentMenuItem.ShowAll (); ReadRecentFiles (); SteticMain.CurrentDesignerChanged += OnDesignerChanged; Project = project; }
private void AddLoginDialogMenus(GUI.Dialogs.Login login) { ActionEntry[] entries = new ActionEntry[] { // new ActionEntry("FileMenu", null, "_File", null, null, null), // File Menu new ActionEntry("Accounts", null, "Accounts", null, "Accounts", new EventHandler(OnAccountsDialog)) }; string ui = "<ui>" + " <menubar name='MenuBar'>" + " <menu action='FileMenu'>" + " <menuitem action='Accounts' position='top'/>" + " </menu>" + " </menubar>" + "</ui>"; login.Menu.AddMenus(ui, entries); }
// ============================================ // PUBLIC Constructors // ============================================ public UiMenuManager() { ActionEntry[] entries = new ActionEntry[] { new ActionEntry("GoMenu", null, "_Go", null, null, null), new ActionEntry("FileMenu", null, "_File", null, null, null), new ActionEntry("ViewMenu", null, "_View", null, null, null), new ActionEntry("HelpMenu", null, "_Help", null, null, null), new ActionEntry("ImageMenu", null, "_Image", null, null, null), // File new ActionEntry("OpenImage", "NyIVImage", "Open Image", null, "Open Image", new EventHandler(ActionActivated)), new ActionEntry("OpenWebImage", "NyIVImage", "Open Web Image", null, "Open Web Image", new EventHandler(ActionActivated)), new ActionEntry("ProxySettings", "NyIVProxy", "Proxy Settings", null, "Proxy Settings", new EventHandler(ActionActivated)), new ActionEntry("Quit", Gtk.Stock.Quit, "Quit", null, "Quit Application", new EventHandler(ActionActivated)), // Go new ActionEntry("GoBack", Gtk.Stock.GoBack, "Back", null, "Go Back", new EventHandler(ActionActivated)), new ActionEntry("GoForward", Gtk.Stock.GoForward, "Forward", null, "Go Forward", new EventHandler(ActionActivated)), // View new ActionEntry("Fullscreen", Gtk.Stock.Fullscreen, "Fullscreen", null, "Fullscreen", new EventHandler(ActionActivated)), // Image new ActionEntry("ZoomIn", Gtk.Stock.ZoomIn, "In", null, "Zoom In", new EventHandler(ActionActivated)), new ActionEntry("ZoomOut", Gtk.Stock.ZoomOut, "Out", null, "Zoom Out", new EventHandler(ActionActivated)), new ActionEntry("Zoom100", Gtk.Stock.Zoom100, "Normal", null, "Zoom Normal", new EventHandler(ActionActivated)), new ActionEntry("ZoomFit", Gtk.Stock.ZoomFit, "Fit", null, "Zoom Fit", new EventHandler(ActionActivated)), // Help Menu new ActionEntry("About", Gtk.Stock.About, "About", null, "About Shared Folder", new EventHandler(ActionActivated)), }; // Toggle items ToggleActionEntry[] toggleEntries = new ToggleActionEntry[] { // View new ToggleActionEntry("ViewNetwork", null, "Network", null, null, new EventHandler(ActionActivated), true), new ToggleActionEntry("ViewLogo", null, "NyFolder Logo", null, null, new EventHandler(ActionActivated), true), // Network new ToggleActionEntry("NetOnline", null, "Online", null, null, new EventHandler(ActionActivated), false) }; actionGroup = new ActionGroup("group"); actionGroup.Add(entries); actionGroup.Add(toggleEntries); InsertActionGroup(actionGroup, 0); AddUiFromString(uiInfo); }
private void Initialize () { ThreadAssist.AssertInMainThread (); actions = new ActionGroup ("CoverArt"); ActionEntry[] action_list = new ActionEntry [] { new ActionEntry ("CoverArtAction", null, Catalog.GetString ("_Cover Art"), null, Catalog.GetString ("Manage cover art"), null), new ActionEntry ("FetchCoverArtAction", null, Catalog.GetString ("_Download Cover Art"), null, Catalog.GetString ("Download cover art for all tracks"), OnFetchCoverArt) }; actions.Add (action_list); action_service.UIManager.InsertActionGroup (actions, 0); ui_manager_id = action_service.UIManager.AddUiFromResource ("CoverArtMenu.xml"); ServiceManager.SourceManager.MusicLibrary.TracksAdded += OnTracksAdded; ServiceManager.SourceManager.MusicLibrary.TracksChanged += OnTracksChanged; }
// ============================================ // PRIVATE Methods // ============================================ private void InitializeTalkMenu() { ActionEntry[] entries = new ActionEntry[] { new ActionEntry("TalkMenu", null, "_Talk", null, null, null), new ActionEntry("Talk", "TalkBubble", "Talk", null, "Start Talk With...", new EventHandler(OnTalkWith)), }; string ui = "<ui>" + " <menubar name='MenuBar'>" + " <menu action='ToolMenu'>" + " <menuitem action='Talk' />" + " </menu>" + " </menubar>" + "</ui>"; nyFolder.Window.Menu.AddMenus(ui, entries); }
// ============================================ // PRIVATE Methods // ============================================ private void InitializeSearchMenu() { ActionEntry[] entries = new ActionEntry[] { new ActionEntry("Search", "Search", "Search", null, "Find File...", new EventHandler(OnFindFile)), }; string ui = "<ui>" + " <menubar name='MenuBar'>" + " <menu action='ToolMenu'>" + " <menuitem action='Search' />" + " </menu>" + " </menubar>" + "</ui>"; nyFolder.Window.Menu.AddMenus(ui, entries); }
// ============================================ // PRIVATE Methods // ============================================ private void InitializeMenu() { ActionEntry[] entries = new ActionEntry[] { new ActionEntry("DeviantARTMenu", "DeviantArt", "DeviantART", null, null, null), // Menu Actions }; string ui = "<ui>" + " <menubar name='MenuBar'>" + " <menu action='ToolMenu'>" + " <menu action='DeviantARTMenu'>" + " </menu>" + " </menu>" + " </menubar>" + "</ui>"; nyFolder.MainWindow.Menu.AddMenus(ui, entries); }
// ============================================ // PRIVATE (Methods) Menu Event Handlers // ============================================ private void AddMenu(GUI.Base.UIManager menuManager) { string ui = "<ui>" + " <menubar name='MenuBar'>" + " <menu action='FileMenu'>" + " <menuitem action='RegisterAccount' position='top' />" + " </menu>" + " </menubar>" + "</ui>"; ActionEntry[] entries = new ActionEntry[] { new ActionEntry("RegisterAccount", "Registration", "Register Account", null, "Register New Account...", new EventHandler(OnRegisterAccount)), }; menuManager.AddMenus(ui, entries); }
// ============================================ // PUBLIC Constructors // ============================================ public MenuManager() { ActionEntry[] entries = new ActionEntry[] { new ActionEntry("FileMenu", null, "_File", null, null, null), new ActionEntry("ViewMenu", null, "_View", null, null, null), new ActionEntry("GoMenu", null, "_Go", null, null, null), new ActionEntry("ToolMenu", null, "_Tool", null, null, null), new ActionEntry("NetworkMenu", null, "_Network", null, null, null), new ActionEntry("HelpMenu", null, "_Help", null, null, null), // File Menu new ActionEntry("ProxySettings", "Proxy", "Proxy Settings", null, "Setup Proxy", new EventHandler(ActionActivated)), new ActionEntry("Logout", "Logout", "Logout", null, "Logout", new EventHandler(ActionActivated)), new ActionEntry("Quit", Gtk.Stock.Quit, "Quit", "<control>Q", "Quit Shared Folder", new EventHandler(ActionActivated)), // View Menu new ActionEntry("Refresh", Gtk.Stock.Refresh, "Refresh", null, null, new EventHandler(ActionActivated)), // Go Menu new ActionEntry("GoUp", Gtk.Stock.GoUp, "UP", null, "Open The Parent Folder", new EventHandler(ActionActivated)), new ActionEntry("GoHome", Gtk.Stock.Home, "Home", null, "Open The Root Directory", new EventHandler(ActionActivated)), new ActionEntry("GoMyFolder", "StockMyFolder", "MyFolder", null, "My Shared Folder", new EventHandler(ActionActivated)), new ActionEntry("GoNetwork", "StockNetwork", "Network", null, "View Network", new EventHandler(ActionActivated)), // Network new ActionEntry("SetPort", Gtk.Stock.Preferences, "Set P2P Port", null, "Set P2P Port", new EventHandler(ActionActivated)), new ActionEntry("AddPeer", Gtk.Stock.Network, "Add Peer", null, "Add New Peer", new EventHandler(ActionActivated)), new ActionEntry("RmPeer", Gtk.Stock.Delete, "Remove Peer", null, "Remove Peer", new EventHandler(ActionActivated)), new ActionEntry("DownloadManager", "Download", "Download Manager", null, "Download Manager", new EventHandler(ActionActivated)), // Help Menu new ActionEntry("About", Gtk.Stock.About, "About", null, "About Shared Folder", new EventHandler(ActionActivated)), }; // Toggle items ToggleActionEntry[] toggleEntries = new ToggleActionEntry[] { // View new ToggleActionEntry("ViewToolBar", null, "ToolBar", null, null, new EventHandler(ActionActivated), true), new ToggleActionEntry("ViewUserPanel", null, "User Panel", null, null, new EventHandler(ActionActivated), true), // Network new ToggleActionEntry("NetOnline", null, "Online", null, null, new EventHandler(ActionActivated), false) }; actionGroup = new ActionGroup("group"); actionGroup.Add(entries); actionGroup.Add(toggleEntries); InsertActionGroup(actionGroup, 0); AddUiFromString(uiInfo); }
void AddActionUI () { ActionEntry[] actions = new ActionEntry[] { new ActionEntry ("FileMenu", null, "_File", null, null, null), new ActionEntry ("Quit", Stock.Quit, "_Quit", "<control>Q", "Quit", new EventHandler (QuitActivated)), new ActionEntry ("HelpMenu", null, "_Help", null, null, null), new ActionEntry ("About", null, "_About IlContrast...", "<control>A", "About IlContrast", new EventHandler (AboutActivated)), }; ActionGroup group = new ActionGroup ("group"); group.Add (actions); UIManager uim = new UIManager (); uim.InsertActionGroup (group, (int) uim.NewMergeId ()); uim.AddUiFromString (uiInfo); main_vbox.PackStart (uim.GetWidget ("/MenuBar"), false, true, 0); //main_vbox.PackStart (uim.GetWidget ("/ToolBar"), false, true, 0); }