public lessee() { this.Build (); GoodsNull = true; grup = new AccelGroup (); this.AddAccelGroup(grup); //Создаем таблицу "Договора" ContractsListStore = new Gtk.ListStore (typeof(int), typeof (bool), typeof (string), typeof (string), typeof (string), typeof (int), typeof (string), typeof (string), typeof (string), typeof (int), typeof (string), typeof (string)); treeviewContracts.AppendColumn("Акт.", new Gtk.CellRendererToggle (), "active", 1); treeviewContracts.AppendColumn ("с", new Gtk.CellRendererText (), "text", 2); treeviewContracts.AppendColumn ("по", new Gtk.CellRendererText (), "text", 3); treeviewContracts.AppendColumn ("Договор", new Gtk.CellRendererText (), "text", 4); treeviewContracts.AppendColumn ("Место", new Gtk.CellRendererText (), "text", 7); treeviewContracts.AppendColumn ("Площадь", new Gtk.CellRendererText (), "text", 8); treeviewContracts.AppendColumn ("Контактное лицо", new Gtk.CellRendererText (), "text", 10); treeviewContracts.AppendColumn ("Расторгнут", new Gtk.CellRendererText (), "text", 11); treeviewContracts.Model = ContractsListStore; treeviewContracts.ShowAll(); }
Gtk.MenuBar CreateMenus () { AccelGroup group = new AccelGroup (); MenuBar bar = new MenuBar (); Menu file_menu = new Menu (); MenuItem file_menu_item = new MenuItem ("_File"); file_menu_item.Submenu = file_menu; ImageMenuItem file_exit = new ImageMenuItem (Gtk.Stock.Quit, group); file_exit.Activated += new EventHandler (exit_cb); file_menu.Append (file_exit); bar.Append (file_menu_item); Menu help_menu = new Menu (); ImageMenuItem help_menu_item = new ImageMenuItem (Gtk.Stock.Help, group); help_menu_item.Submenu = help_menu; ImageMenuItem file_help = new ImageMenuItem (Gnome.Stock.About, group); file_help.Activated += new EventHandler (about_cb); help_menu.Append (file_help); bar.Append (help_menu_item); bar.ShowAll (); return bar; }
public AppMenu(DebugManager mgr, AccelGroup agr, Settings set, Window parent, DebugPane pane, string argsOverride) { settings = set; debugPane = pane; debugManager = mgr; menuBar = new MenuBar(); preferences = new PreferencesDialog(set, parent, argsOverride); menuBar.Append(CreateFileMenu(agr)); menuBar.Append(CreateEditMenu(agr)); menuBar.Append(CreateViewMenu(agr)); menuBar.Append(CreateDebuggerMenu(agr)); menuBar.Append(CreateHelpMenu(agr)); debugManager.DebuggerBusy += OnDebuggerBusy; debugManager.DebuggerReady += OnDebuggerReady; debugManager.DebuggerStarted += OnDebuggerStarted; debugManager.DebuggerExited += OnDebuggerExited; menuBar.Destroyed += OnDestroy; debuggerStop.Sensitive = false; debuggerInterrupt.Sensitive = false; foreach (MenuItem m in commandMacros) m.Sensitive = false; }
/// <summary> /// Create a global keybinder for the given Gtk.AccelGroup. /// </summary> /// </param> public GlobalKeybinder(Gtk.AccelGroup accel_group) { this.accel_group = accel_group; fake_menu = new Gtk.Menu (); fake_menu.AccelGroup = accel_group; }
private void createButtons() { FakeButtonCloseSerialPort = new Gtk.Button(); Gtk.Button button_close_serial_port = new Gtk.Button("Close serial port (debug)"); button_close_serial_port.Clicked += new EventHandler(on_button_close_serial_port_clicked); Gtk.Button button_OSX_readme = new Gtk.Button("MacOSX Readme"); button_OSX_readme.Clicked += new EventHandler(on_button_OSX_readme_clicked); //---- button close start ---> Gtk.Button button_close = new Gtk.Button("Close Window"); button_close.Clicked += new EventHandler(on_button_close_clicked); Gtk.AccelGroup ag = new Gtk.AccelGroup(); //button can be called clicking Escape key chronopic_register_win.AddAccelGroup(ag); button_close.AddAccelerator ("activate", ag, new Gtk.AccelKey (Gdk.Key.Escape, Gdk.ModifierType.None, Gtk.AccelFlags.Visible)); //<---- button close end //add buttons to containers Gtk.HButtonBox hbox = new Gtk.HButtonBox(); //hbox.Add(button_close_serial_port); if (UtilAll.GetOSEnum() == UtilAll.OperatingSystems.MACOSX) { hbox.Add(button_OSX_readme); } hbox.Add(button_close); vbox_main.Add(hbox); }
public PodcastSubscribeDialog() : base(Catalog.GetString("Subscribe"), null, DialogFlags.Modal) { accelGroup = new Gtk.AccelGroup(); AddAccelGroup (accelGroup); BuildWindow (); }
private void ShowPopup(Gdk.EventButton evnt) { Gtk.AccelGroup grp = new Gtk.AccelGroup(); Gtk.Menu menu = new Gtk.Menu(); menu.Show(); menu.AccelGroup = grp; MenuItem item; item = new MenuItem("Add"); item.AccelPath = "<CdnStudio>/Widgets/Editors/Properties/Add"; AccelMap.AddEntry("<CdnStudio>/Widgets/Editors/Properties/Add", (uint)Gdk.Key.KP_Add, Gdk.ModifierType.None); item.Show(); item.Activated += DoAddProperty; menu.Append(item); item = new MenuItem("Remove"); item.AccelPath = "<CdnStudio>/Widgets/Editors/Properties/Remove"; item.Show(); AccelMap.AddEntry("<CdnStudio>/Widgets/Editors/Properties/Remove", (uint)Gdk.Key.KP_Subtract, Gdk.ModifierType.None); item.Sensitive = (d_treeview.Selection.CountSelectedRows() > 0); item.Activated += DoRemoveProperty; menu.Append(item); menu.Popup(null, null, null, evnt.Button, evnt.Time); }
static void AccelChanged_cb(IntPtr inst, uint keyval, int modifier, IntPtr accel_closure) { try { AccelGroup __obj = GLib.Object.GetObject(inst, false) as AccelGroup; __obj.OnAccelChanged(keyval, (Gdk.ModifierType)modifier, accel_closure); } catch (Exception e) { GLib.ExceptionManager.RaiseUnhandledException(e, false); } }
public PodcastSubscribeDialog() : base( Catalog.GetString("Subscribe"), null, DialogFlags.Modal | DialogFlags.NoSeparator) { IconThemeUtils.SetWindowIcon(this); accel_group = new Gtk.AccelGroup(); AddAccelGroup(accel_group); BuildWindow(); }
public PodcastSubscribeDialog() : base(Catalog.GetString("Subscribe"), null, DialogFlags.Modal | DialogFlags.NoSeparator) { IconThemeUtils.SetWindowIcon (this); accel_group = new Gtk.AccelGroup(); AddAccelGroup (accel_group); BuildWindow (); }
public static AccelGroup[] GroupsFromObject(GLib.Object obj) { IntPtr raw_ret = gtk_accel_groups_from_object(obj.Handle); if (raw_ret == IntPtr.Zero) return new AccelGroup [0]; GLib.SList list = new GLib.SList(raw_ret); AccelGroup[] result = new AccelGroup [list.Count]; for (int i = 0; i < list.Count; i++) result [i] = list [i] as AccelGroup; return result; }
static bool AccelActivate_cb(IntPtr inst, IntPtr acceleratable, uint keyval, int modifier) { try { AccelGroup __obj = GLib.Object.GetObject(inst, false) as AccelGroup; bool __result; __result = __obj.OnAccelActivate(GLib.Object.GetObject(acceleratable), keyval, (Gdk.ModifierType)modifier); return(__result); } catch (Exception e) { GLib.ExceptionManager.RaiseUnhandledException(e, true); // NOTREACHED: above call does not return. throw e; } }
public ActionManager() { AccelGroup = new AccelGroup (); File = new FileActions (); Edit = new EditActions (); View = new ViewActions (); Image = new ImageActions (); Layers = new LayerActions (); Adjustments = new AdjustmentsActions (); Effects = new EffectsActions (); Help = new HelpActions (); }
private void createButtons() { Frame frame = new Frame(); frame.ShadowType = ShadowType.In; frame.LabelXalign = 0f; frame.LabelYalign = 0.5f; frame.Label = Catalog.GetString("There is a known problem on macOS:"); Gtk.Label label_macOS = new Gtk.Label( Catalog.GetString("If Chronopic is disconnected after jumps or runs execution,\nthat port will be blocked until restart of machine.")); Gtk.VBox vbox_m = new Gtk.VBox(); vbox_m.PackStart(label_macOS, false, false, 8); Gtk.HBox hbox_m = new Gtk.HBox(); hbox_m.PackStart(vbox_m, false, false, 8); if (UtilAll.GetOSEnum() == UtilAll.OperatingSystems.MACOSX) { frame.Add(hbox_m); vbox_main.Add(frame); } FakeButtonCloseSerialPort = new Gtk.Button(); Gtk.Button button_close_serial_port = new Gtk.Button("Close serial port (debug)"); button_close_serial_port.Clicked += new EventHandler(on_button_close_serial_port_clicked); //---- button close start ---> Gtk.Button button_close = new Gtk.Button("Close Window"); button_close.CanFocus = true; button_close.IsFocus = true; button_close.Clicked += new EventHandler(on_button_close_clicked); Gtk.AccelGroup ag = new Gtk.AccelGroup(); //button can be called clicking Escape key chronopic_register_win.AddAccelGroup(ag); button_close.AddAccelerator ("activate", ag, new Gtk.AccelKey (Gdk.Key.Escape, Gdk.ModifierType.None, Gtk.AccelFlags.Visible)); //<---- button close end //add buttons to containers Gtk.HButtonBox hbox = new Gtk.HButtonBox(); //hbox.Add(button_close_serial_port); hbox.Add(button_close); vbox_main.Add(hbox); }
public CsBoardApp(string engine, string filename) : base(engine, filename) { title = String.Format (Catalog. GetString ("Welcome to CS Board ({0})"), control.Name); csboardWindow.Title = title; instance = this; subapps = new ArrayList (); subAppsMap = new Hashtable (); accel = new AccelGroup (); csboardWindow.AddAccelGroup (accel); Gtk.Image img = new Gtk.Image (Gdk.Pixbuf. LoadFromResource ("computer.png")); img.Show (); playerToolButton.IconWidget = img; subapps.Add (this); playerToolButton.Sensitive = false; TitleChangedEvent += OnAppTitleChanged; AddApp (CsBoard.ICS.ICSDetailsWidget.Instance); CsBoard.Viewer.GameViewer.CreateInstance (); playerToolButton.Clicked += OnToolButtonClicked; if (filename == null) { control.OpenGame (App.Session.Filename); ShowAppFromLastSession (); } else { ShowApp (CsBoard.Viewer.GameViewer. Instance); GLib.Idle.Add (delegate { CsBoard.Viewer.GameViewer. Instance.Load (filename); return false;} ); } chessGameWidget.Show (); boardWidget.Show (); csboardWindow.Show (); }
public DaapLoginDialog(string shareName, bool showUsername) : base(Catalog.GetString("Login to Music Share"), null, DialogFlags.Modal, Stock.Cancel, ResponseType.Close) { share_name = shareName; show_username = showUsername; //IconThemeUtils.SetWindowIcon(this); accel_group = new Gtk.AccelGroup(); AddAccelGroup(accel_group); BuildWindow(); }
public DaapLoginDialog(string shareName, bool showUsername) : base( Catalog.GetString("Login to Music Share"), null, DialogFlags.Modal | DialogFlags.NoSeparator, Stock.Cancel, ResponseType.Close) { share_name = shareName; show_username = showUsername; //IconThemeUtils.SetWindowIcon(this); accel_group = new Gtk.AccelGroup(); AddAccelGroup(accel_group); BuildWindow(); }
public VersionInformationDialog() : base() { AccelGroup accel_group = new AccelGroup(); AddAccelGroup(accel_group); Modal = true; Button button = new Button("gtk-close"); button.CanDefault = true; button.UseStock = true; button.Show(); DefaultResponse = ResponseType.Close; button.AddAccelerator("activate", accel_group, (uint)Gdk.Key.Escape, 0, Gtk.AccelFlags.Visible); AddActionWidget(button, ResponseType.Close); Title = Catalog.GetString("Assembly Version Information"); BorderWidth = 10; version_tree = new TreeView(); version_tree.RulesHint = true; version_tree.AppendColumn(Catalog.GetString("Assembly Name"), new CellRendererText(), "text", 0); version_tree.AppendColumn(Catalog.GetString("Version"), new CellRendererText(), "text", 1); version_tree.Model = FillStore(); version_tree.CursorChanged += OnCursorChanged; ScrolledWindow scroll = new ScrolledWindow(); scroll.Add(version_tree); scroll.ShadowType = ShadowType.In; scroll.SetSizeRequest(420, 200); ContentArea.PackStart(scroll, true, true, 0); ContentArea.Spacing = 5; path_label = new Label(); path_label.Ellipsize = Pango.EllipsizeMode.End; path_label.Hide(); path_label.Xalign = 0.0f; path_label.Yalign = 1.0f; ContentArea.PackStart(path_label, false, true, 0); scroll.ShowAll(); }
public static AccelGroup[] GroupsFromObject(GLib.Object obj) { IntPtr raw_ret = gtk_accel_groups_from_object(obj.Handle); if (raw_ret == IntPtr.Zero) { return(new AccelGroup [0]); } GLib.SList list = new GLib.SList(raw_ret); AccelGroup[] result = new AccelGroup [list.Count]; for (int i = 0; i < list.Count; i++) { result [i] = list [i] as AccelGroup; } return(result); }
public DemoMenus () : base ("Menus") { AccelGroup accel_group = new AccelGroup (); AddAccelGroup (accel_group); VBox box1 = new VBox (false, 0); Add (box1); MenuBar menubar = new MenuBar (); box1.PackStart (menubar, false, true, 0); MenuItem menuitem = new MenuItem ("test\nline2"); menuitem.Submenu = CreateMenu (2, true); menubar.Append (menuitem); MenuItem menuitem1 = new MenuItem ("foo"); menuitem1.Submenu = CreateMenu (3, true); menubar.Append (menuitem1); menuitem = new MenuItem ("bar"); menuitem.Submenu = CreateMenu (4, true); menuitem.RightJustified = true; menubar.Append (menuitem); VBox box2 = new VBox (false, 10); box2.BorderWidth = 10; box1.PackStart (box2, false, true, 0); Button close = new Button ("close"); close.Clicked += new EventHandler (CloseClicked); box2.PackStart (close, true, true, 0); close.CanDefault = true; close.GrabDefault (); ShowAll (); }
public App(Settings set, DebugManager mgr, string argsOverride) { settings = set; debugPane = new DebugPane(set, mgr); AccelGroup agr = new AccelGroup(); menu = new AppMenu(mgr, agr, set, mainWin, debugPane, argsOverride); toolbar = new AppToolbar(mgr, debugPane); VBox vb = new VBox(false, 3); mainWin.Resize(settings.WindowWidth, settings.WindowHeight); mainWin.DeleteEvent += (obj, evt) => Application.Quit(); mainWin.AddAccelGroup(agr); vb.PackStart(menu.View, false, false, 0); vb.PackStart(toolbar.View, false, false, 0); vb.PackEnd(debugPane.View, true, true, 0); mainWin.Add(vb); mainWin.DeleteEvent += OnDeleteEvent; mainWin.ShowAll(); }
public Place(bool New) { this.Build (); ComboWorks.ComboFillReference(comboPType,"place_types", ComboWorks.ListMode.WithNo); ComboWorks.ComboFillReference(comboOrg, "organizations", ComboWorks.ListMode.WithNo); contactNull = true; NewPlace = New; grup = new AccelGroup (); this.AddAccelGroup(grup); //Создаем таблицу "История" HistoryStore = new Gtk.ListStore (typeof(int), typeof (string), typeof (string), typeof (string), typeof (string), typeof (int), typeof (string), typeof (string)); Gtk.TreeViewColumn CommentsColumn = new Gtk.TreeViewColumn (); CommentsColumn.Title = "Комментарии"; Gtk.CellRendererText CommentsCell = new Gtk.CellRendererText (); CommentsCell.WrapMode = Pango.WrapMode.WordChar; CommentsCell.WrapWidth = 500; CommentsColumn.MaxWidth = 500; CommentsColumn.PackStart (CommentsCell, true); treeviewHistory.AppendColumn ("Договор", new Gtk.CellRendererText (), "text", 1); treeviewHistory.AppendColumn ("с", new Gtk.CellRendererText (), "text", 2); treeviewHistory.AppendColumn ("по", new Gtk.CellRendererText (), "text", 3); treeviewHistory.AppendColumn ("Расторгнут", new Gtk.CellRendererText (), "text", 4); treeviewHistory.AppendColumn ("Арендатор", new Gtk.CellRendererText (), "text", 6); treeviewHistory.AppendColumn(CommentsColumn); CommentsColumn.AddAttribute(CommentsCell, "text" , 7); treeviewHistory.Model = HistoryStore; treeviewHistory.ShowAll(); if(New) notebookMain.GetNthPage (1).Hide (); //FIXME отключил вкладку что бы пользователь не мог создавать счетчики у не записаного места, надо исправить. }
public ProfileConfigurationDialog(Profile profile) : base() { this.profile = profile; BorderWidth = 5; AccelGroup accel_group = new AccelGroup(); AddAccelGroup(accel_group); Button button = new Button(Stock.Close); button.CanDefault = true; button.Show(); if(ApplicationContext.Debugging) { Button test_button = new Button("Test S-Expr"); test_button.Show(); test_button.Clicked += delegate { if(sexpr_results != null) { sexpr_results.Buffer.Text = profile.Pipeline.GetDefaultProcess(); } }; ActionArea.PackStart(test_button, true, true, 0); sexpr_results = new TextView(); } AddActionWidget(button, ResponseType.Close); DefaultResponse = ResponseType.Close; button.AddAccelerator("activate", accel_group, (uint)Gdk.Key.Return, 0, AccelFlags.Visible); BuildContents(); LoadProfile(); }
private void createButtons() { label_macOSX = new Gtk.Label(); label_macOSX.Text = Catalog.GetString("There is a known problem with MacOSX:") + "\n" + Catalog.GetString("If Chronopic is disconnected after jumps or runs execution,\nthat port will be blocked until restart of machine.") + "\n\n" + Catalog.GetString("We are working on a solution."); if (UtilAll.GetOSEnum() == UtilAll.OperatingSystems.MACOSX) { vbox_main.Add(label_macOSX); } FakeButtonCloseSerialPort = new Gtk.Button(); Gtk.Button button_close_serial_port = new Gtk.Button("Close serial port (debug)"); button_close_serial_port.Clicked += new EventHandler(on_button_close_serial_port_clicked); //---- button close start ---> Gtk.Button button_close = new Gtk.Button("Close Window"); button_close.Clicked += new EventHandler(on_button_close_clicked); Gtk.AccelGroup ag = new Gtk.AccelGroup(); //button can be called clicking Escape key chronopic_register_win.AddAccelGroup(ag); button_close.AddAccelerator ("activate", ag, new Gtk.AccelKey (Gdk.Key.Escape, Gdk.ModifierType.None, Gtk.AccelFlags.Visible)); //<---- button close end //add buttons to containers Gtk.HButtonBox hbox = new Gtk.HButtonBox(); //hbox.Add(button_close_serial_port); hbox.Add(button_close); vbox_main.Add(hbox); }
public HIGMessageDialog(Gtk.Window parent, Gtk.DialogFlags flags, Gtk.MessageType type, Gtk.ButtonsType buttons, string header, string msg) : base() { HasSeparator = false; BorderWidth = 5; Resizable = false; Title = ""; VBox.Spacing = 12; ActionArea.Layout = Gtk.ButtonBoxStyle.End; accel_group = new Gtk.AccelGroup(); AddAccelGroup(accel_group); Gtk.HBox hbox = new Gtk.HBox(false, 12); hbox.BorderWidth = 5; hbox.Show(); VBox.PackStart(hbox, false, false, 0); Gtk.Image image = null; switch (type) { case Gtk.MessageType.Error: image = new Gtk.Image(Gtk.Stock.DialogError, Gtk.IconSize.Dialog); break; case Gtk.MessageType.Question: image = new Gtk.Image(Gtk.Stock.DialogQuestion, Gtk.IconSize.Dialog); break; case Gtk.MessageType.Info: image = new Gtk.Image(Gtk.Stock.DialogInfo, Gtk.IconSize.Dialog); break; case Gtk.MessageType.Warning: image = new Gtk.Image(Gtk.Stock.DialogWarning, Gtk.IconSize.Dialog); break; } image.Show(); hbox.PackStart(image, false, false, 0); Gtk.VBox label_vbox = new Gtk.VBox(false, 0); label_vbox.Show(); hbox.PackStart(label_vbox, true, true, 0); string title = String.Format("<span weight='bold' size='larger'>{0}" + "</span>\n", header); Gtk.Label label; label = new Gtk.Label(title); label.UseMarkup = true; label.Justify = Gtk.Justification.Left; label.LineWrap = true; label.SetAlignment(0.0f, 0.5f); label.Show(); label_vbox.PackStart(label, false, false, 0); label = new Gtk.Label(msg); label.UseMarkup = true; label.Justify = Gtk.Justification.Left; label.LineWrap = true; label.SetAlignment(0.0f, 0.5f); label.Show(); label_vbox.PackStart(label, false, false, 0); switch (buttons) { case Gtk.ButtonsType.None: break; case Gtk.ButtonsType.Ok: AddButton(Gtk.Stock.Ok, Gtk.ResponseType.Ok, true); break; case Gtk.ButtonsType.Close: AddButton(Gtk.Stock.Close, Gtk.ResponseType.Close, true); break; case Gtk.ButtonsType.Cancel: AddButton(Gtk.Stock.Cancel, Gtk.ResponseType.Cancel, true); break; case Gtk.ButtonsType.YesNo: AddButton(Gtk.Stock.No, Gtk.ResponseType.No, false); AddButton(Gtk.Stock.Yes, Gtk.ResponseType.Yes, true); break; case Gtk.ButtonsType.OkCancel: AddButton(Gtk.Stock.Cancel, Gtk.ResponseType.Cancel, false); AddButton(Gtk.Stock.Ok, Gtk.ResponseType.Ok, true); break; } if (parent != null) { TransientFor = parent; } if ((int)(flags & Gtk.DialogFlags.Modal) != 0) { Modal = true; } if ((int)(flags & Gtk.DialogFlags.DestroyWithParent) != 0) { DestroyWithParent = true; } }
private MenuBar CreateWelcomeMenuBar() { MenuBar menubar = new MenuBar (); AccelGroup agrp = new AccelGroup(); this.AddAccelGroup(agrp); Menu menu = new Menu(); ImageMenuItem imageMenuItem = new ImageMenuItem (Util.GS("Connect to a _server")); Gdk.Pixbuf pixbuf = new Gdk.Pixbuf(Util.ImagesPath("add-account.png")); pixbuf = pixbuf.ScaleSimple(24, 24, Gdk.InterpType.Bilinear); imageMenuItem.Image = new Image(pixbuf); menu.Append(imageMenuItem); imageMenuItem.AddAccelerator("activate", agrp, new AccelKey(Gdk.Key.S, Gdk.ModifierType.ControlMask, AccelFlags.Visible)); imageMenuItem.Activated += new EventHandler(OnAddNewAccount); menu.Append(new SeparatorMenuItem()); imageMenuItem = new ImageMenuItem (Stock.Close, agrp); menu.Append(imageMenuItem); imageMenuItem.Activated += new EventHandler(CloseEventHandler); imageMenuItem = new ImageMenuItem(Stock.Quit, agrp); menu.Append(imageMenuItem); imageMenuItem.Activated += new EventHandler(QuitEventHandler); MenuItem menuItem = new MenuItem(Util.GS("i_Folder")); menuItem.Submenu = menu; menubar.Append (menuItem); menu = new Menu(); imageMenuItem = new ImageMenuItem(Util.GS("_Preferences")); imageMenuItem.Image = new Image(Stock.Preferences, Gtk.IconSize.Menu); menu.Append(imageMenuItem); imageMenuItem.Activated += new EventHandler(ShowPreferencesHandler); menuItem = new MenuItem(Util.GS("_Edit")); menuItem.Submenu = menu; menubar.Append(menuItem); menu = new Menu(); imageMenuItem = new ImageMenuItem(Stock.Help, agrp); menu.Append(imageMenuItem); imageMenuItem.Activated += new EventHandler(OnHelpMenuItem); imageMenuItem = new ImageMenuItem(Util.GS("A_bout")); imageMenuItem.Image = new Image(Gnome.Stock.About, Gtk.IconSize.Menu); menu.Append(imageMenuItem); imageMenuItem.Activated += new EventHandler(OnAbout); menuItem = new MenuItem(Util.GS("_Help")); menuItem.Submenu = menu; menubar.Append(menuItem); return menubar; }
private void CreateWindow(string query) { Title = Best.DefaultWindowTitle; DeleteEvent += new DeleteEventHandler(this.DoDelete); MapEvent += new MapEventHandler(MapIt); UnmapEvent += new UnmapEventHandler(UnmapIt); Icon = Images.GetPixbuf("best.png"); Widget content = CreateContents(); VBox main = new VBox(false, 3); main.PackStart(content, true, true, 3); content.Show(); Add(main); main.Show(); main.Realize(); canvas.Realize(); root = new SimpleRootTile(); canvas.Root = root; DefaultWidth = 600; DefaultHeight = 675; accel_group = new Gtk.AccelGroup(); this.AddAccelGroup(accel_group); global_keys = new GlobalKeybinder(accel_group); // Close window (Ctrl-W) global_keys.AddAccelerator(new EventHandler(this.HideWindowHandler), (uint)Gdk.Key.w, Gdk.ModifierType.ControlMask, Gtk.AccelFlags.Visible); // Close window (Escape) global_keys.AddAccelerator(new EventHandler(this.HideWindowHandler), (uint)Gdk.Key.Escape, 0, Gtk.AccelFlags.Visible); // Show source (Ctrl+U) global_keys.AddAccelerator(new EventHandler(this.ShowSource), (uint)Gdk.Key.U, Gdk.ModifierType.ControlMask, Gtk.AccelFlags.Visible); // Focus Entry (Ctrl+L) global_keys.AddAccelerator(new EventHandler(this.FocusEntryHandler), (uint)Gdk.Key.L, Gdk.ModifierType.ControlMask, Gtk.AccelFlags.Visible); // Previous Page (PageUp) global_keys.AddAccelerator(new EventHandler(this.PageBackHandler), (uint)Gdk.Key.Page_Up, 0, Gtk.AccelFlags.Visible); // Next Page (PageDown) global_keys.AddAccelerator(new EventHandler(this.PageForwardHandler), (uint)Gdk.Key.Page_Down, 0, Gtk.AccelFlags.Visible); UpdateFromConf(); UpdatePage(); if (query != null) { Search(query); } }
public HIGMessageDialog(Gtk.Window parent, Gtk.DialogFlags flags, Gtk.MessageType type, Gtk.ButtonsType buttons, string title, string header, string msg) : base() { HasSeparator = false; BorderWidth = 5; Resizable = false; Title = title; VBox.Spacing = 12; ActionArea.Layout = Gtk.ButtonBoxStyle.End; accel_group = new Gtk.AccelGroup (); AddAccelGroup (accel_group); Gtk.HBox hbox = new Gtk.HBox (false, 12); hbox.BorderWidth = 5; hbox.Show (); VBox.PackStart (hbox, false, false, 0); Gtk.Image image = null; switch (type) { case Gtk.MessageType.Error: image = new Gtk.Image (Gtk.Stock.DialogError, Gtk.IconSize.Dialog); break; case Gtk.MessageType.Question: image = new Gtk.Image (Gtk.Stock.DialogQuestion, Gtk.IconSize.Dialog); break; case Gtk.MessageType.Info: image = new Gtk.Image (Gtk.Stock.DialogInfo, Gtk.IconSize.Dialog); break; case Gtk.MessageType.Warning: image = new Gtk.Image (Gtk.Stock.DialogWarning, Gtk.IconSize.Dialog); break; } image.Show (); image.Yalign = 0; hbox.PackStart (image, false, false, 0); label_vbox = new Gtk.VBox (false, 8); label_vbox.Show (); hbox.PackStart (label_vbox, true, true, 0); string message = String.Format ("<span weight='bold' size='larger'>{0}" + "</span>\n", header); Gtk.Label label; label = new Gtk.Label (message); label.UseMarkup = true; label.Justify = Gtk.Justification.Left; label.LineWrap = true; label.SetAlignment (0.0f, 0.5f); label.Show (); label_vbox.PackStart (label, false, false, 0); label = new Gtk.Label (msg); label.UseMarkup = true; label.Justify = Gtk.Justification.Left; label.LineWrap = true; label.SetAlignment (0.0f, 0.5f); label.Show (); label_vbox.PackStart (label, false, false, 0); switch (buttons) { case Gtk.ButtonsType.None: break; case Gtk.ButtonsType.Ok: AddButton (Gtk.Stock.Ok, Gtk.ResponseType.Ok, true); break; case Gtk.ButtonsType.Close: AddButton (Gtk.Stock.Close, Gtk.ResponseType.Close, true); break; case Gtk.ButtonsType.Cancel: AddButton (Gtk.Stock.Cancel, Gtk.ResponseType.Cancel, true); break; case Gtk.ButtonsType.YesNo: AddButton (Gtk.Stock.No, Gtk.ResponseType.No, false); AddButton (Gtk.Stock.Yes, Gtk.ResponseType.Yes, true); break; case Gtk.ButtonsType.OkCancel: AddButton (Gtk.Stock.Cancel, Gtk.ResponseType.Cancel, false); AddButton (Gtk.Stock.Ok, Gtk.ResponseType.Ok, true); break; } if (parent != null) TransientFor = parent; if ((int) (flags & Gtk.DialogFlags.Modal) != 0) Modal = true; if ((int) (flags & Gtk.DialogFlags.DestroyWithParent) != 0) DestroyWithParent = true; }
public ContactRequestDialog(string contact_name) : base() { Title = AddinManager.CurrentLocalizer.GetString ("Contact Request"); BorderWidth = 5; IconName = "gtk-dialog-authentication"; accel_group = new AccelGroup (); AddAccelGroup (accel_group); HBox hbox = new HBox (false, 12); VBox vbox = new VBox (false, 0); hbox.BorderWidth = 5; vbox.Spacing = 5; hbox.Show (); vbox.Show (); Image image = new Image (); image.Yalign = 0.0f; image.IconName = "gtk-dialog-authentication"; image.IconSize = (int)IconSize.Dialog; image.Show (); hbox.PackStart (image, false, false, 0); hbox.PackStart (vbox, true, true, 0); message = new Label (String.Format (AddinManager.CurrentLocalizer.GetString ("{0} would like to browse your music library."), contact_name)); message.Xalign = 0.0f; message.Show (); vbox.PackStart (message, false, false, 0); ContentArea.PackStart (hbox, true, true, 0); ContentArea.Remove (ActionArea); ContentArea.Spacing = 10; HBox bottom_box = new HBox (); bottom_box.PackStart (ActionArea, false, false, 0); bottom_box.ShowAll (); ContentArea.PackEnd (bottom_box, false, false, 0); Button accept_button = new Button (); accept_button.Label = AddinManager.CurrentLocalizer.GetString ("Accept"); accept_button.ShowAll (); accept_button.Activated += delegate { //login_form.Save (); }; accept_button.Clicked += delegate { //login_form.Save (); }; AddActionWidget (accept_button, ResponseType.Accept); Button reject_button = new Button (); reject_button.Label = AddinManager.CurrentLocalizer.GetString ("Reject"); reject_button.ShowAll (); reject_button.Activated += delegate { //login_form.Save (); }; reject_button.Clicked += delegate { //login_form.Save (); }; AddActionWidget (reject_button, ResponseType.Reject); }
public Browser (string basedir, IEnumerable<string> sources, string engine) { #if MACOS try { InitMacAppHandlers(); } catch (Exception ex) { Console.Error.WriteLine ("Installing Mac AppleEvent handlers failed. Skipping.\n" + ex); } #endif this.engine = engine; ui = new Glade.XML (null, "browser.glade", "window1", null); ui.Autoconnect (this); MainWindow = (Gtk.Window) ui["window1"]; MainWindow.DeleteEvent += new DeleteEventHandler (delete_event_cb); MainWindow.KeyPressEvent += new KeyPressEventHandler (keypress_event_cb); MainWindow.KeyReleaseEvent += new KeyReleaseEventHandler (keyrelease_event_cb); Stream icon = GetResourceImage ("monodoc.png"); if (icon != null) { monodoc_pixbuf = new Gdk.Pixbuf (icon); MainWindow.Icon = monodoc_pixbuf; } //ellipsizing label for the title title_label = new ELabel (""); title_label.Xalign = 0; Pango.FontDescription fd = new Pango.FontDescription (); fd.Weight = Pango.Weight.Bold; title_label.ModifyFont (fd); title_label.Layout.FontDescription = fd; title_label_box.Add (title_label); title_label.Show (); //colour the bar according to the current style bar_style = bar_eb.Style.Copy (); bar_eb.Style = bar_style; MainWindow.StyleSet += new StyleSetHandler (BarStyleSet); BarStyleSet (null, null); help_tree = Driver.LoadTree (basedir, sources); tree_browser = new TreeBrowser (help_tree, reference_tree, this); // Bookmark Manager init; bookmark_manager = new BookmarkManager(this); // // Tab Notebook and first tab // tabs_nb = new Notebook(); //the Notebook that holds tabs tabs_nb.Scrollable = true; tabs_nb.SwitchPage += new SwitchPageHandler(ChangeTab); help_container.Add(tabs_nb); AddTab(); if ((capabilities & Capabilities.Fonts) != 0) { // Add Menu entries for changing the font Menu aux = (Menu) view1.Submenu; MenuItem sep = new SeparatorMenuItem (); sep.Show (); aux.Append (sep); AccelGroup accel = new AccelGroup (); MainWindow.AddAccelGroup (accel); textLarger = new MenuItem ("_Larger text"); textLarger.Activated += new EventHandler (TextLarger); textLarger.Show (); aux.Append (textLarger); AccelKey ak = new AccelKey (Gdk.Key.plus, Gdk.ModifierType.ControlMask, AccelFlags.Visible); textLarger.AddAccelerator ("activate", accel, ak); textSmaller = new MenuItem ("_Smaller text"); textSmaller.Activated += new EventHandler (TextSmaller); textSmaller.Show (); aux.Append (textSmaller); ak = new AccelKey (Gdk.Key.minus, Gdk.ModifierType.ControlMask, AccelFlags.Visible); textSmaller.AddAccelerator ("activate", accel, ak); textNormal = new MenuItem ("_Original size"); textNormal.Activated += new EventHandler (TextNormal); textNormal.Show (); aux.Append (textNormal); ak = new AccelKey (Gdk.Key.Key_0, Gdk.ModifierType.ControlMask, AccelFlags.Visible); textNormal.AddAccelerator ("activate", accel, ak); } // restore the editing setting editing1.Active = SettingsHandler.Settings.EnableEditing; comments1.Active = SettingsHandler.Settings.ShowComments; cut1.Sensitive = false; paste1.Sensitive = false; // // Other bits // search_index = help_tree.GetSearchIndex(); if (search_index == null) { ppanel = new ProgressPanel ("<b>No Search index found</b>", "Generate", RootTree.MakeSearchIndex, CreateSearchPanel); search_vbox.Add (ppanel); search_vbox.Show (); } else { CreateSearchPanel (); } bookList = new ArrayList (); index_browser = IndexBrowser.MakeIndexBrowser (this); MainWindow.ShowAll(); #if MACOS try { InstallMacMainMenu (); ((MenuBar)ui["menubar1"]).Hide (); } catch (Exception ex) { Console.Error.WriteLine ("Installing Mac IGE Main Menu failed. Skipping.\n" + ex); } #endif }
public ExceptionDialog(Exception e) : base() { debugInfo = BuildExceptionMessage(e); HasSeparator = false; BorderWidth = 5; Resizable = false; Title = Catalog.GetString("F-Spot Encountered a Fatal Error"); VBox.Spacing = 12; ActionArea.Layout = ButtonBoxStyle.End; accel_group = new AccelGroup(); AddAccelGroup(accel_group); HBox hbox = new HBox(false, 12); hbox.BorderWidth = 5; VBox.PackStart(hbox, false, false, 0); Image image = new Image(Stock.DialogError, IconSize.Dialog); image.Yalign = 0.0f; hbox.PackStart(image, true, true, 0); VBox label_vbox = new VBox(false, 0); label_vbox.Spacing = 12; hbox.PackStart(label_vbox, false, false, 0); Label label = new Label(String.Format("<b><big>{0}</big></b>", GLib.Markup.EscapeText(Title))); label.UseMarkup = true; label.Justify = Justification.Left; label.LineWrap = true; label.SetAlignment(0.0f, 0.5f); label_vbox.PackStart(label, false, false, 0); label = new Label(e.Message); label.UseMarkup = true; label.Justify = Gtk.Justification.Left; label.LineWrap = true; label.SetAlignment(0.0f, 0.5f); label_vbox.PackStart(label, false, false, 0); Label details_label = new Label(String.Format("<b>{0}</b>", GLib.Markup.EscapeText(Catalog.GetString("Error Details")))); details_label.UseMarkup = true; Expander details_expander = new Expander("Details"); details_expander.LabelWidget = details_label; label_vbox.PackStart(details_expander, true, true, 0); ScrolledWindow scroll = new ScrolledWindow(); TextView view = new TextView(); scroll.HscrollbarPolicy = PolicyType.Automatic; scroll.VscrollbarPolicy = PolicyType.Automatic; scroll.AddWithViewport(view); scroll.SetSizeRequest(450, 250); view.Editable = false; view.Buffer.Text = debugInfo; details_expander.Add(scroll); hbox.ShowAll(); AddButton(Stock.Close, ResponseType.Close, true); }
public void AddAccelerator(string accel_signal, AccelGroup accel_group, AccelKey accel_key) { this.AddAccelerator(accel_signal, accel_group, (uint)accel_key.Key, accel_key.AccelMods, accel_key.AccelFlags); }
public StationEditor(DatabaseTrackInfo track) : base() { AccelGroup accel_group = new AccelGroup (); AddAccelGroup (accel_group); Title = String.Empty; SkipTaskbarHint = true; Modal = true; this.track = track; string title = track == null ? Catalog.GetString ("Add new radio station") : Catalog.GetString ("Edit radio station"); BorderWidth = 6; DefaultResponse = ResponseType.Ok; Modal = true; ContentArea.Spacing = 6; HBox split_box = new HBox (); split_box.Spacing = 12; split_box.BorderWidth = 6; Image image = new Image (); image.IconSize = (int)IconSize.Dialog; image.IconName = "radio"; image.Yalign = 0.0f; image.Show (); VBox main_box = new VBox (); main_box.BorderWidth = 5; main_box.Spacing = 10; Label header = new Label (); header.Markup = String.Format ("<big><b>{0}</b></big>", GLib.Markup.EscapeText (title)); header.Xalign = 0.0f; header.Show (); Label message = new Label (); message.Text = Catalog.GetString ("Enter the Genre, Title and URL of the radio station you wish to add. A description is optional."); message.Xalign = 0.0f; message.Wrap = true; message.Show (); table = new Table (5, 2, false); table.RowSpacing = 6; table.ColumnSpacing = 6; genre_entry = ComboBoxText.NewWithEntry (); foreach (string genre in ServiceManager.DbConnection.QueryEnumerable<string> ("SELECT DISTINCT Genre FROM CoreTracks ORDER BY Genre")) { if (!String.IsNullOrEmpty (genre)) { genre_entry.AppendText (genre); } } if (track != null && !String.IsNullOrEmpty (track.Genre)) { genre_entry.Entry.Text = track.Genre; } AddRow (Catalog.GetString ("Station Genre:"), genre_entry); name_entry = AddEntryRow (Catalog.GetString ("Station Name:")); stream_entry = AddEntryRow (Catalog.GetString ("Stream URL:")); creator_entry = AddEntryRow (Catalog.GetString ("Station Creator:")); description_entry = AddEntryRow (Catalog.GetString ("Description:")); rating_entry = new RatingEntry (); HBox rating_box = new HBox (); rating_box.PackStart (rating_entry, false, false, 0); AddRow (Catalog.GetString ("Rating:"), rating_box); table.ShowAll (); main_box.PackStart (header, false, false, 0); main_box.PackStart (message, false, false, 0); main_box.PackStart (table, false, false, 0); main_box.Show (); split_box.PackStart (image, false, false, 0); split_box.PackStart (main_box, true, true, 0); split_box.Show (); ContentArea.PackStart (split_box, true, true, 0); Button cancel_button = new Button (Stock.Cancel); cancel_button.CanDefault = false; cancel_button.UseStock = true; cancel_button.Show (); AddActionWidget (cancel_button, ResponseType.Close); cancel_button.AddAccelerator ("activate", accel_group, (uint)Gdk.Key.Escape, 0, Gtk.AccelFlags.Visible); save_button = new Button (Stock.Save); save_button.CanDefault = true; save_button.UseStock = true; save_button.Sensitive = false; save_button.Show (); AddActionWidget (save_button, ResponseType.Ok); save_button.AddAccelerator ("activate", accel_group, (uint)Gdk.Key.Return, 0, Gtk.AccelFlags.Visible); name_entry.HasFocus = true; if (track != null) { if (!String.IsNullOrEmpty (track.TrackTitle)) { name_entry.Text = track.TrackTitle; } if (!String.IsNullOrEmpty (track.Uri.AbsoluteUri)) { stream_entry.Text = track.Uri.AbsoluteUri; } if (!String.IsNullOrEmpty (track.Comment)) { description_entry.Text = track.Comment; } if (!String.IsNullOrEmpty (track.ArtistName)) { creator_entry.Text = track.ArtistName; } rating_entry.Value = track.Rating; } error_container = new Alignment (0.0f, 0.0f, 1.0f, 1.0f); error_container.TopPadding = 6; HBox error_box = new HBox (); error_box.Spacing = 4; Image error_image = new Image (); error_image.Stock = Stock.DialogError; error_image.IconSize = (int)IconSize.Menu; error_image.Show (); error = new Label (); error.Xalign = 0.0f; error.Show (); error_box.PackStart (error_image, false, false, 0); error_box.PackStart (error, true, true, 0); error_box.Show (); error_container.Add (error_box); table.Attach (error_container, 0, 2, 6, 7, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Shrink, 0, 0); genre_entry.Entry.Changed += OnFieldsChanged; name_entry.Changed += OnFieldsChanged; stream_entry.Changed += OnFieldsChanged; OnFieldsChanged (this, EventArgs.Empty); }
public PodcastSubscribeDialog() : base(Catalog.GetString("Subscribe"), null, DialogFlags.Modal | DialogFlags.NoSeparator) { accelGroup = new Gtk.AccelGroup(); AddAccelGroup(accelGroup); BuildWindow(); }
private MenuBar CreateNormalMenu() { MenuBar menubar = new MenuBar (); AccelGroup agrp = new AccelGroup(); this.AddAccelGroup(agrp); Menu iFolderMenu = new Menu(); NewMenuItem = new ImageMenuItem (Util.GS("_Upload a Folder...")); NewMenuItem.Image = new Image( new Gdk.Pixbuf(Util.ImagesPath("ifolder-upload16.png"))); iFolderMenu.Append(NewMenuItem); NewMenuItem.AddAccelerator("activate", agrp, new AccelKey(Gdk.Key.N, Gdk.ModifierType.ControlMask, AccelFlags.Visible)); NewMenuItem.Activated += new EventHandler(AddiFolderHandler); DownloadMenuItem = new ImageMenuItem (Util.GS("_Download...")); DownloadMenuItem.Image = new Image( new Gdk.Pixbuf(Util.ImagesPath("ifolder-download16.png"))); MergeMenuItem = new ImageMenuItem( Util.GS("Merge to Folder")); MergeMenuItem.Image = new Image( new Gdk.Pixbuf(Util.ImagesPath("ifolder-download16.png"))); iFolderMenu.Append(DownloadMenuItem); iFolderMenu.Append(MergeMenuItem); DownloadMenuItem.Activated += new EventHandler(DownloadAvailableiFolderHandler); MergeMenuItem.Activated += new EventHandler(MergeAvailableiFolderHandler); DeleteMenuItem = new ImageMenuItem (Util.GS("Dele_te From Server")); DeleteMenuItem.Image = new Image(Stock.Delete, Gtk.IconSize.Menu); iFolderMenu.Append(DeleteMenuItem); DeleteMenuItem.Activated += new EventHandler(DeleteFromServerHandler); RemoveMenuItem = new ImageMenuItem (Util.GS("Re_move my membership")); RemoveMenuItem.Image = new Image(Stock.Delete, Gtk.IconSize.Menu); iFolderMenu.Append(RemoveMenuItem); RemoveMenuItem.Activated += new EventHandler(RemoveMembershipHandler); iFolderMenu.Append(new SeparatorMenuItem()); OpenMenuItem = new ImageMenuItem ( Stock.Open, agrp ); iFolderMenu.Append(OpenMenuItem); OpenMenuItem.Activated += new EventHandler(OnOpenSynchronizedFolder); ShareMenuItem = new MenuItem (Util.GS("Share _with...")); iFolderMenu.Append(ShareMenuItem); ShareMenuItem.Activated += new EventHandler(OnShareSynchronizedFolder); ConflictMenuItem = new MenuItem (Util.GS("Resolve conflic_ts")); iFolderMenu.Append(ConflictMenuItem); ConflictMenuItem.Activated += new EventHandler(OnResolveConflicts); SyncNowMenuItem = new MenuItem(Util.GS("S_ynchronize now")); iFolderMenu.Append(SyncNowMenuItem); SyncNowMenuItem.Activated += new EventHandler(OnSynchronizeNow); RevertMenuItem = new ImageMenuItem (Util.GS("_Revert to a Normal Folder")); RevertMenuItem.Image = new Image(Stock.Undo, Gtk.IconSize.Menu); iFolderMenu.Append(RevertMenuItem); RevertMenuItem.Activated += new EventHandler(RemoveiFolderHandler); PropMenuItem = new ImageMenuItem (Stock.Properties, agrp); iFolderMenu.Append(PropMenuItem); PropMenuItem.Activated += new EventHandler(OnShowFolderProperties); iFolderMenu.Append(new SeparatorMenuItem()); MigrateMenuItem = new MenuItem(Util.GS("_Migrate iFolder")); Menu MigrateMenu = new Menu(); MigrateMenuSubItem = new MenuItem(Util.GS("Migrate from 2.x")); MigrateMenu.Append(MigrateMenuSubItem); MigrateMenuItem.Submenu = MigrateMenu; iFolderMenu.Append( MigrateMenuItem); MigrateMenuSubItem.Activated += new EventHandler(Migrate2xClickedHandler); iFolderMenu.Append(new SeparatorMenuItem()); CloseMenuItem = new ImageMenuItem (Stock.Close, agrp); iFolderMenu.Append(CloseMenuItem); CloseMenuItem.Activated += new EventHandler(CloseEventHandler); QuitMenuItem = new ImageMenuItem(Stock.Quit, agrp); iFolderMenu.Append(QuitMenuItem); QuitMenuItem.Activated += new EventHandler(QuitEventHandler); MenuItem iFolderMenuItem = new MenuItem(Util.GS("i_Folder")); iFolderMenuItem.Submenu = iFolderMenu; menubar.Append (iFolderMenuItem); Menu EditMenu = new Menu(); AccountsMenuItem = new MenuItem (Util.GS("_Account Settings...")); EditMenu.Append(AccountsMenuItem); AccountsMenuItem.Activated += new EventHandler(AccountsMenuItemHandler); PreferencesMenuItem = new ImageMenuItem(Util.GS("_Preferences")); PreferencesMenuItem.Image = new Image(Stock.Preferences, Gtk.IconSize.Menu); EditMenu.Append(PreferencesMenuItem); PreferencesMenuItem.Activated += new EventHandler(ShowPreferencesHandler); MenuItem EditMenuItem = new MenuItem(Util.GS("_Edit")); EditMenuItem.Submenu = EditMenu; menubar.Append(EditMenuItem); Menu ViewMenu = new Menu(); RefreshMenuItem = new ImageMenuItem(Stock.Refresh, agrp); ViewMenu.Append(RefreshMenuItem); RefreshMenuItem.Activated += new EventHandler(RefreshiFoldersHandler); ViewMenu.Append(new SeparatorMenuItem()); SyncLogMenuItem = new MenuItem (Util.GS("Synchronization _Log")); ViewMenu.Append(SyncLogMenuItem); SyncLogMenuItem.Activated += new EventHandler(SyncLogMenuItemHandler); ViewMenu.Append(new SeparatorMenuItem()); ViewServeriFoldersMenuItem = new CheckMenuItem(Util.GS("View _available iFolders")); ViewMenu.Append(ViewServeriFoldersMenuItem); ViewServeriFoldersMenuItem.Toggled += new EventHandler(OnToggleViewServeriFoldersMenuItem); if((bool)ClientConfig.Get(ClientConfig.KEY_IFOLDER_DEBUG_COLOR_PALETTE)) { MenuItem showColorPaletteMenuItem = new MenuItem("Show _Color Palette (FIXME: Remove this before shipping)..."); ViewMenu.Append(showColorPaletteMenuItem); showColorPaletteMenuItem.Activated += ShowColorPalette; } MenuItem ViewMenuItem = new MenuItem(Util.GS("_View")); ViewMenuItem.Submenu = ViewMenu; menubar.Append(ViewMenuItem); Menu SecurityMenu = new Menu(); RecoveryMenuItem = new MenuItem(Util.GS("_Key Recovery")); SecurityMenu.Append(RecoveryMenuItem); ImportMenuSubItem = new MenuItem(Util.GS("Import Decrypted Keys")); ExportMenuSubItem = new MenuItem(Util.GS("Export Encrypted Keys")); ImportMenuSubItem.Activated += new EventHandler(ImportClicked); ExportMenuSubItem.Activated += new EventHandler(ExportClicked); Menu recoverMenu = new Menu(); recoverMenu.Append( ExportMenuSubItem); recoverMenu.Append( ImportMenuSubItem); RecoveryMenuItem.Submenu = recoverMenu;; ResetPassMenuItem = new MenuItem(Util.GS("Reset _Passphrase")); ResetPassMenuItem.Activated += new EventHandler(OnResetPassMenuItem); SecurityMenu.Append(ResetPassMenuItem); ResetPasswordMenuItem = new MenuItem(Util.GS("Change Password")); ResetPasswordMenuItem.Activated += new EventHandler(OnResetPasswordMenuItem); SecurityMenu.Append(ResetPasswordMenuItem); MenuItem MainSecurityMenuItem = new MenuItem (Util.GS ("_Security")); MainSecurityMenuItem.Submenu = SecurityMenu; menubar.Append (MainSecurityMenuItem); Menu HelpMenu = new Menu(); HelpMenuItem = new ImageMenuItem(Stock.Help, agrp); HelpMenu.Append(HelpMenuItem); HelpMenuItem.Activated += new EventHandler(OnHelpMenuItem); AboutMenuItem = new ImageMenuItem(Util.GS("A_bout")); AboutMenuItem.Image = new Image(Gnome.Stock.About, Gtk.IconSize.Menu); HelpMenu.Append(AboutMenuItem); AboutMenuItem.Activated += new EventHandler(OnAbout); MenuItem MainHelpMenuItem = new MenuItem(Util.GS("_Help")); MainHelpMenuItem.Submenu = HelpMenu; menubar.Append(MainHelpMenuItem); return menubar; }
private MenuBar CreateShortcutsBar() { // Adds a hidden menubar that contains to enable keyboard // shortcuts to close the log MenuBar menu_bar = new MenuBar (); MenuItem file_item = new MenuItem ("File"); Menu file_menu = new Menu (); MenuItem close_1 = new MenuItem ("Close1"); MenuItem close_2 = new MenuItem ("Close2"); // adds specific Ctrl+W and Esc key accelerators to Log Window AccelGroup accel_group = new AccelGroup (); AddAccelGroup (accel_group); // Close on Esc close_1.AddAccelerator ("activate", accel_group, new AccelKey (Gdk.Key.W, Gdk.ModifierType.ControlMask, AccelFlags.Visible)); close_1.Activated += delegate { HideAll (); }; // Close on Ctrl+W close_2.AddAccelerator ("activate", accel_group, new AccelKey (Gdk.Key.Escape, Gdk.ModifierType.None, AccelFlags.Visible)); close_2.Activated += delegate { HideAll (); }; file_menu.Append (close_1); file_menu.Append (close_2); file_item.Submenu = file_menu; menu_bar.Append (file_item); // Hacky way to hide the menubar, but the accellerators // will simply be disabled when using Hide () menu_bar.HeightRequest = 1; menu_bar.ModifyBg (StateType.Normal, Style.Background (StateType.Normal)); return menu_bar; }
private MenuItem MakeHelpMenu() { Menu menu = new Menu(); AccelGroup group = new AccelGroup(); window.AddAccelGroup(group); ImageMenuItem about = new ImageMenuItem(Stock.About, group); about.Activated += new EventHandler(OnHelpAbout); menu.Append(about); MenuItem label = new MenuItem("_Help"); label.Submenu = menu; return label; }
private MenuBar CreateNormalMenu() { MenuBar menubar = new MenuBar (); AccelGroup agrp = new AccelGroup(); this.AddAccelGroup(agrp); Menu iFolderMenu = new Menu(); NewMenuItem = new ImageMenuItem (Util.GS("_Upload a folder...")); NewMenuItem.Image = new Image( new Gdk.Pixbuf(Util.ImagesPath("ifolder24.png"))); iFolderMenu.Append(NewMenuItem); NewMenuItem.AddAccelerator("activate", agrp, new AccelKey(Gdk.Key.N, Gdk.ModifierType.ControlMask, AccelFlags.Visible)); NewMenuItem.Activated += new EventHandler(AddiFolderHandler); DownloadMenuItem = new MenuItem (Util.GS("_Download...")); iFolderMenu.Append(DownloadMenuItem); DownloadMenuItem.Activated += new EventHandler(DownloadAvailableiFolderHandler); DeleteMenuItem = new ImageMenuItem (Util.GS("Dele_te from server")); DeleteMenuItem.Image = new Image(Stock.Delete, Gtk.IconSize.Menu); iFolderMenu.Append(DeleteMenuItem); DeleteMenuItem.Activated += new EventHandler(DeleteFromServerHandler); RemoveMenuItem = new ImageMenuItem (Util.GS("Re_move my membership")); RemoveMenuItem.Image = new Image(Stock.Delete, Gtk.IconSize.Menu); iFolderMenu.Append(RemoveMenuItem); RemoveMenuItem.Activated += new EventHandler(RemoveMembershipHandler); iFolderMenu.Append(new SeparatorMenuItem()); OpenMenuItem = new ImageMenuItem ( Stock.Open, agrp ); iFolderMenu.Append(OpenMenuItem); OpenMenuItem.Activated += new EventHandler(OnOpenSynchronizedFolder); ShareMenuItem = new MenuItem (Util.GS("Share _with...")); iFolderMenu.Append(ShareMenuItem); ShareMenuItem.Activated += new EventHandler(OnShareSynchronizedFolder); ConflictMenuItem = new MenuItem (Util.GS("Resolve conflic_ts")); iFolderMenu.Append(ConflictMenuItem); ConflictMenuItem.Activated += new EventHandler(OnResolveConflicts); SyncNowMenuItem = new MenuItem(Util.GS("S_ynchronize now")); iFolderMenu.Append(SyncNowMenuItem); SyncNowMenuItem.Activated += new EventHandler(OnSynchronizeNow); RevertMenuItem = new ImageMenuItem (Util.GS("C_hange to a normal folder")); RevertMenuItem.Image = new Image(Stock.Undo, Gtk.IconSize.Menu); iFolderMenu.Append(RevertMenuItem); RevertMenuItem.Activated += new EventHandler(RemoveiFolderHandler); PropMenuItem = new ImageMenuItem (Stock.Properties, agrp); iFolderMenu.Append(PropMenuItem); PropMenuItem.Activated += new EventHandler(OnShowFolderProperties); iFolderMenu.Append(new SeparatorMenuItem()); CloseMenuItem = new ImageMenuItem (Stock.Close, agrp); iFolderMenu.Append(CloseMenuItem); CloseMenuItem.Activated += new EventHandler(CloseEventHandler); QuitMenuItem = new ImageMenuItem(Stock.Quit, agrp); iFolderMenu.Append(QuitMenuItem); QuitMenuItem.Activated += new EventHandler(QuitEventHandler); MenuItem iFolderMenuItem = new MenuItem(Util.GS("i_Folder")); iFolderMenuItem.Submenu = iFolderMenu; menubar.Append (iFolderMenuItem); Menu EditMenu = new Menu(); AccountsMenuItem = new MenuItem (Util.GS("_Account Settings...")); EditMenu.Append(AccountsMenuItem); AccountsMenuItem.Activated += new EventHandler(AccountsMenuItemHandler); PreferencesMenuItem = new ImageMenuItem(Util.GS("_Preferences")); PreferencesMenuItem.Image = new Image(Stock.Preferences, Gtk.IconSize.Menu); EditMenu.Append(PreferencesMenuItem); PreferencesMenuItem.Activated += new EventHandler(ShowPreferencesHandler); MenuItem EditMenuItem = new MenuItem(Util.GS("_Edit")); EditMenuItem.Submenu = EditMenu; menubar.Append(EditMenuItem); Menu ViewMenu = new Menu(); RefreshMenuItem = new ImageMenuItem(Stock.Refresh, agrp); ViewMenu.Append(RefreshMenuItem); RefreshMenuItem.Activated += new EventHandler(RefreshiFoldersHandler); ViewMenu.Append(new SeparatorMenuItem()); SyncLogMenuItem = new MenuItem (Util.GS("Synchronization _Log")); ViewMenu.Append(SyncLogMenuItem); SyncLogMenuItem.Activated += new EventHandler(SyncLogMenuItemHandler); ViewMenu.Append(new SeparatorMenuItem()); ViewServeriFoldersMenuItem = new CheckMenuItem(Util.GS("View _available iFolders")); ViewMenu.Append(ViewServeriFoldersMenuItem); ViewServeriFoldersMenuItem.Toggled += new EventHandler(OnToggleViewServeriFoldersMenuItem); MenuItem showColorPaletteMenuItem = new MenuItem("Show _Color Palette (FIXME: Remove this before shipping)..."); ViewMenu.Append(showColorPaletteMenuItem); showColorPaletteMenuItem.Activated += ShowColorPalette; MenuItem ViewMenuItem = new MenuItem(Util.GS("_View")); ViewMenuItem.Submenu = ViewMenu; menubar.Append(ViewMenuItem); Menu HelpMenu = new Menu(); HelpMenuItem = new ImageMenuItem(Stock.Help, agrp); HelpMenu.Append(HelpMenuItem); HelpMenuItem.Activated += new EventHandler(OnHelpMenuItem); AboutMenuItem = new ImageMenuItem(Util.GS("A_bout")); AboutMenuItem.Image = new Image(Gnome.Stock.About, Gtk.IconSize.Menu); HelpMenu.Append(AboutMenuItem); AboutMenuItem.Activated += new EventHandler(OnAbout); MenuItem MainHelpMenuItem = new MenuItem(Util.GS("_Help")); MainHelpMenuItem.Submenu = HelpMenu; menubar.Append(MainHelpMenuItem); return menubar; }
public TaskOptionsDialog(Gtk.Window parent, Gtk.DialogFlags flags, Task task) : base (Catalog.GetString ("Task Options"), parent, flags) { HasSeparator = false; //BorderWidth = 0; Resizable = false; //Decorated = false; this.SetDefaultSize (400, 300); this.task = task; // Frame frame = new Frame(); // frame.Shadow = ShadowType.Out; // frame.Show(); // VBox.PackStart (frame, true, true, 0); VBox vbox = new VBox (false, 6); vbox.BorderWidth = 6; vbox.Show (); VBox.PackStart (vbox, true, true, 0); // frame.Add (vbox); ActionArea.Layout = Gtk.ButtonBoxStyle.End; accel_group = new Gtk.AccelGroup (); AddAccelGroup (accel_group); // Gtk.Label l = new Gtk.Label ( // string.Format ( // "<span weight=\"bold\">{0}</span>", // Catalog.GetString ("Task Options"))); // l.UseMarkup = true; // l.Show (); // vbox.PackStart (l, false, false, 0); /// /// Summary /// Gtk.Label l = new Label (Catalog.GetString ("_Summary:")); l.Xalign = 0; l.Show (); vbox.PackStart (l, false, false, 0); summary_entry = new Gtk.Entry (); l.MnemonicWidget = summary_entry; summary_entry.Text = task.Summary; summary_entry.Show (); vbox.PackStart (summary_entry, false, false, 0); /// /// Details /// l = new Label (Catalog.GetString ("_Details:")); l.Xalign = 0; l.Show (); vbox.PackStart (l, false, false, 0); details_text_view = new TextView (); l.MnemonicWidget = details_text_view; details_text_view.WrapMode = WrapMode.Word; details_text_view.Show (); ScrolledWindow sw = new ScrolledWindow (); sw.ShadowType = Gtk.ShadowType.EtchedIn; sw.Add (details_text_view); sw.Show (); vbox.PackStart (sw, true, true, 0); /// /// Completion Checkbox /// HBox hbox = new Gtk.HBox (false, 4); completed_check_button = new Gtk.CheckButton ( task.IsComplete ? Catalog.GetString ("_Completed:") : Catalog.GetString ("_Complete")); if (task.IsComplete) completed_check_button.Active = true; completed_check_button.UseUnderline = true; completed_check_button.Toggled += OnCompletedCheckButtonToggled; completed_check_button.Show (); hbox.PackStart (completed_check_button, false, false, 0); completed_label = new Gtk.Label ( task.IsComplete ? GuiUtils.GetPrettyPrintDate (task.CompletionDate, true) : string.Empty); completed_label.Xalign = 0; completed_label.Show (); hbox.PackStart (completed_label, true, true, 0); hbox.Show (); vbox.PackStart (hbox, false, false, 0); /// /// Due Date /// hbox = new HBox (false, 4); due_date_check_button = new CheckButton (Catalog.GetString ("Due Date:")); if (task.DueDate != DateTime.MinValue) due_date_check_button.Active = true; due_date_check_button.Toggled += OnDueDateCheckButtonToggled; due_date_check_button.Show (); hbox.PackStart (due_date_check_button, false, false, 0); due_date_button = new Gtk.Extras.DateButton (task.DueDate, false); if (task.DueDate == DateTime.MinValue) due_date_button.Sensitive = false; due_date_button.Show (); hbox.PackStart (due_date_button, false, false, 0); // Spacer hbox.PackStart (new Gtk.Label (string.Empty), true, true, 0); hbox.Show (); vbox.PackStart (hbox, false, false, 0); /// /// Priority /// hbox = new HBox (false, 4); priority_check_button = new CheckButton (Catalog.GetString ("Priority:")); if (task.Priority != TaskPriority.Undefined) priority_check_button.Active = true; priority_check_button.Toggled += OnPriorityCheckButtonToggled; priority_check_button.Show (); hbox.PackStart (priority_check_button, false, false, 0); priority_combo_box = ComboBox.NewText (); priority_combo_box.AppendText (Catalog.GetString ("None")); priority_combo_box.AppendText (Catalog.GetString ("Low")); priority_combo_box.AppendText (Catalog.GetString ("Normal")); priority_combo_box.AppendText (Catalog.GetString ("High")); if (task.Priority == TaskPriority.Undefined) priority_combo_box.Sensitive = false; priority_combo_box.Active = (int) task.Priority; priority_combo_box.Changed += OnPriorityComboBoxChanged; priority_combo_box.Show (); hbox.PackStart (priority_combo_box, false, false, 0); // Spacer hbox.PackStart (new Gtk.Label (string.Empty), true, true, 0); hbox.Show (); vbox.PackStart (hbox, false, false, 0); AddButton (Gtk.Stock.Cancel, Gtk.ResponseType.Cancel, false); AddButton (Gtk.Stock.Save, Gtk.ResponseType.Ok, true); // if (parent != null) // TransientFor = parent; // if ((int) (flags & Gtk.DialogFlags.Modal) != 0) // Modal = true; // if ((int) (flags & Gtk.DialogFlags.DestroyWithParent) != 0) // DestroyWithParent = true; }
/// <summary> /// Creates the GUI from code elements. /// </summary> private void CreateGui() { // Hook up the accelerator group. accelerators = new AccelGroup(); AddAccelGroup(accelerators); // The main frame has a VBox to arrange all the components. The VBox // contains the menu, the primary text editor, and a status bar. var vertical = new VBox(false, 0); Add(vertical); // The center part of the area has a horizontal separator with the // bulk of the text editor on the left. var pane = new HPaned { Position = 1024 - 256, BorderWidth = 0, }; // Create the various components and add them to the vertical box. Widget menuBarWidget = CreateGuiMenubar(); Widget panelsWidget = CreatePanelArea(); Widget textEditorWidget = CreateGuiEditor(); Widget statusBarWidget = CreateGuiStatusbar(); pane.Pack1(textEditorWidget, true, true); pane.Pack2(panelsWidget, true, true); vertical.PackStart(menuBarWidget, false, false, 0); vertical.PackStart(pane, true, true, 0); vertical.PackStart(statusBarWidget, false, false, 0); }
/// <summary>Crea la barra de menú de la aplicación.</summary> /// <returns>La barra de menú de la aplicación.</returns> private MenuBar CrearMenuBar() { Gtk.AccelGroup acel = new Gtk.AccelGroup(); ImageMenuItem item = null; //--- // Elementos del menú Archivo. Menu menuArchivo = new Menu(); MenuItem menuArchivoItem = new MenuItem(GetText("Ventana_Menu_Archivo")); menuArchivoItem.Submenu = menuArchivo; item = new ImageMenuItem(Gtk.Stock.New, acel); item.Activated += new EventHandler(VentanaNuevo); menuArchivo.Append(item); item = new ImageMenuItem(Gtk.Stock.Open, acel); item.Activated += new EventHandler(VentanaAbrir); menuArchivo.Append(item); item = new ImageMenuItem(Gtk.Stock.Save, acel); item.Activated += new EventHandler(VentanaGuardar); menuArchivo.Append(item); item = new ImageMenuItem(Gtk.Stock.SaveAs, acel); item.Activated += new EventHandler(VentanaGuardarComo); menuArchivo.Append(item); menuArchivo.Append(new Gtk.SeparatorMenuItem()); item = new ImageMenuItem(Gtk.Stock.Quit, acel); item.Activated += new EventHandler(VentanaSalir); menuArchivo.Append(item); //-- // Elementos del menú de opciones. Menu menuOpciones = new Menu(); MenuItem menuOpcionesItem = new MenuItem(GetText("Ventana_Menu_Opciones")); menuOpcionesItem.Submenu = menuOpciones; item = new ImageMenuItem(Gtk.Stock.Preferences, acel); item.Activated += new EventHandler(VentanaOpciones); menuOpciones.Append(item); //-- // Elementos del menú proyecto. Menu menuProyecto = new Menu(); MenuItem menuProyectoItem = new MenuItem(GetText("Ventana_Menu_Proyecto")); menuProyectoItem.Submenu = menuProyecto; itemEjecutar = new ImageMenuItem(Gtk.Stock.Execute, new AccelGroup()); itemEjecutar.Activated += new EventHandler(VentanaEjecutar); itemEjecutar.Image = new Gtk.Image(IconManager.GetPixmap("run16.png")); itemEjecutar.AddAccelerator( "activate", acel, 65474, Gdk.ModifierType.LockMask, Gtk.AccelFlags.Visible); menuProyecto.Append(itemEjecutar); itemPausar = new ImageMenuItem(GetText("Ventana_Pausar")); itemPausar.Activated += new EventHandler(VentanaPausar); itemPausar.Image = new Gtk.Image(IconManager.GetPixmap("pausar32.png")); itemPausar.Sensitive = false; itemPausar.AddAccelerator( "activate", acel, 65475, Gdk.ModifierType.LockMask, Gtk.AccelFlags.Visible); menuProyecto.Append(itemPausar); itemDetener = new ImageMenuItem(Gtk.Stock.Stop, new AccelGroup()); itemDetener.Activated += new EventHandler(VentanaDetener); itemDetener.Sensitive = false; itemDetener.AddAccelerator( "activate", acel, 65476, Gdk.ModifierType.LockMask, Gtk.AccelFlags.Visible); menuProyecto.Append(itemDetener); //--- // Elementos del menú Ayuda Menu menuAyuda = new Menu(); MenuItem menuAyudaItem = new MenuItem(GetText("Ventana_Menu_Ayuda")); menuAyudaItem.Submenu = menuAyuda; item = new ImageMenuItem(Gtk.Stock.Help, acel); item.Activated += new EventHandler(VentanaAyuda); menuAyuda.Append(item); item = new ImageMenuItem(GetText("Ventana_Menu_AcercaDe"), new AccelGroup()); item.Image = new Gtk.Image(Gtk.Stock.Refresh, IconSize.Menu); item.Activated += new EventHandler(VentanaAcerca); item.Image = new Gtk.Image(IconManager.GetPixmap("about16.png")); menuAyuda.Append(item); //-- AddAccelGroup(acel); //-- MenuBar mb = new MenuBar(); mb.Append(menuArchivoItem); mb.Append(menuOpcionesItem); mb.Append(menuProyectoItem); mb.Append(menuAyudaItem); return(mb); }
public static Gtk.Window Create() { window = new Window ("Menus"); AccelGroup accel_group = new AccelGroup (); window.AddAccelGroup (accel_group); VBox box1 = new VBox (false, 0); window.Add (box1); MenuBar menubar = new MenuBar (); box1.PackStart (menubar, false, false, 0); Menu menu = Create_Menu (2, true); MenuItem menuitem = new MenuItem ("foo"); menuitem.Submenu = menu; menubar.Append (menuitem); menuitem = new MenuItem ("bar"); menuitem.Submenu = Create_Menu (3, true); menubar.Append (menuitem); Image image = new Image (Stock.Help, IconSize.Menu); menuitem = new ImageMenuItem ("Help"); ((ImageMenuItem) menuitem).Image = image; menuitem.Submenu = Create_Menu (4, true); menuitem.RightJustified = true; menubar.Append (menuitem); menubar = new MenuBar (); box1.PackStart (menubar, false, true, 0); menu = Create_Menu (2, true); menuitem = new MenuItem ("Second menu bar"); menuitem.Submenu = menu; menubar.Append (menuitem); VBox box2 = new VBox (false, 10); box2.BorderWidth = 10; box1.PackStart (box2, true, true, 0); menu = Create_Menu (1, false); menu.AccelGroup = accel_group; menu.Append (new SeparatorMenuItem ()); menuitem = new CheckMenuItem ("Accelerate Me"); menu.Append (menuitem); menuitem.AddAccelerator ("activate", accel_group, 0xFFBE, 0, AccelFlags.Visible); menuitem = new CheckMenuItem ("Accelerator locked"); menu.Append (menuitem); menuitem.AddAccelerator ("activate", accel_group, 0xFFBF, 0, AccelFlags.Visible | AccelFlags.Locked); menuitem = new CheckMenuItem ("Accelerator Frozen"); menu.Append (menuitem); menuitem.AddAccelerator ("activate", accel_group, 0xFFBF, 0, AccelFlags.Visible); menuitem.AddAccelerator ("activate", accel_group, 0xFFC0, 0, AccelFlags.Visible); OptionMenu option_menu = new OptionMenu (); option_menu.Menu = menu; option_menu.SetHistory (3); box2.PackStart (option_menu, true, true, 0); box1.PackStart (new HSeparator (), false, false, 0); box2 = new VBox (false, 10); box2.BorderWidth = 10; box1.PackStart (box2, false, true, 0); Button close_button = new Button (Stock.Close); close_button.Clicked += new EventHandler (Close_Button); box2.PackStart (close_button, true, true, 0); close_button.CanDefault = true; close_button.GrabDefault (); window.ShowAll (); return window; }
public SparkleLog(string path) : base("") { LocalPath = path; string name = System.IO.Path.GetFileName (LocalPath); SetDefaultSize (480, 640); SetPosition (WindowPosition.Center); BorderWidth = 0; // TRANSLATORS: {0} is a folder name, and {1} is a server address Title = String.Format(_("Recent Events in ‘{0}’"), name); IconName = "folder-sparkleshare"; DeleteEvent += delegate { Close (); }; // Adds a hidden menubar that contains to enable keyboard // shortcuts to close the log MenuBar = new MenuBar (); MenuItem file_item = new MenuItem ("File"); Menu file_menu = new Menu (); MenuItem close_1 = new MenuItem ("Close1"); MenuItem close_2 = new MenuItem ("Close2"); // adds specific Ctrl+W and Esc key accelerators to Log Window AccelGroup accel_group = new AccelGroup (); AddAccelGroup (accel_group); // Close on Esc close_1.AddAccelerator ("activate", accel_group, new AccelKey (Gdk.Key.W, Gdk.ModifierType.ControlMask, AccelFlags.Visible)); close_1.Activated += delegate { Close (); }; // Close on Ctrl+W close_2.AddAccelerator ("activate", accel_group, new AccelKey (Gdk.Key.Escape, Gdk.ModifierType.None, AccelFlags.Visible)); close_2.Activated += delegate { Close (); }; file_menu.Append (close_1); file_menu.Append (close_2); file_item.Submenu = file_menu; MenuBar.Append (file_item); // Hacky way to hide the menubar, but the accellerators // will simply be disabled when using Hide () MenuBar.HeightRequest = 1; MenuBar.ModifyBg (StateType.Normal, Style.Background (StateType.Normal)); LayoutVertical = new VBox (false, 0); LayoutVertical.PackStart (CreateEventLog (), true, true, 0); HButtonBox dialog_buttons = new HButtonBox { Layout = ButtonBoxStyle.Edge, BorderWidth = 12 }; Button open_folder_button = new Button (_("_Open Folder")) { UseUnderline = true }; open_folder_button.Clicked += delegate (object o, EventArgs args) { Process process = new Process (); process.StartInfo.FileName = Defines.OPEN_COMMAND; process.StartInfo.Arguments = LocalPath.Replace (" ", "\\ "); // Escape space-characters process.Start (); Close (); }; Button close_button = new Button (Stock.Close); close_button.Clicked += delegate { Close (); }; dialog_buttons.Add (open_folder_button); dialog_buttons.Add (close_button); LayoutVertical.PackStart (new HSeparator (), false, false, 0); // We have to hide the menubar somewhere... LayoutVertical.PackStart (MenuBar, false, false, 0); LayoutVertical.PackStart (dialog_buttons, false, false, 0); Add (LayoutVertical); }
private void BuildCommandsMenu() { Gtk.AccelGroup group = new AccelGroup (); Gtk.MenuItem commands = new MenuItem ("Commands"); Gtk.Menu commandsMenu = new Menu (); commands.Submenu = commandsMenu; menubar1.Append (commands); //Select all Gtk.MenuItem selectAll = new ImageMenuItem (Stock.SelectAll, group); selectAll.Activated += delegate { UndoableCommand command = new UndoableCommand (new SelectAllCommand ("Select all", this)); command.Execute (); }; commandsMenu.Append (selectAll); //Send to back command Gtk.MenuItem sendToBack = new ImageMenuItem ("Send to _back"); sendToBack.Activated += delegate { }; commandsMenu.Append (sendToBack); //Bring to front command Gtk.MenuItem bringToFront = new ImageMenuItem ("Bring to _front"); bringToFront.Activated += delegate { }; commandsMenu.Append (bringToFront); //Change attribute Gtk.MenuItem changeFontAttribute = new ImageMenuItem ("Change font to Terminus"); changeFontAttribute.Activated += delegate { Console.WriteLine ("Executng"); }; commandsMenu.Append (changeFontAttribute); }
private MenuItem MakeFileMenu() { Menu menu = new Menu(); AccelGroup group = new AccelGroup(); window.AddAccelGroup(group); ImageMenuItem quit = new ImageMenuItem(Stock.Quit, group); quit.AddAccelerator("activate", group, new AccelKey(Gdk.Key.q, Gdk.ModifierType.ControlMask, AccelFlags.Visible)); quit.Activated += new EventHandler(OnFileQuit); menu.Append(quit); MenuItem label = new MenuItem("_File"); label.Submenu = menu; return label; }