Example #1
0
 public void AllToFront(AppWindowInfo main)
 {
     foreach (AppWindowInfo w in windows)
     {
         w.AppWindow.Present();
     }
     main.AppWindow.Present();
 }
Example #2
0
 public void ShowAll(AppWindowInfo main)
 {
     foreach (Window w in Window.ListToplevels())
     {
         w.Present();
     }
     main.AppWindow.Present();
 }
Example #3
0
 public void HideOthers(AppWindowInfo main)
 {
     foreach (Window w in Window.ListToplevels())
     {
         w.Iconify();
     }
     AllToFront(main);
 }
Example #4
0
        public void ActivateNext(AppWindowInfo win)
        {
            int cur  = windows.IndexOf(win);
            int next = cur + 1;

            if (next == windows.Count)
            {
                next = 0;
            }
            AppWindowInfo w = (AppWindowInfo)windows[next];

            w.AppWindow.Present();
        }
Example #5
0
        public void ActivatePrevious(AppWindowInfo win)
        {
            int cur  = windows.IndexOf(win);
            int prev = cur - 1;

            if (prev == -1)
            {
                prev = windows.Count - 1;
            }
            AppWindowInfo w = (AppWindowInfo)windows[prev];

            w.AppWindow.Present();
        }
Example #6
0
        private void InitWindowMenu(AppWindowInfo window)
        {
            Console.WriteLine("creating window menu");
            Menu m = (Menu)window.WindowMenu.Submenu;
            int  i = 0;

            foreach (AppWindowInfo w in windows)
            {
                MenuItem r = CreateMenuItem(w.Title, i++);
                m.Append(r);
            }
            window.WindowMenu.ShowAll();
        }
Example #7
0
        private void AddWindowMenu(AppWindowInfo w, string title)
        {
            Console.WriteLine("adding window menu: " + title);
            windows.Add(w);
            int n = windows.IndexOf(w);

            foreach (AppWindowInfo d in windows)
            {
                Menu     m  = (Menu)d.WindowMenu.Submenu;
                MenuItem mi = CreateMenuItem(title, n);
                m.Append(mi);
                d.WindowMenu.ShowAll();
            }
        }
Example #8
0
        public void Remove(AppWindowInfo window)
        {
            int me = windows.IndexOf(window);

            windows.RemoveAt(me);

            SyncWindowMenu();

            window.AppWindow.Destroy();

            if (windows.Count == 0)
            {
                Application.Quit();
            }
        }
Example #9
0
        private void UpdateMenuItem(MenuItem mi, string title, int accel)
        {
            ((Label)mi.Child).Text = title;

            /*
             * foreach (Label l in mi.Children) {
             *      // Console.WriteLine ("    updating menu item; was={0}; is={1}",
             *      //      l.Text, title);
             *      l.Text = title;
             * }
             */
            AppWindowInfo d = (AppWindowInfo)windows[accel];

            // TODO: clear out mi.Activated, so we don't have lots of windows try to
            // present themselves...
            mi.Activated += new EventHandler(d.OnPresentWindow);
        }
Example #10
0
        public void Add(AppWindowInfo window)
        {
            if (windows.Count == 0)
            {
                Application.Init();

                window_offset = ((Menu)window.WindowMenu.Submenu).Children.Length - 1;
            }

            foreach (Label l in window.AppMenu.Children)
            {
                l.UseMarkup          = true;
                l.UseUnderline       = true;
                l.MarkupWithMnemonic =
                    string.Format("<span weight=\"heavy\">{0}</span>", AppName);
            }

            InitWindowMenu(window);
            AddWindowMenu(window, "unknown");
        }
Example #11
0
		private void InitWindowMenu (AppWindowInfo window)
		{
			Console.WriteLine ("creating window menu");
			Menu m = (Menu) window.WindowMenu.Submenu;
			int i = 0;
			foreach (AppWindowInfo w in windows) {
				MenuItem r = CreateMenuItem (w.Title, i++);
				m.Append (r);
			}
			window.WindowMenu.ShowAll ();
		}
Example #12
0
 public void SetTitle(AppWindowInfo window, string title)
 {
     window.SetTitle(title);
     SyncWindowMenu();
 }
Example #13
0
		public void Add (AppWindowInfo window)
		{
			if (windows.Count == 0) {
				Application.Init ();

				window_offset = ((Menu) window.WindowMenu.Submenu).Children.Length - 1;
			}

			foreach (Label l in window.AppMenu.Children) {
				l.UseMarkup = true;
				l.UseUnderline = true;
				l.MarkupWithMnemonic = 
					string.Format ("<span weight=\"heavy\">{0}</span>", AppName);
			}

			InitWindowMenu (window);
			AddWindowMenu (window, "unknown");
		}
Example #14
0
		public void Remove (AppWindowInfo window)
		{
			int me = windows.IndexOf (window);
			windows.RemoveAt (me);

			SyncWindowMenu ();

			window.AppWindow.Destroy ();

			if (windows.Count == 0)
				Application.Quit ();
		}
Example #15
0
		public void ActivateNext (AppWindowInfo win)
		{
			int cur = windows.IndexOf (win);
			int next = cur+1;
			if (next == windows.Count)
				next = 0;
			AppWindowInfo w = (AppWindowInfo) windows[next];
			w.AppWindow.Present ();
		}
Example #16
0
		public void ActivatePrevious (AppWindowInfo win)
		{
			int cur = windows.IndexOf (win);
			int prev = cur-1;
			if (prev == -1)
				prev = windows.Count - 1;
			AppWindowInfo w = (AppWindowInfo) windows[prev];
			w.AppWindow.Present ();
		}
Example #17
0
		public void AllToFront (AppWindowInfo main)
		{
			foreach (AppWindowInfo w in windows)
				w.AppWindow.Present ();
			main.AppWindow.Present ();
		}
Example #18
0
		public void ShowAll (AppWindowInfo main)
		{
			foreach (Window w in Window.ListToplevels()) {
				w.Present ();
			}
			main.AppWindow.Present ();
		}
Example #19
0
		public override void InitializeInterface ()
		{
			Glade.XML gxml = new Glade.XML (null, "type-reflector.glade", "main_window", null);
			try {
				gxml.Autoconnect (this);
			} catch (Exception e) {
				Trace.WriteLineIf (info.TraceError, 
					"Error with glade: " + e.ToString());
				throw;
			}

			memberStore = new TreeStore (typeof (TreeCell));
			treeView.Model = memberStore;

			treeView.RowExpanded += new RowExpandedHandler (OnRowExpanded);

			TreeViewColumn column = new TreeViewColumn ();

			column.Title = "Type Information";

#if SHOW_ICONS
			CellRenderer image = new CellRendererPixbuf ();
			column.PackStart (image, false);
			// column.AddAttribute (image, "pixbuf", 2);
			column.SetCellDataFunc (image, new Gtk.TreeCellDataFunc (OnRenderCellIcon));
#endif

			CellRenderer text = new CellRendererText ();
			column.PackStart (text, true);
			column.SetCellDataFunc (text, new Gtk.TreeCellDataFunc (OnRenderCellText));

			treeView.AppendColumn (column);

			CreateOptions ();
			CreateFormatters ();
			CreateFinders ();

			// mark certain menu entries as disabled
			string[] menus = {
				"button_preferences",
				"reflector_preferences", 
				"file_close", "file_save", "file_save_as",
				"edit_copy", 
				// "edit_find",
				"edit_find_panel", "edit_find_next", "edit_find_prev", 
				"edit_find_selection",
				// "window_new", "window_next", "window_prev", 
				// "window_all_to_front",
				"help_manual"
			};
			foreach (string m in menus) {
				Widget menu = (Widget) gxml[m];
				menu.Sensitive = false;
			}

			appWindowInfo = new AppWindowInfo ();
			appWindowInfo.AppWindow = mainWindow;
			appWindowInfo.AppMenu = reflector_menu;
			appWindowInfo.WindowMenu = window;
			appWindowInfo.FullscreenMenu = window_fullscreen;
			appWindowInfo.MaximizeMenu = window_maximize;

			appWindows.Add (appWindowInfo);

			Drag.DestSet (mainWindow, DestDefaults.All, accept_table, Gdk.DragAction.Copy);
			mainWindow.DragDataReceived += new DragDataReceivedHandler (OnDropFiles);

			mainWindow.ShowAll ();

			// Allow the interface to be fully rendered.  If we don't do this, and
			// we do (e.g.) --load-default-assemblies, then the UI will be
			// incompletely rendered until AddType is called, which could be awhile.
			while (GLib.MainContext.Iteration())
				;
		}
Example #20
0
		public void HideOthers (AppWindowInfo main)
		{
			foreach (Window w in Window.ListToplevels())
				w.Iconify ();
			AllToFront (main);
		}
Example #21
0
		public void SetTitle (AppWindowInfo window, string title)
		{
			window.SetTitle (title);
			SyncWindowMenu ();
		}
Example #22
0
		private void AddWindowMenu (AppWindowInfo w, string title)
		{
			Console.WriteLine ("adding window menu: " + title);
			windows.Add (w);
			int n = windows.IndexOf (w);
			foreach (AppWindowInfo d in windows) {
				Menu m = (Menu) d.WindowMenu.Submenu;
				MenuItem mi = CreateMenuItem (title, n);
				m.Append (mi);
				d.WindowMenu.ShowAll ();
			}
		}
Example #23
0
        public override void InitializeInterface()
        {
            Glade.XML gxml = new Glade.XML(null, "type-reflector.glade", "main_window", null);
            try {
                gxml.Autoconnect(this);
            } catch (Exception e) {
                Trace.WriteLineIf(info.TraceError,
                                  "Error with glade: " + e.ToString());
                throw;
            }

            memberStore    = new TreeStore(typeof(TreeCell));
            treeView.Model = memberStore;

            treeView.RowExpanded += new RowExpandedHandler(OnRowExpanded);

            TreeViewColumn column = new TreeViewColumn();

            column.Title = "Type Information";

#if SHOW_ICONS
            CellRenderer image = new CellRendererPixbuf();
            column.PackStart(image, false);
            // column.AddAttribute (image, "pixbuf", 2);
            column.SetCellDataFunc(image, new Gtk.TreeCellDataFunc(OnRenderCellIcon));
#endif

            CellRenderer text = new CellRendererText();
            column.PackStart(text, true);
            column.SetCellDataFunc(text, new Gtk.TreeCellDataFunc(OnRenderCellText));

            treeView.AppendColumn(column);

            CreateOptions();
            CreateFormatters();
            CreateFinders();

            // mark certain menu entries as disabled
            string[] menus =
            {
                "button_preferences",
                "reflector_preferences",
                "file_close",           "file_save",       "file_save_as",
                "edit_copy",
                // "edit_find",
                "edit_find_panel",      "edit_find_next",  "edit_find_prev",
                "edit_find_selection",
                // "window_new", "window_next", "window_prev",
                // "window_all_to_front",
                "help_manual"
            };
            foreach (string m in menus)
            {
                Widget menu = (Widget)gxml[m];
                menu.Sensitive = false;
            }

            appWindowInfo                = new AppWindowInfo();
            appWindowInfo.AppWindow      = mainWindow;
            appWindowInfo.AppMenu        = reflector_menu;
            appWindowInfo.WindowMenu     = window;
            appWindowInfo.FullscreenMenu = window_fullscreen;
            appWindowInfo.MaximizeMenu   = window_maximize;

            appWindows.Add(appWindowInfo);

            Drag.DestSet(mainWindow, DestDefaults.All, accept_table, Gdk.DragAction.Copy);
            mainWindow.DragDataReceived += new DragDataReceivedHandler(OnDropFiles);

            mainWindow.ShowAll();

            // Allow the interface to be fully rendered.  If we don't do this, and
            // we do (e.g.) --load-default-assemblies, then the UI will be
            // incompletely rendered until AddType is called, which could be awhile.
            while (GLib.MainContext.Iteration())
            {
                ;
            }
        }