public void AllToFront(AppWindowInfo main) { foreach (AppWindowInfo w in windows) { w.AppWindow.Present(); } main.AppWindow.Present(); }
public void ShowAll(AppWindowInfo main) { foreach (Window w in Window.ListToplevels()) { w.Present(); } main.AppWindow.Present(); }
public void HideOthers(AppWindowInfo main) { foreach (Window w in Window.ListToplevels()) { w.Iconify(); } AllToFront(main); }
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(); }
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(); }
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(); }
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(); } }
public void Remove(AppWindowInfo window) { int me = windows.IndexOf(window); windows.RemoveAt(me); SyncWindowMenu(); window.AppWindow.Destroy(); if (windows.Count == 0) { Application.Quit(); } }
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); }
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"); }
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 (); }
public void SetTitle(AppWindowInfo window, string title) { window.SetTitle(title); SyncWindowMenu(); }
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"); }
public void Remove (AppWindowInfo window) { int me = windows.IndexOf (window); windows.RemoveAt (me); SyncWindowMenu (); window.AppWindow.Destroy (); if (windows.Count == 0) Application.Quit (); }
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 (); }
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 (); }
public void AllToFront (AppWindowInfo main) { foreach (AppWindowInfo w in windows) w.AppWindow.Present (); main.AppWindow.Present (); }
public void ShowAll (AppWindowInfo main) { foreach (Window w in Window.ListToplevels()) { w.Present (); } main.AppWindow.Present (); }
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()) ; }
public void HideOthers (AppWindowInfo main) { foreach (Window w in Window.ListToplevels()) w.Iconify (); AllToFront (main); }
public void SetTitle (AppWindowInfo window, string title) { window.SetTitle (title); SyncWindowMenu (); }
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 (); } }
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()) { ; } }