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 ();
		}
Beispiel #2
0
        public MainWindow(string[] files) : base(Gtk.WindowType.Toplevel)
        {
            Build();

            this.files   = new RobotFile[Constants.MAX_ROBOTS];
            robotlist    = new RobotWidget[Constants.MAX_ROBOTS];
            robotactions = new RobotActions[Constants.MAX_ROBOTS];

            // FIXME: Have to wait until MonoDevelop 2.0 for UIManager integration, it seems.
            uimanager = new Gtk.UIManager();

            basicactions = new BasicActions();
            uimanager.InsertActionGroup(basicactions, -1);
            for (int i = 1; i <= Constants.MAX_ROBOTS; i++)
            {
                robotactions[i - 1] = new RobotActions(i);
                uimanager.InsertActionGroup(robotactions[i - 1], -1);
            }
            connectActions();

            uimanager.AddUiFromString(basicactions.buildMenuDescription());
            mainvbox.PackStart(uimanager.GetWidget("/Menubar"));

            gametimer = 0;
            reset_game();
            open_robots(files);
        }
Beispiel #3
0
        public MainWindow(string[] files)
            : base(Gtk.WindowType.Toplevel)
        {
            Build();

            this.files = new RobotFile[Constants.MAX_ROBOTS];
            robotlist = new RobotWidget[Constants.MAX_ROBOTS];
            robotactions = new RobotActions[Constants.MAX_ROBOTS];

            // FIXME: Have to wait until MonoDevelop 2.0 for UIManager integration, it seems.
            uimanager = new Gtk.UIManager();

            basicactions = new BasicActions();
            uimanager.InsertActionGroup(basicactions, -1);
            for (int i = 1; i <= Constants.MAX_ROBOTS; i++)
            {
                robotactions[i-1] = new RobotActions(i);
                uimanager.InsertActionGroup(robotactions[i-1], -1);
            }
            connectActions();

            uimanager.AddUiFromString(basicactions.buildMenuDescription());
            mainvbox.PackStart(uimanager.GetWidget("/Menubar"));

            gametimer = 0;
            reset_game();
            open_robots(files);
        }
Beispiel #4
0
        public virtual void StartMainLoop()
        {
            Gtk.UIManager uiManager = Tomboy.ActionManager.UI;

            ActionGroup mainMenuActionGroup = new ActionGroup("Mac");

            mainMenuActionGroup.Add(new ActionEntry [] {
                new ActionEntry("WindowMenuAction",
                                null,
                                // Translators: This is the name of "Window" menu in the Mac menubar
                                Catalog.GetString("_Window"),
                                null,
                                null,
                                null)
            });

            uiManager.AddUiFromString(osxMenuXml);
            uiManager.InsertActionGroup(mainMenuActionGroup, 1);

            Gtk.MenuShell mainMenu = uiManager.GetWidget("/MainWindowMenubar") as Gtk.MenuShell;
            mainMenu.Show();
            IgeMacMenu.MenuBar = mainMenu;
            WindowMenuManager.UpdateWindowMenu();

            Gtk.MenuItem about_item = uiManager.GetWidget("/MainWindowMenubar/HelpMenu/ShowAbout") as Gtk.MenuItem;
            Gtk.MenuItem prefs_item = uiManager.GetWidget("/MainWindowMenubar/EditMenu/ShowPreferences") as Gtk.MenuItem;
            Gtk.MenuItem quit_item  = uiManager.GetWidget("/MainWindowMenubar/FileMenu/QuitTomboy") as Gtk.MenuItem;

            (about_item.Child as Gtk.Label).Text = Catalog.GetString("About Tomboy");
            (prefs_item.Child as Gtk.Label).Text = Catalog.GetString("Preferences...");

            IgeMacMenuGroup about_group = IgeMacMenu.AddAppMenuGroup();
            IgeMacMenuGroup prefs_group = IgeMacMenu.AddAppMenuGroup();

            about_group.AddMenuItem(about_item, null);
            prefs_group.AddMenuItem(prefs_item, null);

            IgeMacMenu.QuitMenuItem = quit_item;

            IgeMacDock dock = new IgeMacDock();

            dock.Clicked += delegate(object sender, EventArgs args) {
                if (Tomboy.Tray.TomboyTrayMenu.Visible)
                {
                    Tomboy.Tray.TomboyTrayMenu.Hide();
                }
                else
                {
                    Tomboy.Tray.Tray.ShowMenu(false);
                }
            };
            dock.QuitActivate += delegate(object sender, EventArgs args) { Exit(0); };

            Tomboy.ActionManager ["CloseWindowAction"].Visible = false;

            Gtk.Application.Run();
        }
Beispiel #5
0
        //------------------------------------------------------------------------------
        public MainMenu()
        {
            uim = new Gtk.UIManager();

            Gtk.ActionGroup actions = new Gtk.ActionGroup("MenuBarActions" + Guid.NewGuid());

            actions.Add(getActionEntries());
            uim.InsertActionGroup(actions, 0);

            // Put the XML definition of the controls (widgets) into the UIManager's buffer -and- create controls (widgets).
            uim.AddUiFromString(UI.ToString());

            instance = (Gtk.MenuBar)uim.GetWidget("/menubar");
            instance.ShowAll();
        }
Beispiel #6
0
        private void SetUpUiManager()
        {
            string ui = @"<ui>
        <menubar name='MenuBar'>
            <menu action='LogopathyMenu'>
                <menuitem action='Close'/>
            </menu>
            <menu action='EditMenu'>
                <menuitem action='Copy'/>
            </menu>
            <menu action='ServerMenu'>
                <menuitem action='Connect'/>
            </menu>
            <menu action='ChannelMenu'>
                <menuitem action='Join'/>
            </menu>
            <menu action='HelpMenu'>
                <menuitem action='Help'/>
            </menu>
        </menubar>
        </ui>";

            UiManager.AddUiFromString(ui);
        }
		void CreateMenu ()
		{
			if (menu == null)
			{
				ActionGroup group = new ActionGroup ("Popup");

				Gtk.Action copy = new Gtk.Action ("copy", GettextCatalog.GetString ("_Copy"),
				                          GettextCatalog.GetString ("Copy comment task"), Gtk.Stock.Copy);
				copy.Activated += new EventHandler (OnGenTaskCopied);
				group.Add (copy, "<Control><Mod2>c");

				Gtk.Action jump = new Gtk.Action ("jump", GettextCatalog.GetString ("_Go to"),
				                          GettextCatalog.GetString ("Go to comment task"), Gtk.Stock.JumpTo);
				jump.Activated += new EventHandler (OnGenTaskJumpto);
				group.Add (jump);

				Gtk.Action delete = new Gtk.Action ("delete", GettextCatalog.GetString ("_Delete"),
				                          GettextCatalog.GetString ("Delete comment task"), Gtk.Stock.Delete);
				delete.Activated += new EventHandler (OnGenTaskDelete);
				group.Add (delete);

				Gtk.Action columns = new Gtk.Action ("columns", GettextCatalog.GetString ("Columns"));
				group.Add (columns, null);

				ToggleAction columnLine = new ToggleAction ("columnLine", GettextCatalog.GetString ("Line"),
				                                            GettextCatalog.GetString ("Toggle visibility of Line column"), null);
				columnLine.Toggled += new EventHandler (OnColumnVisibilityChanged);
				columnsActions[columnLine] = (int)Columns.Line;
				group.Add (columnLine);

				ToggleAction columnDescription = new ToggleAction ("columnDescription", GettextCatalog.GetString ("Description"),
				                                            GettextCatalog.GetString ("Toggle visibility of Description column"), null);
				columnDescription.Toggled += new EventHandler (OnColumnVisibilityChanged);
				columnsActions[columnDescription] = (int)Columns.Description;
				group.Add (columnDescription);

				ToggleAction columnFile = new ToggleAction ("columnFile", GettextCatalog.GetString ("File"),
				                                            GettextCatalog.GetString ("Toggle visibility of File column"), null);
				columnFile.Toggled += new EventHandler (OnColumnVisibilityChanged);
				columnsActions[columnFile] = (int)Columns.File;
				group.Add (columnFile);

				ToggleAction columnPath = new ToggleAction ("columnPath", GettextCatalog.GetString ("Path"),
				                                            GettextCatalog.GetString ("Toggle visibility of Path column"), null);
				columnPath.Toggled += new EventHandler (OnColumnVisibilityChanged);
				columnsActions[columnPath] = (int)Columns.Path;
				group.Add (columnPath);

				UIManager uiManager = new UIManager ();
				uiManager.InsertActionGroup (group, 0);
				
				string uiStr = "<ui><popup name='popup'>"
					+ "<menuitem action='copy'/>"
					+ "<menuitem action='jump'/>"
					+ "<menuitem action='delete'/>"
					+ "<separator/>"
					+ "<menu action='columns'>"
					+ "<menuitem action='columnLine' />"
					+ "<menuitem action='columnDescription' />"
					+ "<menuitem action='columnFile' />"
					+ "<menuitem action='columnPath' />"
					+ "</menu>"
					+ "</popup></ui>";

				uiManager.AddUiFromString (uiStr);
				menu = (Menu)uiManager.GetWidget ("/popup");
				menu.ShowAll ();

				menu.Shown += delegate (object o, EventArgs args)
				{
					columnLine.Active = view.Columns[(int)Columns.Line].Visible;
					columnDescription.Active = view.Columns[(int)Columns.Description].Visible;
					columnFile.Active = view.Columns[(int)Columns.File].Visible;
					columnPath.Active = view.Columns[(int)Columns.Path].Visible;
					copy.Sensitive = jump.Sensitive = delete.Sensitive =
						view.Selection != null &&
						view.Selection.CountSelectedRows () > 0 &&
						(columnLine.Active ||
						columnDescription.Active ||
						columnFile.Active ||
						columnPath.Active);
				};
			}
		}
Beispiel #8
0
	public MainWindow (): base (MainClass.AppName)
	{
		this.Build();
				
		_views = new IGedcomView[]
		{
			SummaryViewView,
			FamilyViewView,
			IndividualViewView
		};
		_viewActions = new Gtk.Action[]
		{
			SummaryViewAction,
			FamilyViewAction,
			IndividualViewAction,
			SourceViewAction,
			MultimediaViewAction,
			RepositoryViewAction,
			PedigreeViewAction,
			NoteViewAction
		};
		
		foreach (IGedcomView view in _views)
		{
			view.MoreInformation += new EventHandler<IndividualArgs>(OnMoreInformation);
			view.MoreFamilyInformation += new EventHandler<FamilyArgs>(OnMoreFamilyInformation);
		    view.SpouseSelect += new EventHandler<SpouseSelectArgs>(OnSpouseSelect);
		    view.ShowSourceCitation += new EventHandler<SourceCitationArgs>(OnShowSourceCitation);
			view.SelectNewChild += new EventHandler<IndividualArgs>(OnSelectNewChild);
			view.SelectNewSpouse += new EventHandler<IndividualArgs>(OnSelectNewSpouse);
			view.SelectNewNote += new EventHandler<NoteArgs>(OnSelectNewNote);
			view.ShowScrapBook += new EventHandler<ScrapBookArgs>(OnShowScrapBook);
			view.ShowName += new EventHandler<IndividualArgs>(OnShowName);
			view.DeleteIndividual += new EventHandler<IndividualArgs>(OnDeleteIndividual);
			view.MoreFactInformation += new EventHandler<FactArgs>(OnMoreFactInformation);
		}

		SourceViewView.ShowScrapBook += new EventHandler<ScrapBookArgs>(OnShowScrapBook);
		SourceViewView.ShowSourceCitation += new EventHandler<SourceCitationArgs>(OnShowSourceCitation);
		MultimediaViewView.AddFile += new EventHandler<MultimediaFileArgs>(OnMultimediaView_AddFile);
		MultimediaViewView.OpenFile += new EventHandler<MultimediaFileArgs>(OnMultimediaView_OpenFile);
		MultimediaViewView.ShowSourceCitation += new EventHandler<SourceCitationArgs>(OnShowSourceCitation);
		RepositoryViewView.ShowSourceCitation += new EventHandler<SourceCitationArgs>(OnShowSourceCitation);
		NotesViewView.ShowSourceCitation += new EventHandler<SourceCitationArgs>(OnShowSourceCitation);
		
		// FIXME: not working via property in designer show all kicking in?
		NotesViewView.NoteOnly = true;
		
		ViewNotebook.ShowTabs = false;		
		ViewNotebook.Page = 0;
		_currentView = _views[0];
		
		ViewNotebook.Sensitive = false;
		Merge.Sensitive = false;
		Save.Sensitive = false;
		SaveAs.Sensitive = false;
		PropertiesAction.Sensitive = false;


		_viewGroup = View.ActionGroup;
		_toolsGroup = Tools.ActionGroup;
		_reportsGroup = Reports.ActionGroup;
		_defaultGroup = New.ActionGroup;		
		
		// get all report related actions, make insensitive
		foreach (Gtk.Action action in _reportsGroup.ListActions())
		{
			action.Sensitive = false;
		}
		
		// get all tools related actions, make insensitive
		foreach (Gtk.Action action in _toolsGroup.ListActions())
		{
			action.Sensitive = false;
		}
		
		// get all view related actions, make insensitive
		foreach (Gtk.Action action in _viewGroup.ListActions())
		{
			action.Sensitive = false;
		}
		SummaryViewAction.ActionGroup.Sensitive = true;

		NewIndividual.Sensitive = false;
		NewMedia.Sensitive = false;
		NewRepository.Sensitive = false;
		NewSource.Sensitive = false;
		NewNote.Sensitive = false;	

		// dropdown actions, not supported by stetic
		Gtk.UIManager manager = new Gtk.UIManager();
		GtkDropDownAction newDropDown = new GtkDropDownAction("New", "New", string.Empty, Gtk.Stock.New);
		newDropDown.Activated += OnNew_Activated;
		newDropDown.UIManager = manager;
		newDropDown.MenuPath = "/newpopup";
		manager.InsertActionGroup(_defaultGroup, 0);
		manager.AddUiFromString("<ui><popup name='newpopup'><menuitem action='NewDatabase'/><menuitem action='NewIndividual'/><menuitem action='NewMedia'/><menuitem action='NewRepository'/><menuitem action='NewSource'/><menuitem action='NewNote'/></popup></ui>");
		Gtk.Widget newButton = newDropDown.CreateToolItem();
		newDropDown.ConnectProxy(newButton);
		
		toolbar1.Insert((Gtk.ToolItem)newButton, 0);
		
		// gtk recent actions, not supported by stetic or gtk# 2.10
		_recentManager = Gtk.RecentManager.Default;
		//_recentManager.Limit = 4; // FIXME: don't hardcode max recent file count
		
		Gtk.RecentChooserMenu menu = new RecentChooserMenu(_recentManager);
		menu.LocalOnly = true;
		menu.SortType = RecentSortType.Mru;
		
		Gtk.RecentFilter filter = new RecentFilter();
		filter.Name = "GEDCOM files";
		filter.AddMimeType("application/x-gedcom");
		menu.AddFilter(filter);		
		menu.Filter = filter;
		menu.ItemActivated += RecentMenu_ItemActivated;
		_toolbarRecentMenu = menu;
		
		GtkDropDownAction recentDropDown = new GtkDropDownAction("Open", "Open", "Open File", Gtk.Stock.Open);
		recentDropDown.Menu = menu;
		recentDropDown.Activated += OnOpen_Activated;
		Gtk.Widget openButton = recentDropDown.CreateToolItem();
		recentDropDown.ConnectProxy(openButton);
		
		toolbar1.Insert((Gtk.ToolItem)openButton, 1);
	}
		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);
		}
Beispiel #10
0
        //------------------------------------------------------------------------------
        public MainMenu()
        {
            uim = new Gtk.UIManager ();

            Gtk.ActionGroup actions = new Gtk.ActionGroup ("MenuBarActions" + Guid.NewGuid ());

            actions.Add (getActionEntries ());
            uim.InsertActionGroup (actions, 0);

            // Put the XML definition of the controls (widgets) into the UIManager's buffer -and- create controls (widgets).
            uim.AddUiFromString (UI.ToString ());

            instance = (Gtk.MenuBar)uim.GetWidget ("/menubar");
            instance.ShowAll ();
        }
Beispiel #11
0
        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);
        }
        private void SetPlayersMenu()
        {
            Action edit;
            UIManager manager;
            ActionGroup g;

            manager= new UIManager();
            g = new ActionGroup("PlayersMenuGroup");

            edit = new Action("EditAction", Mono.Unix.Catalog.GetString("Edit name"), null, "gtk-edit");

            g.Add(edit, null);

            manager.InsertActionGroup(g,0);

            manager.AddUiFromString("<ui>"+
                                    "  <popup action='PlayersMenu'>"+
                                    "    <menuitem action='EditAction'/>"+
                                    "  </popup>"+
                                    "</ui>");

            playersMenu = manager.GetWidget("/PlayersMenu") as Menu;

            edit.Activated += OnEdit;
        }
Beispiel #13
0
		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);
		}
Beispiel #14
0
        private void SetCategoriesMenu()
        {
            Gtk.Action editProp, sortMenu;
            UIManager manager;
            ActionGroup g;

            manager = new UIManager ();
            g = new ActionGroup ("CategoriesMenuGroup");

            editProp = new Gtk.Action ("EditPropAction", Mono.Unix.Catalog.GetString ("Edit properties"), null, "gtk-edit");
            sortMenu = new Gtk.Action ("SortMenuAction", Mono.Unix.Catalog.GetString ("Sort Method"), null, null);
            sortByName = new Gtk.RadioAction ("SortByNameAction", Mono.Unix.Catalog.GetString ("Sort by name"), null, null, 1);
            sortByStart = new Gtk.RadioAction ("SortByStartAction", Mono.Unix.Catalog.GetString ("Sort by start time"), null, null, 2);
            sortByStop = new Gtk.RadioAction ("SortByStopAction", Mono.Unix.Catalog.GetString ("Sort by stop time"), null, null, 3);
            sortByDuration = new Gtk.RadioAction ("SortByDurationAction", Mono.Unix.Catalog.GetString ("Sort by duration"), null, null, 3);

            sortByName.Group = new GLib.SList (System.IntPtr.Zero);
            sortByStart.Group = sortByName.Group;
            sortByStop.Group = sortByName.Group;
            sortByDuration.Group = sortByName.Group;

            g.Add (editProp, null);
            g.Add (sortMenu, null);
            g.Add (sortByName, null);
            g.Add (sortByStart, null);
            g.Add (sortByStop, null);
            g.Add (sortByDuration, null);

            manager.InsertActionGroup (g, 0);

            manager.AddUiFromString ("<ui>" +
            "  <popup action='CategoryMenu'>" +
            "    <menuitem action='EditPropAction'/>" +
            "    <menu action='SortMenuAction'>" +
            "      <menuitem action='SortByNameAction'/>" +
            "      <menuitem action='SortByStartAction'/>" +
            "      <menuitem action='SortByStopAction'/>" +
            "      <menuitem action='SortByDurationAction'/>" +
            "    </menu>" +
            "  </popup>" +
            "</ui>");

            categoriesMenu = manager.GetWidget ("/CategoryMenu") as Menu;

            sortByName.Activated += OnSortActivated;
            sortByStart.Activated += OnSortActivated;
            sortByStop.Activated += OnSortActivated;
            sortByDuration.Activated += OnSortActivated;
            editProp.Activated += delegate(object sender, EventArgs e) {
                EditProperties (GetValueFromPath (Selection.GetSelectedRows () [0]) as EventType);
            };
        }
Beispiel #15
0
        private void RegisterUIManager()
        {
            ActionGroup trayActionGroup = new ActionGroup ("Tray");
            trayActionGroup.Add (new ActionEntry [] {
                new ActionEntry ("NewTaskAction",
                                 Stock.New,
                                 Catalog.GetString ("New Task ..."),
                                 null,
                                 null,
                                 OnNewTask),

                new ActionEntry ("ShowTasksAction",
                                 null,
                                 Catalog.GetString ("Show Tasks ..."),
                                 null,
                                 null,
                                 OnShowTaskWindow),

                new ActionEntry ("AboutAction",
                                 Stock.About,
                                 OnAbout),

                new ActionEntry ("PreferencesAction",
                                 Stock.Preferences,
                                 OnPreferences),

                new ActionEntry ("RefreshAction",
                                 Stock.Execute,
                                 Catalog.GetString ("Refresh Tasks ..."),
                                 null,
                                 null,
                                 OnRefreshAction),

                new ActionEntry ("QuitAction",
                                 Stock.Quit,
                                 OnQuit)
            });

            uiManager = new UIManager ();
            uiManager.AddUiFromString (menuXml);
            uiManager.InsertActionGroup (trayActionGroup, 0);
        }
		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 ();
		}
Beispiel #17
0
        void build_ui_manager()
        {
            string xml = ("<ui>\n" +
                      "  <menubar name='main-menu'>\n" +
                      "     <menu action='file-menu'>\n" +
                      "       <menuitem action='open'/>\n" +
                      "       <menuitem action='save-as'/>\n" +
                      "       <separator/>\n" +
                      "       <menuitem action='quit'/>\n" +
                      "     </menu>\n" +
                      "     <menu action='help-menu'>\n" +
                      "       <menuitem action='about'/>\n" +
                      "     </menu>\n" +
                      "   </menubar>\n" +
                      "   <toolbar name='toolbar'>\n" +
                      "     <toolitem action='next-error'/>\n" +
                      "     <toolitem action='clear'/>\n" +
                      "     <separator/>\n" +
                      "     <toolitem action='record-stop'/>\n" +
                      "     <toolitem action='record-record'/>\n" +
                      "     <separator/>\n" +
                      "     <toolitem action='view-compact'/>\n" +
                      "     <toolitem action='view-full'/>\n" +
                      "   </toolbar>\n" +
                      "</ui>\n");

            ui_manager = new UIManager ();

            ui_manager.InsertActionGroup (action_group, 0);

            AccelGroup accel_group = ui_manager.AccelGroup;
            AddAccelGroup (accel_group);

            ui_manager.AddUiFromString (xml); /* FIXME: this could throw an exception */
        }
Beispiel #18
0
        void CreateMenu()
        {
            Gtk.Action select_all;
            Gtk.Action select_none;
            UIManager manager;
            ActionGroup g;

            manager = new UIManager ();
            g = new ActionGroup ("MenuGroup");

            select_all = new Gtk.Action ("AllAction", Mono.Unix.Catalog.GetString ("Select all"), null, "gtk-edit");
            select_none = new Gtk.Action ("NoneAction", Mono.Unix.Catalog.GetString ("Unselect all"), null, "gtk-edit");

            g.Add (select_all, null);
            g.Add (select_none, null);

            manager.InsertActionGroup (g, 0);

            manager.AddUiFromString ("<ui>" +
            "  <popup action='Menu'>" +
            "    <menuitem action='AllAction'/>" +
            "    <menuitem action='NoneAction'/>" +
            "  </popup>" +
            "</ui>");

            playersMenu = manager.GetWidget ("/Menu") as Menu;

            select_all.Activated += (sender, e) => Select (true);
            select_none.Activated += (sender, e) => Select (false);
        }
		public MainWindow() : base(Gtk.WindowType.Toplevel) {
			//Build();
			
			this.IconList = new Gdk.Pixbuf[] { new Gdk.Pixbuf(null, "XenonFileManager.icons.xenon16.png"), new Gdk.Pixbuf(null, "XenonFileManager.icons.xenon256.png") };
			
			this.Title = Catalog.GetString("Xenon File Manager");
			this.SetSizeRequest(600, 450);
			//this.DefaultWidth = 600;
			//this.DefaultHeight = 450;
			
			VBox vbox1 = new VBox(false, 0);
					UIManager uiMgr = new UIManager();
					ActionGroup w1 = new ActionGroup("Default");
					Gtk.Action FileAction = new Gtk.Action("FileAction", global::Mono.Unix.Catalog.GetString ("_File"), null, null);
					FileAction.ShortLabel = Mono.Unix.Catalog.GetString("_File");
					w1.Add (FileAction, null);
					Gtk.Action NewTabAction = new Gtk.Action("NewTabAction", Catalog.GetString ("New _Tab"), null, null);
					NewTabAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("New _Tab");
					w1.Add (NewTabAction, "<Control>t");
					Gtk.Action CloseTabAction = new Gtk.Action("CloseTabAction", Catalog.GetString("_Close Tab"), null, null);
					CloseTabAction.ShortLabel = Catalog.GetString("_Close Tab");
					w1.Add(CloseTabAction, "<Control>F4");
					Gtk.Action NewFolderAction = new Gtk.Action("NewFolderAction", global::Mono.Unix.Catalog.GetString("New _Folder"), null, null);
					NewFolderAction.ShortLabel = global::Mono.Unix.Catalog.GetString("New _Folder");
					w1.Add(NewFolderAction, "F7");
					Gtk.Action NewFileAction = new Gtk.Action("NewFileAction", null, null, Stock.New);
					w1.Add(NewFileAction, "");
					Gtk.Action SearchAction = new Gtk.Action("SearchAction", Catalog.GetString("_Search"), null, null);
					w1.Add(SearchAction, "<Control>F");
					Gtk.Action RenameAction = new Gtk.Action("RenameAction", Catalog.GetString("_Rename"), null, null);
					w1.Add(RenameAction, "F2");
					Gtk.Action DeleteAction = new Gtk.Action("DeleteAction", null, null, Stock.Delete);
					w1.Add(DeleteAction, "Delete");
					Gtk.Action ExitAction = new Gtk.Action("ExitAction", null, null, Stock.Quit);
					w1.Add(ExitAction, null);
			
					Gtk.Action EditAction = new Gtk.Action("EditAction", global::Mono.Unix.Catalog.GetString ("_Edit"), null, null);
					w1.Add(EditAction, null);
					Gtk.Action CutAction = new Gtk.Action("CutAction", null, null, Stock.Cut);
					w1.Add(CutAction, null);
					Gtk.Action CopyAction = new Gtk.Action("CopyAction", null, null, Stock.Copy);
					w1.Add(CopyAction, null);
					Gtk.Action PasteAction = new Gtk.Action("PasteAction", null, null, Stock.Paste);
					w1.Add(PasteAction, null);
					Gtk.Action SelectAllAction = new Gtk.Action("SelectAllAction", null, null, Stock.SelectAll);
					w1.Add(SelectAllAction, "<Control>a");
					Gtk.Action SelectNoneAction = new Gtk.Action("SelectNoneAction", Catalog.GetString("Select _None"), null, null);
					w1.Add(SelectNoneAction, "<Control><Shift>a");
					Gtk.Action SettingsAction = new Gtk.Action("SettingsAction", null, null, Stock.Preferences);
					w1.Add(SettingsAction, null);
			
					Gtk.Action ViewAction = new Gtk.Action("ViewAction", Catalog.GetString("_View"), null, null);
					w1.Add(ViewAction, null);
					Gtk.Action RefreshAction = new Gtk.Action("RefreshAction", null, null, Stock.Refresh);
					w1.Add(RefreshAction, "F5");
			
					Gtk.Action HelpMenuAction = new Gtk.Action("HelpMenuAction", Catalog.GetString("_Help"), null, null);
					w1.Add(HelpMenuAction, null);
					Gtk.Action HelpAction = new Gtk.Action("HelpAction", null, null, Stock.Help);
					w1.Add(HelpAction, null);
					Gtk.Action AboutAction = new Gtk.Action("AboutAction", null, null, Stock.About);
					w1.Add(AboutAction, null);
			
					uiMgr.InsertActionGroup (w1, 0);
					this.AddAccelGroup (uiMgr.AccelGroup);
					uiMgr.AddUiFromString (
@"<ui><menubar name='menubar1'>
<menu name='FileAction' action='FileAction'><menuitem name='NewTabAction' action='NewTabAction'/><menuitem name='CloseTabAction' action='CloseTabAction'/><separator/>
<menuitem name='NewFolderAction' action='NewFolderAction'/><menu name='NewFileAction' action='NewFileAction'/><separator/>
<menuitem name='SearchAction' action='SearchAction'/><separator/>
<menuitem name='RenameAction' action='RenameAction'/><menuitem name='DeleteAction' action='DeleteAction'/><separator/>
<menuitem name='ExitAction' action='ExitAction'/></menu>
<menu name='EditAction' action='EditAction'><menuitem name='CutAction' action='CutAction'/><menuitem name='CopyAction' action='CopyAction'/><menuitem name='PasteAction' action='PasteAction'/><separator/>
<menuitem name='SelectAllAction' action='SelectAllAction'/><menuitem name='SelectNoneAction' action='SelectNoneAction'/><separator/>
<menuitem name='SettingsAction' action='SettingsAction'/></menu>
<menu name='ViewAction' action='ViewAction'><menuitem name='RefreshAction' action='RefreshAction'/></menu>
<menu name='HelpMenuAction' action='HelpMenuAction'><menuitem name='HelpAction' action='HelpAction'/><menuitem name='AboutAction' action='AboutAction'/></menu>
</menubar></ui>"
			        );
					MenuBar menubar1 = (MenuBar)uiMgr.GetWidget("/menubar1");
					menubar1.Name = "menubar1";
				vbox1.PackStart(menubar1, false, false, 0);
				toolbar = new Toolbar();
					toolbar.Insert(backButton = new ToolButton(Stock.GoBack), 0);
					toolbar.Insert(forwardButton = new ToolButton(Stock.GoForward), 1);
					toolbar.Insert(parentButton = new ToolButton(Stock.GoUp), 2);
					toolbar.Insert(new SeparatorToolItem(), 3);
					toolbar.Insert(computerButton = new ToolButton(Image.NewFromIconName("computer", IconSize.Button), Catalog.GetString("Computer")), 4);
					toolbar.Insert(homeButton = new ToolButton(Stock.Home), 5);
					toolbar.Insert(refreshButton = new ToolButton(Stock.Refresh), 6);
					computerButton.Sensitive = CommonUtil.CanLoadComputer();
					toolbar.Insert(new SeparatorToolItem(), 7);
					toolbar.Insert(cutButton = new ToolButton(Stock.Cut), 8);
					toolbar.Insert(copyButton = new ToolButton(Stock.Copy), 9);
					toolbar.Insert(pasteButton = new ToolButton(Stock.Paste), 10);
					//toolbar.Insert(new ToolButton(Stock.Preferences), 11);
				vbox1.PackStart(toolbar, false, false, 0);
				
			    locationBar = new Entry();
				vbox1.PackStart(locationBar, false, true, 0);
				
				
				nb = new Notebook();
				
				//nb.AppendPage((Widget)CommonUtil.LoadControlInstance(), new Label(""));
				nb.AppendPage((Widget)CommonUtil.LoadControlInstance(), new TabLabel(string.Empty, nb));
				vbox1.PackStart(nb, true, true, 0);
			
			this.Add(vbox1);
			
			this.DeleteEvent += OnDeleteEvent;
			locationBar.Activated += new EventHandler(LoadDirectory);
			nb.SwitchPage += new SwitchPageHandler(OnTabChanged);
			NewTabAction.Activated += new EventHandler(this.OnNewTabActionActivated);
			CloseTabAction.Activated += OnCloseTabActionActivated;
			NewFolderAction.Activated += new EventHandler(this.OnNewFolderActionActivated);
			RenameAction.Activated += OnRenameActionActivated;
			DeleteAction.Activated += OnDeleteActionActivated;
			ExitAction.Activated += OnExitActionActivated;
			CutAction.Activated += OnCutEvent;
			CopyAction.Activated += OnCopyEvent;
			PasteAction.Activated += OnPasteEvent;
			SelectAllAction.Activated += OnSelectAllActionActivated;
			SelectNoneAction.Activated += OnSelectNoneActionActivated;
			SettingsAction.Activated += new EventHandler(this.OnSettingActionActivated);
			RefreshAction.Activated += OnRefreshEvent;
			AboutAction.Activated += OnAboutActionActivated;
			
			backButton.Clicked += new EventHandler(this.OnBackEvent);
			forwardButton.Clicked += new EventHandler(this.OnForwardEvent);
			parentButton.Clicked += new EventHandler(this.OnParentEvent);
			computerButton.Clicked += new EventHandler(this.OnComputerEvent);
			homeButton.Clicked += new EventHandler(this.OnHomeEvent);
			refreshButton.Clicked += new EventHandler(this.OnRefreshEvent);
			cutButton.Clicked += OnCutEvent;
			copyButton.Clicked += OnCopyEvent;
			pasteButton.Clicked += OnPasteEvent;
			CommonUtil.DirectoryChanged += OnDirectoryChanged;
			
			
			CommonUtil.HomeButtonClicked((IDisplayInterfaceControl)nb.CurrentPageWidget);
			while(((IDisplayInterfaceControl)nb.CurrentPageWidget).CurrentLocation == null) Thread.Sleep(100);
			SetActionStates();
			
			
			progress = new ProgressWindow();
			progress.IconList = this.IconList;
			
			this.ShowAll();
		}
        private void SetMenu()
        {
            Gtk.Action rmv;
            UIManager manager;
            ActionGroup g;

            manager= new UIManager();
            g = new ActionGroup("SubCategoriesMenuGroup");

            edit = new Gtk.Action("EditAction",
                                  Mono.Unix.Catalog.GetString("Edit tags"),
                                  null, "gtk-edit");
            rmv = new Gtk.Action("RemoveAction",
                                    Mono.Unix.Catalog.GetString("Remove sub-category"),
                                    null, "gtk-remove");

            g.Add(edit, null);
            g.Add(rmv, null);

            manager.InsertActionGroup(g,0);

            manager.AddUiFromString("<ui>"+
                                    "  <popup action='CategoriesMenu'>"+
                                    "    <menuitem action='EditAction'/>"+
                                    "    <menuitem action='RemoveAction'/>"+
                                    "  </popup>"+
                                    "</ui>");

            menu = manager.GetWidget("/CategoriesMenu") as Menu;

            edit.Activated += OnEdit;
            rmv.Activated += OnRemove;
        }
Beispiel #21
0
		Gtk.Menu CreateMenu ()
		{
			if (menu != null)
				return menu;
			
			var group = new ActionGroup ("Popup");

			var help = new Gtk.Action ("help", GettextCatalog.GetString ("Show Error Reference"),
				GettextCatalog.GetString ("Show Error Reference"), Gtk.Stock.Help);
			help.Activated += OnShowReference;
			group.Add (help, "F1");

			var copy = new Gtk.Action ("copy", GettextCatalog.GetString ("_Copy"),
				GettextCatalog.GetString ("Copy task"), Gtk.Stock.Copy);
			copy.Activated += OnTaskCopied;
			group.Add (copy, "<Control><Mod2>c");

			var jump = new Gtk.Action ("jump", GettextCatalog.GetString ("_Go to"),
				GettextCatalog.GetString ("Go to task"), Gtk.Stock.JumpTo);
			jump.Activated += OnTaskJumpto;
			group.Add (jump);

			var columns = new Gtk.Action ("columns", GettextCatalog.GetString ("Columns"));
			group.Add (columns, null);

			var columnType = new ToggleAction ("columnType", GettextCatalog.GetString ("Type"),
				GettextCatalog.GetString ("Toggle visibility of Type column"), null);
			columnType.Toggled += OnColumnVisibilityChanged;
			columnsActions[columnType] = VisibleColumns.Type;
			group.Add (columnType);

			var columnValidity = new ToggleAction ("columnValidity", GettextCatalog.GetString ("Validity"),
				GettextCatalog.GetString ("Toggle visibility of Validity column"), null);
			columnValidity.Toggled += OnColumnVisibilityChanged;
			columnsActions[columnValidity] = VisibleColumns.Marked;
			group.Add (columnValidity);

			var columnLine = new ToggleAction ("columnLine", GettextCatalog.GetString ("Line"),
				GettextCatalog.GetString ("Toggle visibility of Line column"), null);
			columnLine.Toggled += OnColumnVisibilityChanged;
			columnsActions[columnLine] = VisibleColumns.Line;
			group.Add (columnLine);

			var columnDescription = new ToggleAction ("columnDescription", GettextCatalog.GetString ("Description"),
				GettextCatalog.GetString ("Toggle visibility of Description column"), null);
			columnDescription.Toggled += OnColumnVisibilityChanged;
			columnsActions[columnDescription] = VisibleColumns.Description;
			group.Add (columnDescription);

			var columnFile = new ToggleAction ("columnFile", GettextCatalog.GetString ("File"),
				GettextCatalog.GetString ("Toggle visibility of File column"), null);
			columnFile.Toggled += OnColumnVisibilityChanged;
			columnsActions[columnFile] = VisibleColumns.File;
			group.Add (columnFile);

			var columnProject = new ToggleAction ("columnProject", GettextCatalog.GetString ("Project"),
				GettextCatalog.GetString ("Toggle visibility of Project column"), null);
			columnProject.Toggled += OnColumnVisibilityChanged;
			columnsActions[columnProject] = VisibleColumns.Project;
			group.Add (columnProject);

			var columnPath = new ToggleAction ("columnPath", GettextCatalog.GetString ("Path"),
				GettextCatalog.GetString ("Toggle visibility of Path column"), null);
			columnPath.Toggled += OnColumnVisibilityChanged;
			columnsActions[columnPath] = VisibleColumns.Path;
			group.Add (columnPath);

			var uiManager = new UIManager ();
			uiManager.InsertActionGroup (group, 0);
			
			string uiStr = "<ui><popup name='popup'>"
				+ "<menuitem action='help'/>"
				+ "<menuitem action='copy'/>"
				+ "<menuitem action='jump'/>"
				+ "<separator/>"
				+ "<menu action='columns'>"
				+ "<menuitem action='columnType' />"
				+ "<menuitem action='columnValidity' />"
				+ "<menuitem action='columnLine' />"
				+ "<menuitem action='columnDescription' />"
				+ "<menuitem action='columnFile' />"
				+ "<menuitem action='columnProject' />"
				+ "<menuitem action='columnPath' />"
				+ "</menu>"
				+ "</popup></ui>";

			uiManager.AddUiFromString (uiStr);
			menu = (Menu)uiManager.GetWidget ("/popup");
			menu.ShowAll ();

			menu.Shown += delegate {
				columnType.Active = view.Columns[VisibleColumns.Type].Visible;
				columnValidity.Active = view.Columns[VisibleColumns.Marked].Visible;
				columnLine.Active = view.Columns[VisibleColumns.Line].Visible;
				columnDescription.Active = view.Columns[VisibleColumns.Description].Visible;
				columnFile.Active = view.Columns[VisibleColumns.File].Visible;
				columnProject.Active = view.Columns[VisibleColumns.Project].Visible;
				columnPath.Active = view.Columns[VisibleColumns.Path].Visible;
				help.Sensitive = copy.Sensitive = jump.Sensitive =
					view.Selection != null &&
					view.Selection.CountSelectedRows () > 0 &&
					(columnType.Active ||
						columnValidity.Active ||
						columnLine.Active ||
						columnDescription.Active ||
						columnFile.Active ||
						columnPath.Active);
			};
			
			return menu;
		}
Beispiel #22
0
		public static int Main3 (string[] args)
		{
			Application.Init ();
			Window win = new Window ("Action Demo");
			win.DefaultSize = new Gdk.Size (200, 150);
			win.DeleteEvent += new DeleteEventHandler (OnWindowDelete);
			
			box = new VBox (false, 0);
			win.Add (box);
			
			group = new ActionGroup ("TestActions");
			group.Add (entries);
			group.Add (toggleEntries);
			group.Add (radioEntries, (int)Justify.Left, new ChangedHandler (OnRadio));
			group.Add (toolbarEntries, (int)ToolbarStyle.BothHoriz, new ChangedHandler (OnToolbarStyle));
			
			uim = new UIManager ();
			uim.AddWidget += new AddWidgetHandler (OnWidgetAdd);
			uim.ConnectProxy += new ConnectProxyHandler (OnProxyConnect);
			uim.InsertActionGroup (group, 0);
			uim.AddUiFromString (ui_info);
			
			statusbar = new Statusbar ();
			box.PackEnd (statusbar, false, true, 0);

			VBox vbox = new VBox (false, 5);
			Button button = new Button ("Blah");
			vbox.PackEnd (button, true, true, 0);
			HBox hbox = new HBox (false, 5);
			spin = new SpinButton (new Adjustment (100, 100, 10000, 1, 100, 100), 100, 0);
			hbox.PackStart (spin, true, true, 0);
			button = new Button ("Remove");
			button.Clicked += new EventHandler (OnDynamicRemove);
			hbox.PackEnd (button, false, false, 0);
			button = new Button ("Add");
			button.Clicked += new EventHandler (OnDynamicAdd);
			hbox.PackEnd (button, false, false, 0);
			vbox.PackEnd (hbox, false, false, 0);
			box.PackEnd (vbox, true, true, 0);

			win.ShowAll ();
			Application.Run ();
			return 0;
		}