private void AddButtons() { errorButton = new ToggleToolButton (); UpdateErrorCount (); errorButton.Active = true; errorButton.IconWidget = new Gtk.Image (Gtk.Stock.DialogError, Gtk.IconSize.Button); errorButton.IsImportant = true; errorButton.Toggled += new EventHandler (OnFilterToggled); warnButton = new ToggleToolButton (); UpdateWarnCount (); warnButton.Active = true; warnButton.IconWidget = new Gtk.Image (Gtk.Stock.DialogWarning, Gtk.IconSize.Button); warnButton.IsImportant = true; warnButton.Toggled += new EventHandler (OnFilterToggled); infoButton = new ToggleToolButton (); UpdateInfoCount (); infoButton.Active = true; infoButton.IconWidget = new Gtk.Image (Gtk.Stock.DialogInfo, Gtk.IconSize.Button); infoButton.IsImportant = true; infoButton.Toggled += new EventHandler (OnFilterToggled); toolbar2.Insert (errorButton, -1); toolbar2.Insert (new SeparatorToolItem (), -1); toolbar2.Insert (warnButton, -1); toolbar2.Insert (new SeparatorToolItem (), -1); toolbar2.Insert (infoButton, -1); toolbar2.ShowAll(); }
static void Toggled_cb(IntPtr inst) { try { ToggleToolButton __obj = GLib.Object.GetObject(inst, false) as ToggleToolButton; __obj.OnToggled(); } catch (Exception e) { GLib.ExceptionManager.RaiseUnhandledException(e, false); } }
void AppendCommand(CommandDescriptor cmd, ObjectWrapper widget) { Gtk.ToolButton button; if (cmd.IsToggleCommand(widget.Wrapped)) { button = new Gtk.ToggleToolButton(); ((Gtk.ToggleToolButton)button).Active = cmd.IsToogled(widget.Wrapped); toggles.Add(cmd); editors[cmd.Name] = button; } else { button = new Gtk.ToolButton(null, null); } Gtk.Image img = cmd.GetImage(); if (img != null) { button.IconWidget = img; button.Label = cmd.Label; if (cmd.Label != null && cmd.Label.Length > 0) { button.TooltipText = cmd.Label; } } else { button.Label = cmd.Label; button.IsImportant = true; } button.Clicked += delegate(object o, EventArgs args) { if (!updating) { cmd.Run(widget.Wrapped); } }; button.ShowAll(); Insert(button, -1); if (cmd.HasDependencies) { editors[cmd.Name] = button; sensitives[cmd] = cmd; } if (cmd.HasVisibility) { editors[cmd.Name] = button; invisibles[cmd] = cmd; } wrappers [cmd] = widget; }
public ToolbarBase(UMLDiagram diagram) : base() { _diagram = diagram; ToolbarStyle = ToolbarStyle.Icons; Tooltips = true; _tooltips = new Tooltips (); _tbuttonGrid = new ToggleToolButton (); _tbuttonGrid.IconWidget = new Gtk.Image (MonoUML.IconLibrary.PixbufLoader.GetIcon ("grid_tbar.png")); _tbuttonGrid.SetTooltip (_tooltips, GettextCatalog.GetString ("Show grid"), GettextCatalog.GetString ("Show grid")); _tbuttonSnap2Grid = new ToggleToolButton (); _tbuttonSnap2Grid.IconWidget = new Gtk.Image (MonoUML.IconLibrary.PixbufLoader.GetIcon ("snap2grid_tbar.png")); _tbuttonSnap2Grid.SetTooltip (_tooltips, GettextCatalog.GetString ("Snap to grid"), GettextCatalog.GetString ("Snap to grid")); Insert (_tbuttonGrid, -1); Insert (_tbuttonSnap2Grid, -1); InsertSeparator (); DrawIcons (); }
void UpdateButtons () { updating = true; foreach (Gtk.Widget c in Children) Remove (c); foreach (Gtk.Widget page in notebook.Children) { Gtk.Widget t = notebook.GetTabLabel (page); notebook.SetTabLabel (page, new Gtk.Label ("")); // Gtk.Widget nw; // if (t is Gtk.Label) // nw = new Gtk.Label (((Gtk.Label)t).Text); // else // nw = new Gtk.Label (""); ToggleToolButton button = new ToggleToolButton (); button.IsImportant = true; button.LabelWidget = t; button.Clicked += new EventHandler (OnButtonToggled); button.ShowAll (); Insert (button, -1); } updating = false; }
// // Constructor // public MainWindow (Db db) { this.db = db; if (Toplevel == null) Toplevel = this; Glade.XML gui = new Glade.XML (null, "f-spot.glade", "main_window", "f-spot"); gui.Autoconnect (this); LoadPreference (Preferences.MAIN_WINDOW_WIDTH); LoadPreference (Preferences.MAIN_WINDOW_X); LoadPreference (Preferences.MAIN_WINDOW_MAXIMIZED); main_window.ShowAll (); LoadPreference (Preferences.SIDEBAR_POSITION); LoadPreference (Preferences.METADATA_EMBED_IN_IMAGE); LoadPreference (Preferences.COLOR_MANAGEMENT_ENABLED); LoadPreference (Preferences.COLOR_MANAGEMENT_USE_X_PROFILE); FSpot.ColorManagement.LoadSettings(); #if GTK_2_10 pagesetup_menu_item.Activated += HandlePageSetupActivated; #else pagesetup_menu_item.Visible = false; #endif toolbar = new Gtk.Toolbar (); toolbar_vbox.PackStart (toolbar); ToolButton import_button = GtkUtil.ToolButtonFromTheme ("gtk-add", Catalog.GetString ("Import"), false); import_button.Clicked += HandleImportCommand; import_button.SetTooltip (ToolTips, Catalog.GetString ("Import new images"), null); toolbar.Insert (import_button, -1); toolbar.Insert (new SeparatorToolItem (), -1); ToolButton rl_button = GtkUtil.ToolButtonFromTheme ("object-rotate-left", Catalog.GetString ("Rotate Left"), true); rl_button.Clicked += HandleRotate270Command; toolbar.Insert (rl_button, -1); ToolButton rr_button = GtkUtil.ToolButtonFromTheme ("object-rotate-right", Catalog.GetString ("Rotate Right"), true); rr_button.Clicked += HandleRotate90Command; toolbar.Insert (rr_button, -1); toolbar.Insert (new SeparatorToolItem (), -1); browse_button = new ToggleToolButton (); browse_button.Label = Catalog.GetString ("Browse"); browse_button.IconName = "mode-browse"; browse_button.IsImportant = true; browse_button.Toggled += HandleToggleViewBrowse; browse_button.SetTooltip (ToolTips, Catalog.GetString ("Browse many photos simultaneously"), null); toolbar.Insert (browse_button, -1); edit_button = new ToggleToolButton (); edit_button.Label = Catalog.GetString ("Edit Image"); edit_button.IconName = "mode-image-edit"; edit_button.IsImportant = true; edit_button.Toggled += HandleToggleViewPhoto; edit_button.SetTooltip (ToolTips, Catalog.GetString ("View and edit a photo"), null); toolbar.Insert (edit_button, -1); toolbar.Insert (new SeparatorToolItem (), -1); ToolButton fs_button = GtkUtil.ToolButtonFromTheme ("view-fullscreen", Catalog.GetString ("Fullscreen"), true); fs_button.Clicked += HandleViewFullscreen; fs_button.SetTooltip (ToolTips, Catalog.GetString ("View photos fullscreen"), null); toolbar.Insert (fs_button, -1); ToolButton ss_button = GtkUtil.ToolButtonFromTheme ("media-playback-start", Catalog.GetString ("Slideshow"), true); ss_button.Clicked += HandleViewSlideShow; ss_button.SetTooltip (ToolTips, Catalog.GetString ("View photos in a slideshow"), null); toolbar.Insert (ss_button, -1); SeparatorToolItem white_space = new SeparatorToolItem (); white_space.Draw = false; white_space.Expand = true; toolbar.Insert (white_space, -1); ToolItem label_item = new ToolItem (); count_label = new Label (String.Empty); label_item.Child = count_label; toolbar.Insert (label_item, -1); display_previous_button = new ToolButton (Stock.GoBack); toolbar.Insert (display_previous_button, -1); display_previous_button.SetTooltip (ToolTips, Catalog.GetString ("Previous photo"), String.Empty); display_previous_button.Clicked += new EventHandler (HandleDisplayPreviousButtonClicked); display_next_button = new ToolButton (Stock.GoForward); toolbar.Insert (display_next_button, -1); display_next_button.SetTooltip (ToolTips, Catalog.GetString ("Next photo"), String.Empty); display_next_button.Clicked += new EventHandler (HandleDisplayNextButtonClicked); sidebar = new Sidebar (); ViewModeChanged += sidebar.HandleMainWindowViewModeChanged; sidebar_vbox.Add (sidebar); tag_selection_scrolled = new ScrolledWindow (); tag_selection_scrolled.ShadowType = ShadowType.In; tag_selection_widget = new TagSelectionWidget (db.Tags); tag_selection_scrolled.Add (tag_selection_widget); sidebar.AppendPage (tag_selection_scrolled, Catalog.GetString ("Tags"), "tag"); AddinManager.AddExtensionNodeHandler ("/FSpot/Sidebar", OnSidebarExtensionChanged); sidebar.Context = ViewContext.Library; sidebar.CloseRequested += HideSidebar; sidebar.Show (); info_box = new InfoBox (); ViewModeChanged += info_box.HandleMainWindowViewModeChanged; info_box.VersionIdChanged += delegate (InfoBox box, uint version_id) { UpdateForVersionIdChange (version_id);}; sidebar_vbox.PackEnd (info_box, false, false, 0); info_box.Context = ViewContext.Library; tag_selection_widget.Selection.Changed += HandleTagSelectionChanged; tag_selection_widget.DragDataGet += HandleTagSelectionDragDataGet; tag_selection_widget.DragDrop += HandleTagSelectionDragDrop; tag_selection_widget.DragBegin += HandleTagSelectionDragBegin; tag_selection_widget.KeyPressEvent += HandleTagSelectionKeyPress; Gtk.Drag.SourceSet (tag_selection_widget, Gdk.ModifierType.Button1Mask | Gdk.ModifierType.Button3Mask, tag_target_table, DragAction.Copy | DragAction.Move); tag_selection_widget.DragDataReceived += HandleTagSelectionDragDataReceived; tag_selection_widget.DragMotion += HandleTagSelectionDragMotion; Gtk.Drag.DestSet (tag_selection_widget, DestDefaults.All, tag_dest_target_table, DragAction.Copy | DragAction.Move ); tag_selection_widget.ButtonPressEvent += HandleTagSelectionButtonPressEvent; tag_selection_widget.PopupMenu += HandleTagSelectionPopupMenu; tag_selection_widget.RowActivated += HandleTagSelectionRowActivated; LoadPreference (Preferences.TAG_ICON_SIZE); try { query = new FSpot.PhotoQuery (db.Photos); } catch (System.Exception e) { //FIXME assume any exception here is due to a corrupt db and handle that. new RepairDbDialog (e, db.Repair (), main_window); query = new FSpot.PhotoQuery (db.Photos); } UpdateStatusLabel (); query.Changed += HandleQueryChanged; db.Photos.ItemsChanged += HandleDbItemsChanged; db.Tags.ItemsChanged += HandleTagsChanged; db.Tags.ItemsAdded += HandleTagsChanged; db.Tags.ItemsRemoved += HandleTagsChanged; #if SHOW_CALENDAR FSpot.SimpleCalendar cal = new FSpot.SimpleCalendar (query); cal.DaySelected += HandleCalendarDaySelected; left_vbox.PackStart (cal, false, true, 0); #endif group_selector = new FSpot.GroupSelector (); group_selector.Adaptor = new FSpot.TimeAdaptor (query, Preferences.Get<bool> (Preferences.GROUP_ADAPTOR_ORDER_ASC)); group_selector.ShowAll (); if (zoom_scale != null) { zoom_scale.ValueChanged += HandleZoomScaleValueChanged; } view_vbox.PackStart (group_selector, false, false, 0); view_vbox.ReorderChild (group_selector, 0); find_bar = new FindBar (query, tag_selection_widget.Model); view_vbox.PackStart (find_bar, false, false, 0); view_vbox.ReorderChild (find_bar, 1); main_window.KeyPressEvent += HandleKeyPressEvent; query_widget = new FSpot.QueryWidget (query, db, tag_selection_widget); query_widget.Logic.Changed += HandleQueryLogicChanged; view_vbox.PackStart (query_widget, false, false, 0); view_vbox.ReorderChild (query_widget, 2); icon_view = new QueryView (query); icon_view.ZoomChanged += HandleZoomChanged; LoadPreference (Preferences.ZOOM); LoadPreference (Preferences.SHOW_TAGS); LoadPreference (Preferences.SHOW_DATES); LoadPreference (Preferences.SHOW_RATINGS); icon_view_scrolled.Add (icon_view); icon_view.DoubleClicked += HandleDoubleClicked; icon_view.Vadjustment.ValueChanged += HandleIconViewScroll; icon_view.GrabFocus (); new FSpot.PreviewPopup (icon_view); Gtk.Drag.SourceSet (icon_view, Gdk.ModifierType.Button1Mask | Gdk.ModifierType.Button3Mask, icon_source_target_table, DragAction.Copy | DragAction.Move); icon_view.DragBegin += HandleIconViewDragBegin; icon_view.DragDataGet += HandleIconViewDragDataGet; TagMenu tag_menu = new TagMenu (null, Database.Tags); tag_menu.NewTagHandler += delegate { HandleCreateTagAndAttach (this, null); }; tag_menu.TagSelected += HandleAttachTagMenuSelected; tag_menu.Populate(); attach_tag.Submenu = tag_menu; PhotoTagMenu pmenu = new PhotoTagMenu (); pmenu.TagSelected += HandleRemoveTagMenuSelected; remove_tag.Submenu = pmenu; Gtk.Drag.DestSet (icon_view, DestDefaults.All, icon_dest_target_table, DragAction.Copy | DragAction.Move); // icon_view.DragLeave += new DragLeaveHandler (HandleIconViewDragLeave); icon_view.DragMotion += HandleIconViewDragMotion; icon_view.DragDrop += HandleIconViewDragDrop; icon_view.DragDataReceived += HandleIconViewDragDataReceived; icon_view.KeyPressEvent += HandleIconViewKeyPressEvent; photo_view = new PhotoView (query); photo_box.Add (photo_view); photo_view.DoubleClicked += HandleDoubleClicked; photo_view.KeyPressEvent += HandlePhotoViewKeyPressEvent; photo_view.UpdateStarted += HandlePhotoViewUpdateStarted; photo_view.UpdateFinished += HandlePhotoViewUpdateFinished; photo_view.View.ZoomChanged += HandleZoomChanged; // Tag typing: focus the tag entry if the user starts typing a tag icon_view.KeyPressEvent += HandlePossibleTagTyping; photo_view.KeyPressEvent += HandlePossibleTagTyping; tag_entry = new TagEntry (db.Tags); tag_entry.KeyPressEvent += HandleTagEntryKeyPressEvent; tag_entry.TagsAttached += HandleTagEntryTagsAttached; tag_entry.TagsRemoved += HandleTagEntryRemoveTags; tag_entry.Activated += HandleTagEntryActivate; tag_entry_container.Add (tag_entry); Gtk.Drag.DestSet (photo_view, DestDefaults.All, tag_target_table, DragAction.Copy | DragAction.Move); photo_view.DragMotion += HandlePhotoViewDragMotion; photo_view.DragDrop += HandlePhotoViewDragDrop; photo_view.DragDataReceived += HandlePhotoViewDragDataReceived; view_notebook.SwitchPage += HandleViewNotebookSwitchPage; group_selector.Adaptor.GlassSet += HandleAdaptorGlassSet; group_selector.Adaptor.Changed += HandleAdaptorChanged; LoadPreference (Preferences.GROUP_ADAPTOR); LoadPreference (Preferences.GROUP_ADAPTOR_ORDER_ASC); this.selection = new MainSelection (this); this.selection.Changed += HandleSelectionChanged; this.selection.ItemsChanged += HandleSelectionItemsChanged; this.selection.Changed += sidebar.HandleSelectionChanged; this.selection.ItemsChanged += sidebar.HandleSelectionItemsChanged; Mono.Addins.AddinManager.ExtensionChanged += PopulateExtendableMenus; PopulateExtendableMenus (null, null); UpdateMenus (); main_window.ShowAll (); tagbar.Hide (); find_bar.Hide (); UpdateFindByTagMenu (); LoadPreference (Preferences.SHOW_TOOLBAR); LoadPreference (Preferences.SHOW_SIDEBAR); LoadPreference (Preferences.SHOW_TIMELINE); LoadPreference (Preferences.SHOW_FILMSTRIP); LoadPreference (Preferences.GNOME_MAILTO_ENABLED); Preferences.SettingChanged += OnPreferencesChanged; main_window.DeleteEvent += HandleDeleteEvent; query_widget.HandleChanged (query); query_widget.Hide (); // When the icon_view is loaded, set it's initial scroll position icon_view.SizeAllocated += HandleIconViewReady; export.Activated += HandleExportActivated; UpdateToolbar (); Banshee.Kernel.Scheduler.Resume (); }
public DisplayWindow() : base(WindowType.Toplevel) { MenuBar mb = new MenuBar(); MenuItem mi_file = new MenuItem("File"); Menu m_file = new Menu(); MenuItem mi_file_opendll = new MenuItem("Connect with algorithm library..."); mi_file_opendll.Activated += openLibFile; MenuItem mi_file_openxml = new MenuItem("Open configuration file..."); mi_file_openxml.Activated += openConfigFile; MenuItem mi_file_quit = new MenuItem("Quit"); mi_file_quit.Activated += delegate { Application.Quit(); }; MenuItem mi_edit = new MenuItem("Edit"); Menu m_edit = new Menu(); RadioMenuItem mi_edit_move = new RadioMenuItem("Move nodes"); RadioMenuItem mi_edit_insp = new RadioMenuItem(mi_edit_move, "Inspect node"); MenuItem mi_edit_play = new ImageMenuItem(Stock.MediaPlay, null); MenuItem mi_edit_pause = new ImageMenuItem(Stock.MediaPause, null); mb.Add(mi_file); mi_file.Submenu = m_file; m_file.Add(mi_file_opendll); m_file.Add(mi_file_openxml); m_file.Add(new SeparatorMenuItem()); m_file.Add(mi_file_quit); mi_edit.Submenu = m_edit; m_edit.Add(mi_edit_move); m_edit.Add(mi_edit_insp); m_edit.Add(new SeparatorMenuItem()); m_edit.Add(mi_edit_play); m_edit.Add(mi_edit_pause); mb.Add(mi_edit); Toolbar tb = new Toolbar(); StockItem si; StockManager.Lookup(Stock.MediaPlay, ref si); ToolButton tb_opendll = new ToolButton(Stock.Connect); tb_opendll.Clicked += openLibFile; ToolButton tb_openxml = new ToolButton(Stock.Open); tb_openxml.Clicked += openConfigFile; ToolButton tb_move = new ToggleToolButton(Stock.Preferences); ToolButton tb_insp = new ToggleToolButton(Stock.ZoomIn); ToolButton tb_play = new ToolButton(Stock.MediaPlay); ToolButton tb_pause = new ToolButton(Stock.MediaPause); tb.Add(tb_opendll); tb.Add(tb_openxml); tb.Add(new SeparatorToolItem()); tb.Add(tb_move); tb.Add(tb_insp); tb.Add(new SeparatorToolItem()); tb.Add(tb_play); tb.Add(tb_pause); this.bpsp = new BlueprintParallelStatePainter(); this.bm = new BlueprintMediabar(); this.bm.CurrentChanged += HandleBmhandleCurrentChanged; this.bm.CurrentChanged += this.bpsp.RepaintEdges; this.bs = new BlueprintTabControl(1, 1, 1); this.bs.CurrentChanged += HandleBshandleCurrentChanged; ; vb.PackStart(mb, false, false, 0x00); vb.PackStart(tb, false, false, 0x00); vb.PackStart(this.bpsp, true, true, 0x00); vb.PackStart(this.bm, false, false, 0x00); vb.PackStart(this.bs, false, false, 0x00); this.Title = "Parallel Visualizer"; this.Resize(640, 480); this.Add(vb); this.ShowAll(); }
protected Gtk.ToggleToolButton CreateToggleToolButton(string pixbuf, string tooltip) { ToggleToolButton rtn = new Gtk.ToggleToolButton (""); rtn.IconWidget = new Gtk.Image (MonoUML.IconLibrary.PixbufLoader.GetIcon (pixbuf)); rtn.SetTooltip (_tooltips, tooltip, tooltip); return rtn; }
protected virtual ToggleToolButton CreateToolButton() { Image i2 = new Image (PintaCore.Resources.GetIcon (Icon)); i2.Show (); ToggleToolButton tool_item = new ToggleToolButton (); tool_item.IconWidget = i2; tool_item.Show (); tool_item.Label = Name; if (ShortcutKey != (Gdk.Key)0) tool_item.TooltipText = string.Format ("{0}\n{2}: {1}\n\n{3}", Name, ShortcutKey.ToString ().ToUpperInvariant (), Catalog.GetString ("Shortcut key"), StatusBarText); else tool_item.TooltipText = Name; return tool_item; }
public SearchResultWidget () { var vbox = new VBox (); var toolbar = new Toolbar () { Orientation = Orientation.Vertical, IconSize = IconSize.Menu, ToolbarStyle = ToolbarStyle.Icons, }; this.PackStart (vbox, true, true, 0); this.PackStart (toolbar, false, false, 0); labelStatus = new Label () { Xalign = 0, Justify = Justification.Left, }; var hpaned = new HPaned (); vbox.PackStart (hpaned, true, true, 0); vbox.PackStart (labelStatus, false, false, 0); var resultsScroll = new CompactScrolledWindow (); hpaned.Pack1 (resultsScroll, true, true); scrolledwindowLogView = new CompactScrolledWindow (); hpaned.Pack2 (scrolledwindowLogView, true, true); textviewLog = new TextView () { Editable = false, }; scrolledwindowLogView.Add (textviewLog); store = new ListStore (typeof (SearchResult), typeof (bool) // didRead ); treeviewSearchResults = new PadTreeView () { Model = store, HeadersClickable = true, RulesHint = true, }; treeviewSearchResults.Selection.Mode = Gtk.SelectionMode.Multiple; resultsScroll.Add (treeviewSearchResults); this.ShowAll (); var fileNameColumn = new TreeViewColumn { Resizable = true, SortColumnId = 0, Title = GettextCatalog.GetString("File") }; fileNameColumn.FixedWidth = 200; var fileNamePixbufRenderer = new CellRendererPixbuf (); fileNameColumn.PackStart (fileNamePixbufRenderer, false); fileNameColumn.SetCellDataFunc (fileNamePixbufRenderer, FileIconDataFunc); fileNameColumn.PackStart (treeviewSearchResults.TextRenderer, true); fileNameColumn.SetCellDataFunc (treeviewSearchResults.TextRenderer, FileNameDataFunc); treeviewSearchResults.AppendColumn (fileNameColumn); // TreeViewColumn lineColumn = treeviewSearchResults.AppendColumn (GettextCatalog.GetString ("Line"), new CellRendererText (), ResultLineDataFunc); // lineColumn.SortColumnId = 1; // lineColumn.FixedWidth = 50; // TreeViewColumn textColumn = treeviewSearchResults.AppendColumn (GettextCatalog.GetString ("Text"), treeviewSearchResults.TextRenderer, ResultTextDataFunc); textColumn.SortColumnId = 2; textColumn.Resizable = true; textColumn.FixedWidth = 300; TreeViewColumn pathColumn = treeviewSearchResults.AppendColumn (GettextCatalog.GetString ("Path"), treeviewSearchResults.TextRenderer, ResultPathDataFunc); pathColumn.SortColumnId = 3; pathColumn.Resizable = true; pathColumn.FixedWidth = 500; store.SetSortFunc (0, CompareFileNames); // store.SetSortFunc (1, CompareLineNumbers); store.SetSortFunc (3, CompareFilePaths); treeviewSearchResults.RowActivated += TreeviewSearchResultsRowActivated; buttonStop = new ToolButton (Stock.Stop) { Sensitive = false }; buttonStop.Clicked += ButtonStopClicked; buttonStop.TooltipText = GettextCatalog.GetString ("Stop"); toolbar.Insert (buttonStop, -1); var buttonClear = new ToolButton (Gtk.Stock.Clear); buttonClear.Clicked += ButtonClearClicked; buttonClear.TooltipText = GettextCatalog.GetString ("Clear results"); toolbar.Insert (buttonClear, -1); var buttonOutput = new ToggleToolButton (Gui.Stock.OutputIcon); buttonOutput.Clicked += ButtonOutputClicked; buttonOutput.TooltipText = GettextCatalog.GetString ("Show output"); toolbar.Insert (buttonOutput, -1); buttonPin = new ToggleToolButton (Gui.Stock.PinUp); buttonPin.Clicked += ButtonPinClicked; buttonPin.TooltipText = GettextCatalog.GetString ("Pin results pad"); toolbar.Insert (buttonPin, -1); store.SetSortColumnId (3, SortType.Ascending); ShowAll (); scrolledwindowLogView.Hide (); }
public SearchResultWidget () { this.Build (); store = new ListStore (typeof (SearchResult), typeof (bool) // didRead ); treeviewSearchResults.Model = store; treeviewSearchResults.Selection.Mode = Gtk.SelectionMode.Multiple; treeviewSearchResults.HeadersClickable = true; treeviewSearchResults.PopupMenu += OnPopupMenu; treeviewSearchResults.ButtonPressEvent += HandleButtonPressEvent; treeviewSearchResults.RulesHint = true; TreeViewColumn fileNameColumn = new TreeViewColumn (); fileNameColumn.Resizable = true; fileNameColumn.SortColumnId = 0; fileNameColumn.Title = GettextCatalog.GetString ("File"); var fileNamePixbufRenderer = new CellRendererPixbuf (); fileNameColumn.PackStart (fileNamePixbufRenderer, false); fileNameColumn.SetCellDataFunc (fileNamePixbufRenderer, new Gtk.TreeCellDataFunc (FileIconDataFunc)); CellRendererText fileNameRenderer = new CellRendererText (); fileNameColumn.PackStart (fileNameRenderer, true); fileNameColumn.SetCellDataFunc (fileNameRenderer, new Gtk.TreeCellDataFunc (FileNameDataFunc)); treeviewSearchResults.AppendColumn (fileNameColumn); TreeViewColumn lineColumn = treeviewSearchResults.AppendColumn (GettextCatalog.GetString ("Line"), new Gtk.CellRendererText (), new Gtk.TreeCellDataFunc (ResultLineDataFunc)); lineColumn.SortColumnId = 1; TreeViewColumn textColumn = treeviewSearchResults.AppendColumn (GettextCatalog.GetString ("Text"), new Gtk.CellRendererText (), new Gtk.TreeCellDataFunc (ResultTextDataFunc)); textColumn.SortColumnId = 2; textColumn.Resizable = true; TreeViewColumn pathColumn = treeviewSearchResults.AppendColumn (GettextCatalog.GetString ("Path"), new Gtk.CellRendererText (), new Gtk.TreeCellDataFunc (ResultPathDataFunc)); pathColumn.SortColumnId = 3; pathColumn.Resizable = true; store.SetSortFunc (0, new TreeIterCompareFunc (CompareFileNames)); store.SetSortFunc (1, new TreeIterCompareFunc (CompareLineNumbers)); store.SetSortFunc (3, new TreeIterCompareFunc (CompareFilePaths)); treeviewSearchResults.RowActivated += TreeviewSearchResultsRowActivated; buttonStop = new ToolButton ("gtk-stop"); buttonStop.Sensitive = false; buttonStop.Clicked += ButtonStopClicked; buttonStop.TooltipText = GettextCatalog.GetString ("Stop"); toolbar.Insert (buttonStop, -1); ToolButton buttonClear = new ToolButton ("gtk-clear"); buttonClear.Clicked += ButtonClearClicked; buttonClear.TooltipText = GettextCatalog.GetString ("Clear results"); toolbar.Insert (buttonClear, -1); ToggleToolButton buttonOutput = new ToggleToolButton (MonoDevelop.Ide.Gui.Stock.OutputIcon); buttonOutput.Clicked += ButtonOutputClicked; buttonOutput.TooltipText = GettextCatalog.GetString ("Show output"); toolbar.Insert (buttonOutput, -1); buttonPin = new ToggleToolButton ("md-pin-up"); buttonPin.Clicked += ButtonPinClicked; buttonPin.TooltipText = GettextCatalog.GetString ("Pin results pad"); toolbar.Insert (buttonPin, -1); store.SetSortColumnId (3, SortType.Ascending); ShowAll (); scrolledwindowLogView.Hide (); }
protected ToggleToolButton AddButton (string label, Gtk.Widget page) { CheckCreateSubViewToolbar (); updating = true; ToggleToolButton button = new ToggleToolButton (); button.Label = label; button.IsImportant = true; button.Clicked += new EventHandler (OnButtonToggled); button.ShowAll (); subViewToolbar.Insert (button, -1); subViewNotebook.AppendPage (page, new Gtk.Label ()); page.ShowAll (); EnsureToolbarBoxSeparator (); updating = false; return button; }
public ToolbarToggle(ICommand cmd) : base(cmd) { _Button = new ToggleToolButton(cmd.Properties.Icon); _Button.Toggled += new EventHandler (OnToggled); _Button.Label = cmd.Properties.Text; this.Add(_Button); _Button.Show(); this.ShowAll(); }
private void SetHorizontalToolBar() { ToolButton editbutton = new ToolButton(Stock.Edit); editbutton.IsImportant = true; editbutton.Sensitive = true; editbutton.Clicked += new EventHandler(OnEditButtonClicked); toolbar1.Insert(editbutton, -1); lockbutton = new ToggleToolButton(Stock.DndMultiple); lockbutton.IsImportant = true; lockbutton.Sensitive = true; lockbutton.Label = "Lock View"; lockbutton.Clicked += new EventHandler(OnLockButtonClicked); toolbar1.Insert(lockbutton, -1); streambutton = new ToggleToolButton(Stock.SelectAll); streambutton.IsImportant = true; streambutton.Sensitive = true; streambutton.Label = "Photostream"; streambutton.Clicked += new EventHandler(OnStreamButtonClicked); toolbar1.Insert(streambutton, -1); uploadbutton = new ToggleToolButton(Stock.SortAscending); uploadbutton.IsImportant = true; uploadbutton.Sensitive = true; uploadbutton.Label = "Uploads"; uploadbutton.Clicked += new EventHandler(OnUploadButtonClicked); toolbar1.Insert(uploadbutton, -1); downloadbutton = new ToggleToolButton(Stock.SortDescending); downloadbutton.IsImportant = true; downloadbutton.Sensitive = true; downloadbutton.Label = "Downloads"; downloadbutton.Clicked += new EventHandler(OnDownloadButtonClicked); toolbar1.Insert(downloadbutton, -1); conflictbutton = new ToggleToolButton(Stock.DialogWarning); conflictbutton.IsImportant = true; conflictbutton.Sensitive = true; conflictbutton.Label = "Conflicts"; conflictbutton.Clicked += new EventHandler(OnConflictButtonClicked); toolbar1.Insert(conflictbutton, -1); syncbutton = new ToolButton(Stock.Refresh); syncbutton.IsImportant = true; syncbutton.Sensitive = true; syncbutton.Label = "Sync Now"; syncbutton.Clicked += new EventHandler(ConnectionHandler); toolbar1.Insert(syncbutton, -1); // Update the stream and conflict buttons with their respective number // of photos. UpdateToolBarButtons(); }
protected ToggleToolButton AddButton (string label, Gtk.Widget page) { updating = true; ToggleToolButton button = new ToggleToolButton (); button.Label = label; button.IsImportant = true; button.Clicked += new EventHandler (OnButtonToggled); button.ShowAll (); toolbar.Insert (button, -1); notebook.AppendPage (page, new Gtk.Label ()); updating = false; return button; }
// // Constructor // public MainWindow(Db db) { foreach (ServiceNode service in AddinManager.GetExtensionNodes ("/FSpot/Services")) { try { service.Initialize (); service.Start (); } catch (Exception e) { Log.Warning ("Something went wrong while starting the {0} extension.", service.Id); Log.DebugException (e); } } #if GSD_2_24 Log.Information ("Hack for gnome-settings-daemon engaged"); int max_age, max_size; if (Preferences.TryGet<int> (Preferences.GSD_THUMBS_MAX_AGE, out max_age)) { if (max_age < 0) Log.Debug ("maximum_age check already disabled, good"); else if (max_age == 0) Log.Warning ("maximum_age is 0 (tin-hat mode), not overriding"); else if (max_age < 180) { Log.Debug ("Setting maximum_age to a saner value"); Preferences.Set (Preferences.GSD_THUMBS_MAX_AGE, 180); } } if (Preferences.TryGet<int> (Preferences.GSD_THUMBS_MAX_SIZE, out max_size)) { int count = App.Instance.Database.Photos.Count ("photos"); // average thumbs are taking 70K, so this will push the threshold //if f-spot takes more than 70% of the thumbs space int size = count / 10; if (max_size < 0) Log.Debug ("maximum_size check already disabled, good"); else if (max_size == 0) Log.Warning ("maximum_size is 0 (tin-hat mode), not overriding"); else if (max_size < size) { Log.Debug ("Setting maximum_size to a saner value ({0}MB), according to your db size", size); Preferences.Set (Preferences.GSD_THUMBS_MAX_SIZE, size); } } #endif Database = db; if (Toplevel == null) Toplevel = this; GtkBeans.Builder builder = new GtkBeans.Builder ("main_window.ui"); builder.Autoconnect (this); //Set the global DefaultColormap. Allows transparency according //to the theme (work on murrine engine) Gdk.Colormap colormap = ((Widget)main_window).Screen.RgbaColormap; if (colormap == null) { Log.Debug ("Your screen doesn't support alpha channels!"); colormap = ((Widget)main_window).Screen.RgbColormap; } Gtk.Widget.DefaultColormap = colormap; LoadPreference (Preferences.MAIN_WINDOW_WIDTH); LoadPreference (Preferences.MAIN_WINDOW_X); LoadPreference (Preferences.MAIN_WINDOW_MAXIMIZED); main_window.ShowAll (); LoadPreference (Preferences.SIDEBAR_POSITION); LoadPreference (Preferences.METADATA_EMBED_IN_IMAGE); pagesetup_menu_item.Activated += HandlePageSetupActivated; toolbar = new Gtk.Toolbar (); toolbar_vbox.PackStart (toolbar); ToolButton import_button = GtkUtil.ToolButtonFromTheme ("gtk-add", Catalog.GetString ("Import"), true); import_button.Clicked += HandleImportCommand; import_button.SetTooltip (ToolTips, Catalog.GetString ("Import new images"), null); toolbar.Insert (import_button, -1); toolbar.Insert (new SeparatorToolItem (), -1); rl_button = GtkUtil.ToolButtonFromTheme ("object-rotate-left", Catalog.GetString ("Rotate Left"), false); rl_button.Clicked += HandleRotate270Command; toolbar.Insert (rl_button, -1); rr_button = GtkUtil.ToolButtonFromTheme ("object-rotate-right", Catalog.GetString ("Rotate Right"), false); rr_button.Clicked += HandleRotate90Command; toolbar.Insert (rr_button, -1); toolbar.Insert (new SeparatorToolItem (), -1); browse_button = new ToggleToolButton (); browse_button.Label = Catalog.GetString ("Browse"); browse_button.IconName = "mode-browse"; browse_button.IsImportant = true; browse_button.Toggled += HandleToggleViewBrowse; browse_button.SetTooltip (ToolTips, Catalog.GetString ("Browse many photos simultaneously"), null); toolbar.Insert (browse_button, -1); edit_button = new ToggleToolButton (); edit_button.Label = Catalog.GetString ("Edit Image"); edit_button.IconName = "mode-image-edit"; edit_button.IsImportant = true; edit_button.Toggled += HandleToggleViewPhoto; edit_button.SetTooltip (ToolTips, Catalog.GetString ("View and edit a photo"), null); toolbar.Insert (edit_button, -1); toolbar.Insert (new SeparatorToolItem (), -1); ToolButton fs_button = GtkUtil.ToolButtonFromTheme ("view-fullscreen", Catalog.GetString ("Fullscreen"), false); fs_button.Clicked += HandleViewFullscreen; fs_button.SetTooltip (ToolTips, Catalog.GetString ("View photos fullscreen"), null); toolbar.Insert (fs_button, -1); ToolButton ss_button = GtkUtil.ToolButtonFromTheme ("media-playback-start", Catalog.GetString ("Slideshow"), false); ss_button.Clicked += HandleViewSlideShow; ss_button.SetTooltip (ToolTips, Catalog.GetString ("View photos in a slideshow"), null); toolbar.Insert (ss_button, -1); SeparatorToolItem white_space = new SeparatorToolItem (); white_space.Draw = false; white_space.Expand = true; toolbar.Insert (white_space, -1); ToolItem label_item = new ToolItem (); count_label = new Label (String.Empty); label_item.Child = count_label; toolbar.Insert (label_item, -1); display_previous_button = new ToolButton (Stock.GoBack); toolbar.Insert (display_previous_button, -1); display_previous_button.SetTooltip (ToolTips, Catalog.GetString ("Previous photo"), String.Empty); display_previous_button.Clicked += new EventHandler (HandleDisplayPreviousButtonClicked); display_next_button = new ToolButton (Stock.GoForward); toolbar.Insert (display_next_button, -1); display_next_button.SetTooltip (ToolTips, Catalog.GetString ("Next photo"), String.Empty); display_next_button.Clicked += new EventHandler (HandleDisplayNextButtonClicked); Sidebar = new Sidebar (); ViewModeChanged += Sidebar.HandleMainWindowViewModeChanged; sidebar_vbox.Add (Sidebar); tag_selection_scrolled = new ScrolledWindow (); tag_selection_scrolled.ShadowType = ShadowType.In; tag_selection_widget = new TagSelectionWidget (Database.Tags); tag_selection_scrolled.Add (tag_selection_widget); Sidebar.AppendPage (tag_selection_scrolled, Catalog.GetString ("Tags"), "tag"); AddinManager.AddExtensionNodeHandler ("/FSpot/Sidebar", OnSidebarExtensionChanged); Sidebar.Context = ViewContext.Library; Sidebar.CloseRequested += HideSidebar; Sidebar.Show (); InfoBox = new InfoBox (); ViewModeChanged += InfoBox.HandleMainWindowViewModeChanged; InfoBox.VersionIdChanged += delegate (InfoBox box, uint version_id) { UpdateForVersionIdChange (version_id);}; sidebar_vbox.PackEnd (InfoBox, false, false, 0); InfoBox.Context = ViewContext.Library; tag_selection_widget.Selection.Changed += HandleTagSelectionChanged; tag_selection_widget.KeyPressEvent += HandleTagSelectionKeyPress; tag_selection_widget.ButtonPressEvent += HandleTagSelectionButtonPressEvent; tag_selection_widget.PopupMenu += HandleTagSelectionPopupMenu; tag_selection_widget.RowActivated += HandleTagSelectionRowActivated; LoadPreference (Preferences.TAG_ICON_SIZE); try { query = new FSpot.PhotoQuery (Database.Photos); } catch (System.Exception e) { //FIXME assume any exception here is due to a corrupt db and handle that. new RepairDbDialog (e, Database.Repair (), main_window); query = new FSpot.PhotoQuery (Database.Photos); } UpdateStatusLabel (); query.Changed += HandleQueryChanged; Database.Photos.ItemsChanged += HandleDbItemsChanged; Database.Tags.ItemsChanged += HandleTagsChanged; Database.Tags.ItemsAdded += HandleTagsChanged; Database.Tags.ItemsRemoved += HandleTagsChanged; #if SHOW_CALENDAR FSpot.SimpleCalendar cal = new FSpot.SimpleCalendar (query); cal.DaySelected += HandleCalendarDaySelected; left_vbox.PackStart (cal, false, true, 0); #endif group_selector = new FSpot.GroupSelector (); group_selector.Adaptor = new FSpot.TimeAdaptor (query, Preferences.Get<bool> (Preferences.GROUP_ADAPTOR_ORDER_ASC)); group_selector.ShowAll (); if (zoom_scale != null) { zoom_scale.ValueChanged += HandleZoomScaleValueChanged; } view_vbox.PackStart (group_selector, false, false, 0); view_vbox.ReorderChild (group_selector, 0); find_bar = new FindBar (query, tag_selection_widget.Model); view_vbox.PackStart (find_bar, false, false, 0); view_vbox.ReorderChild (find_bar, 1); main_window.KeyPressEvent += HandleKeyPressEvent; query_widget = new FSpot.QueryWidget (query, Database); query_widget.Logic.Changed += HandleQueryLogicChanged; view_vbox.PackStart (query_widget, false, false, 0); view_vbox.ReorderChild (query_widget, 2); icon_view = new QueryView (query); icon_view.ZoomChanged += HandleZoomChanged; LoadPreference (Preferences.ZOOM); LoadPreference (Preferences.SHOW_TAGS); LoadPreference (Preferences.SHOW_DATES); LoadPreference (Preferences.SHOW_RATINGS); icon_view_scrolled.Add (icon_view); icon_view.DoubleClicked += HandleDoubleClicked; icon_view.Vadjustment.ValueChanged += HandleIconViewScroll; icon_view.GrabFocus (); new FSpot.PreviewPopup (icon_view); Gtk.Drag.SourceSet (icon_view, Gdk.ModifierType.Button1Mask | Gdk.ModifierType.Button3Mask, icon_source_target_table, DragAction.Copy | DragAction.Move); icon_view.DragBegin += HandleIconViewDragBegin; icon_view.DragDataGet += HandleIconViewDragDataGet; TagMenu tag_menu = new TagMenu (null, Database.Tags); tag_menu.NewTagHandler += delegate { HandleCreateTagAndAttach (this, null); }; tag_menu.TagSelected += HandleAttachTagMenuSelected; tag_menu.Populate(); (uimanager.GetWidget("/ui/menubar1/edit2/attach_tag") as MenuItem).Submenu = tag_menu; PhotoTagMenu pmenu = new PhotoTagMenu (); pmenu.TagSelected += HandleRemoveTagMenuSelected; (uimanager.GetWidget("/ui/menubar1/edit2/remove_tag") as MenuItem).Submenu = pmenu; Gtk.Drag.DestSet (icon_view, DestDefaults.All, icon_dest_target_table, DragAction.Copy | DragAction.Move); // icon_view.DragLeave += new DragLeaveHandler (HandleIconViewDragLeave); icon_view.DragMotion += HandleIconViewDragMotion; icon_view.DragDrop += HandleIconViewDragDrop; icon_view.DragDataReceived += HandleIconViewDragDataReceived; icon_view.KeyPressEvent += HandleIconViewKeyPressEvent; photo_view = new PhotoView (query); photo_box.Add (photo_view); photo_view.DoubleClicked += HandleDoubleClicked; photo_view.KeyPressEvent += HandlePhotoViewKeyPressEvent; photo_view.UpdateStarted += HandlePhotoViewUpdateStarted; photo_view.UpdateFinished += HandlePhotoViewUpdateFinished; photo_view.View.ZoomChanged += HandleZoomChanged; // Tag typing: focus the tag entry if the user starts typing a tag icon_view.KeyPressEvent += HandlePossibleTagTyping; photo_view.KeyPressEvent += HandlePossibleTagTyping; tag_entry = new TagEntry (Database.Tags); tag_entry.KeyPressEvent += HandleTagEntryKeyPressEvent; tag_entry.TagsAttached += HandleTagEntryTagsAttached; tag_entry.TagsRemoved += HandleTagEntryRemoveTags; tag_entry.Activated += HandleTagEntryActivate; tag_entry_container.Add (tag_entry); Gtk.Drag.DestSet (photo_view, DestDefaults.All, tag_target_table, DragAction.Copy | DragAction.Move); photo_view.DragMotion += HandlePhotoViewDragMotion; photo_view.DragDrop += HandlePhotoViewDragDrop; photo_view.DragDataReceived += HandlePhotoViewDragDataReceived; view_notebook.SwitchPage += HandleViewNotebookSwitchPage; group_selector.Adaptor.GlassSet += HandleAdaptorGlassSet; group_selector.Adaptor.Changed += HandleAdaptorChanged; LoadPreference (Preferences.GROUP_ADAPTOR_ORDER_ASC); LoadPreference (Preferences.FILMSTRIP_ORIENTATION); Selection = new MainSelection (this); Selection.Changed += HandleSelectionChanged; Selection.ItemsChanged += HandleSelectionItemsChanged; Selection.Changed += Sidebar.HandleSelectionChanged; Selection.ItemsChanged += Sidebar.HandleSelectionItemsChanged; Mono.Addins.AddinManager.ExtensionChanged += PopulateExtendableMenus; PopulateExtendableMenus (null, null); UpdateMenus (); main_window.ShowAll (); tagbar.Hide (); find_bar.Hide (); UpdateFindByTagMenu (); LoadPreference (Preferences.SHOW_TOOLBAR); LoadPreference (Preferences.SHOW_SIDEBAR); LoadPreference (Preferences.SHOW_TIMELINE); LoadPreference (Preferences.SHOW_FILMSTRIP); LoadPreference (Preferences.GNOME_MAILTO_ENABLED); Preferences.SettingChanged += OnPreferencesChanged; main_window.DeleteEvent += HandleDeleteEvent; query_widget.HandleChanged (query); query_widget.Close (); // When the icon_view is loaded, set it's initial scroll position icon_view.SizeAllocated += HandleIconViewReady; export.Activated += HandleExportActivated; UpdateToolbar (); (uimanager.GetWidget("/ui/menubar1/file1/close1") as MenuItem).Hide (); Banshee.Kernel.Scheduler.Resume (); }
public FullScreenView(IBrowsableCollection collection, Gtk.Window parent) : base("Full Screen Mode") { //going fullscreen on the same screen the parent window Gdk.Screen screen = Screen; int monitor = screen.GetMonitorAtWindow (parent.GdkWindow); Gdk.Rectangle bounds = screen.GetMonitorGeometry (monitor); Move (bounds.X, bounds.Y); string style = "style \"test\" {\n" + "GtkToolbar::shadow_type = GTK_SHADOW_NONE\n" + "}\n" + "class \"GtkToolbar\" style \"test\""; Gtk.Rc.ParseString (style); Name = "FullscreenContainer"; try { //scroll = new Gtk.ScrolledWindow (null, null); actions = new ActionGroup ("joe"); actions.Add (new ActionEntry [] { new ActionEntry (HideToolbar, Stock.Close, Catalog.GetString ("Hide"), null, Catalog.GetString ("Hide toolbar"), HideToolbarAction)}); actions.Add (new ToggleActionEntry [] { new ToggleActionEntry (Info, Stock.Info, Catalog.GetString ("Info"), null, Catalog.GetString ("Image information"), InfoAction, false)}); Gtk.Action exit_full_screen = new Gtk.Action (ExitFullScreen, Catalog.GetString ("Exit fullscreen"), null, null); exit_full_screen.IconName = "view-restore"; exit_full_screen.Activated += ExitAction; actions.Add (exit_full_screen); Gtk.Action slide_show = new Gtk.Action (SlideShow, Catalog.GetString ("Slideshow"), Catalog.GetString ("Start slideshow"), null); slide_show.IconName = "media-playback-start"; slide_show.Activated += SlideShowAction; actions.Add (slide_show); new WindowOpacityFader (this, 1.0, 600); notebook = new Notebook (); notebook.ShowBorder = false; notebook.ShowTabs = false; notebook.Show (); scroll = new ScrolledView (); scroll.ScrolledWindow.SetPolicy (PolicyType.Never, PolicyType.Never); view = new PhotoImageView (collection); // FIXME this should be handled by the new style setting code view.ModifyBg (Gtk.StateType.Normal, this.Style.Black); this.Add (notebook); view.Show (); view.MotionNotifyEvent += HandleViewMotion; view.PointerMode = PointerMode.Scroll; scroll.ScrolledWindow.Add (view); Toolbar tbar = new Toolbar (); tbar.ToolbarStyle = Gtk.ToolbarStyle.BothHoriz; tbar.ShowArrow = false; tbar.BorderWidth = 15; ToolItem t_item = (actions [ExitFullScreen]).CreateToolItem () as ToolItem; t_item.IsImportant = true; tbar.Insert (t_item, -1); Gtk.Action action = new PreviousPictureAction (view.Item); actions.Add (action); tbar.Insert (action.CreateToolItem () as ToolItem, -1); play_pause_button = (actions [SlideShow]).CreateToolItem () as ToolButton; tbar.Insert (play_pause_button, -1); action = new NextPictureAction (view.Item); actions.Add (action); tbar.Insert (action.CreateToolItem () as ToolItem, -1); t_item = new ToolItem (); t_item.Child = new Label (Catalog.GetString ("Slide transition:")); tbar.Insert (t_item, -1); display = new SlideShow (view.Item); display.AddEvents ((int) (Gdk.EventMask.PointerMotionMask)); display.ModifyBg (Gtk.StateType.Normal, this.Style.Black); display.MotionNotifyEvent += HandleViewMotion; display.Show (); t_item = new ToolItem (); ComboBox combo = ComboBox.NewText (); foreach (var transition in display.Transitions) combo.AppendText (transition.Name); combo.Active = 0; combo.Changed += HandleTransitionChanged; t_item.Child = combo; tbar.Insert (t_item, -1); action = new RotateLeftAction (view.Item); actions.Add (action); tbar.Insert (action.CreateToolItem () as ToolItem, -1); action = new RotateRightAction (view.Item); actions.Add (action); tbar.Insert (action.CreateToolItem () as ToolItem, -1); info_button = (ToggleToolButton) ((actions [Info]).CreateToolItem () as ToolItem); tbar.Insert (info_button, -1); tbar.Insert ((actions [HideToolbar]).CreateToolItem () as ToolItem, -1); notebook.AppendPage (scroll, null); notebook.AppendPage (display, null); tbar.ShowAll (); scroll.Show (); this.Decorated = false; this.Fullscreen (); this.ButtonPressEvent += HandleButtonPressEvent; view.Item.Changed += HandleItemChanged; view.GrabFocus (); hide_cursor_delay = new DelayedOperation (3000, new GLib.IdleHandler (HideCursor)); hide_cursor_delay.Start (); controls = new ControlOverlay (this); controls.Add (tbar); controls.Dismiss (); notebook.CurrentPage = 0; } catch (System.Exception e) { Log.Exception (e); } }
static void GetFeed(string ticket) { nv = new NameValueCollection (); nv.Add ("ticket", ticket); XmlNodeList nl = Request ( "http://live.nicovideo.jp/api/getalertstatus", @"//communities|//addr|//port|//thread", nv); if (nl.Count == 0) { Console.WriteLine ("チケットの値が不正です"); LoginRequest (); return; } Server sv = new Server (); Notebook nb = new Notebook (); nb.AppendPage(sv.Page_all (), new MultiTab("最新の放送",nb)); nb.AppendPage(sv.Page_mylist (), new MultiTab("お気に入り",nb)); nb.AppendPage(Page_tab ("common"), new MultiTab("タブ(一般)",nb)); nb.AppendPage(Page_tab ("live"), new MultiTab("タブ(ゲーム)",nb)); nb.AppendPage(Page_tab ("face"), new MultiTab("タブ(顔出し)",nb)); nb.AppendPage(Page_tab ("totu"), new MultiTab("タブ(凸待ち)",nb)); nb.AppendPage(Page_tab ("req"), new MultiTab("タブ(動画紹介)",nb)); nb.AppendPage(Page_tab ("try"), new MultiTab("タブ(やってみた)",nb)); nb.AppendPage(Page_tab ("r18"), new MultiTab("タブ(R―18)",nb)); //nb.SwitchPage += (sender, e) => PageChangedEvent(sender, e); Gtk.Window window = new Gtk.Window ("ニコ生フィーダー v1.0"); window.DeleteEvent += new DeleteEventHandler (OnQuit); window.SetSizeRequest (300, 550); window.KeepAbove = true; Toolbar bar = new Toolbar (); ToggleToolButton sendBackBtn = new ToggleToolButton (); sendBackBtn.Toggled += (sender, e) => SendBack(sender, e, ref window); sendBackBtn.TooltipText = "最前面での固定を解除"; ToggleToolButton logoutBtn = new ToggleToolButton (); logoutBtn.TooltipText = "ログアウト"; logoutBtn.Clicked += (sender, e) => Logout(sender, e, ref window); bar.HeightRequest = 25; Gtk.Image img = new Gtk.Image(); img.Pixbuf = new Gdk.Pixbuf("go_back.png",12,12); sendBackBtn.IconWidget = img; Gtk.Image img2 = new Gtk.Image(); img2.Pixbuf = new Gdk.Pixbuf("logout.png",16,16); logoutBtn.IconWidget = img2; logoutBtn.HeightRequest = 25; sendBackBtn.HeightRequest = 25; bar.Add (logoutBtn); bar.Add (sendBackBtn); bar.ShowAll (); VBox vbox = new VBox(false, 0); vbox.PackStart (bar, false, true, 0); vbox.PackStart (nb, true, true, 0); window.Add (vbox); window.ShowAll (); window.Focus = nb; MainClass.communities = nl [0].InnerText; sv.receiveFromServer (nl [1].InnerText, nl [2].InnerText, nl [3].InnerText); }
void FillToolbar() { Toolbar toolbar = new Toolbar (); toolbar.Orientation = Orientation.Vertical; toolbar.ToolbarStyle = ToolbarStyle.Icons; editimage = new Gtk.Image (Helpers.Misc.LoadIcon ("longomatch-dash-edit_active", 22)); editbutton = new ToggleToolButton (); editbutton.IconWidget = editimage; editbutton.Toggled += HandleEditToggled; editbutton.TooltipText = Catalog.GetString ("Edit dashboard"); toolbar.Add (editbutton); toolbar.Add (new SeparatorToolItem ()); linksimage = new Gtk.Image (Helpers.Misc.LoadIcon ("longomatch-link-disabled", 22)); linksbutton = new ToggleToolButton (); linksbutton.IconWidget = linksimage; linksbutton.Toggled += HandleLinksToggled; linksbutton.TooltipText = Catalog.GetString ("Edit action links"); toolbar.Add (linksbutton); toolbar.Add (new SeparatorToolItem ()); popupbutton = new ToggleToolButton (); popupbutton.IconWidget = new Gtk.Image (Helpers.Misc.LoadIcon ("longomatch-popup", 22)); popupbutton.Active = true; popupbutton.Toggled += HandlePopupToggled; popupbutton.TooltipText = Catalog.GetString ("Disable popup window"); toolbar.Add (popupbutton); toolbar.Add (new SeparatorToolItem ()); fitbutton = new RadioToolButton ((GLib.SList)null); fitbutton.IconWidget = new Gtk.Image (Helpers.Misc.LoadIcon ("longomatch-dash-fit", 22)); fitbutton.Toggled += HandleFitModeToggled; fitbutton.TooltipText = Catalog.GetString ("Fit dashboard"); toolbar.Add (fitbutton); fillbutton = new RadioToolButton (fitbutton); fillbutton.IconWidget = new Gtk.Image (Helpers.Misc.LoadIcon ("longomatch-dash-fill", 22)); fillbutton.Toggled += HandleFitModeToggled; fillbutton.TooltipText = Catalog.GetString ("Fill dashboard"); toolbar.Add (fillbutton); d11button = new RadioToolButton (fitbutton); d11button.IconWidget = new Gtk.Image (Helpers.Misc.LoadIcon ("longomatch-dash-11", 22)); d11button.Toggled += HandleFitModeToggled; d11button.TooltipText = Catalog.GetString ("1:1 dashboard"); toolbar.Add (d11button); toolbar.ShowAll (); hbox2.PackEnd (toolbar, false, false, 0); editbutton.Active = true; linksbutton.Active = false; }
public SearchResultWidget () { Build (); store = new ListStore (typeof (SearchResult), typeof (bool) // didRead ); treeviewSearchResults.Model = store; treeviewSearchResults.Selection.Mode = Gtk.SelectionMode.Multiple; treeviewSearchResults.HeadersClickable = true; treeviewSearchResults.PopupMenu += OnPopupMenu; treeviewSearchResults.ButtonPressEvent += HandleButtonPressEvent; treeviewSearchResults.RulesHint = true; var fileNameColumn = new TreeViewColumn { Resizable = false, SortColumnId = 0, Title = GettextCatalog.GetString("File") }; fileNameColumn.FixedWidth = 200; var fileNamePixbufRenderer = new CellRendererPixbuf (); fileNameColumn.PackStart (fileNamePixbufRenderer, false); fileNameColumn.SetCellDataFunc (fileNamePixbufRenderer, FileIconDataFunc); var fileNameRenderer = new CellRendererText (); fileNameColumn.PackStart (fileNameRenderer, true); fileNameColumn.SetCellDataFunc (fileNameRenderer, FileNameDataFunc); treeviewSearchResults.AppendColumn (fileNameColumn); // TreeViewColumn lineColumn = treeviewSearchResults.AppendColumn (GettextCatalog.GetString ("Line"), new CellRendererText (), ResultLineDataFunc); // lineColumn.SortColumnId = 1; // lineColumn.FixedWidth = 50; // TreeViewColumn textColumn = treeviewSearchResults.AppendColumn (GettextCatalog.GetString ("Text"), new CellRendererText (), ResultTextDataFunc); textColumn.SortColumnId = 2; textColumn.Resizable = false; textColumn.FixedWidth = 300; TreeViewColumn pathColumn = treeviewSearchResults.AppendColumn (GettextCatalog.GetString ("Path"), new CellRendererText (), ResultPathDataFunc); pathColumn.SortColumnId = 3; pathColumn.Resizable = false; pathColumn.FixedWidth = 500; store.SetSortFunc (0, CompareFileNames); // store.SetSortFunc (1, CompareLineNumbers); store.SetSortFunc (3, CompareFilePaths); treeviewSearchResults.RowActivated += TreeviewSearchResultsRowActivated; buttonStop = new ToolButton (Stock.Stop) { Sensitive = false }; buttonStop.Clicked += ButtonStopClicked; buttonStop.TooltipText = GettextCatalog.GetString ("Stop"); toolbar.Insert (buttonStop, -1); var buttonClear = new ToolButton (Gtk.Stock.Clear); buttonClear.Clicked += ButtonClearClicked; buttonClear.TooltipText = GettextCatalog.GetString ("Clear results"); toolbar.Insert (buttonClear, -1); var buttonOutput = new ToggleToolButton (Gui.Stock.OutputIcon); buttonOutput.Clicked += ButtonOutputClicked; buttonOutput.TooltipText = GettextCatalog.GetString ("Show output"); toolbar.Insert (buttonOutput, -1); buttonPin = new ToggleToolButton (Gui.Stock.PinUp); buttonPin.Clicked += ButtonPinClicked; buttonPin.TooltipText = GettextCatalog.GetString ("Pin results pad"); toolbar.Insert (buttonPin, -1); store.SetSortColumnId (3, SortType.Ascending); ShowAll (); scrolledwindowLogView.Hide (); }
public ImageToolBarControl(ImageCanvas ic) { this.ic = ic; btnShowHideBarier = new ToggleToolButton("barier-show.png");//RadioToolButton(group1);//,"barier-show.png"); btnShowHideBarier.Label = MainClass.Languages.Translate("show_barier_layer"); btnShowHideBarier.Name = "btnShowHideBarier"; //btnShowHideBarier.Relief = ReliefStyle.None; btnShowHideBarier.CanFocus = false; btnShowHideBarier.BorderWidth = 1; //btnShowHideBarier.WidthRequest = 75; btnShowHideBarier.TooltipText = MainClass.Languages.Translate("show_barier_layer_tt"); btnShowHideBarier.Events = Gdk.EventMask.AllEventsMask;// | EventMask.ButtonReleaseMask | EventMask.PointerMotionMask btnShowHideBarier.Toggled+= delegate(object sender, EventArgs e) { this.ic.ShowBarierLayer = btnShowHideBarier.Active; SetSensitive(btnShowHideBarier.Active); //Console.WriteLine("btnShowHideBarier.Toggled"); }; btnEditBarierPoint = new ToggleToolButton("barier-add.png");//new RadioToolButton(group2,"barier-add.png"); btnEditBarierPoint.Name = "btnEditBarierPoint"; btnEditBarierPoint.Label = MainClass.Languages.Translate("edit_barier_point"); //btnEditBarierPoint.Relief = ReliefStyle.None; btnEditBarierPoint.CanFocus = false; btnEditBarierPoint.BorderWidth = 1; btnEditBarierPoint.TooltipText = MainClass.Languages.Translate("edit_barier_point_tt"); btnEditBarierPoint.Toggled+= delegate(object sender, EventArgs e) { if(btnEditBarierPoint.Active){ btnDeleteBarierPoint.Active = false; //btnMovieBarierPoint.Active = false; } }; btnDeleteBarierPoint = new ToggleToolButton("barier-delete.png");//new RadioToolButton(group2,"barier-delete.png"); btnDeleteBarierPoint.Name = "btnDeleteBarierPoint"; btnDeleteBarierPoint.Label = MainClass.Languages.Translate("delete_barier_point"); //btnDeleteBarierPoint.Relief = ReliefStyle.None; btnDeleteBarierPoint.CanFocus = false; btnDeleteBarierPoint.BorderWidth = 1; btnDeleteBarierPoint.TooltipText = MainClass.Languages.Translate("delete_barier_point_tt"); btnDeleteBarierPoint.Toggled+= delegate(object sender, EventArgs e) { if(btnDeleteBarierPoint.Active){ btnEditBarierPoint.Active = false; //btnAddBarierPoint.Active = false; //btnMovieBarierPoint.Active = false; } }; btnDeleteBarier = new ToolButton("barier-delete-all.png"); btnDeleteBarier.Name = "btnDeleteBarier"; btnDeleteBarier.Label =MainClass.Languages.Translate("delete_barier"); btnDeleteBarier.CanFocus = false; btnDeleteBarier.BorderWidth = 1; btnDeleteBarier.TooltipText = MainClass.Languages.Translate("delete_barier_tt"); btnDeleteBarier.Clicked += delegate(object sender, EventArgs e) { MessageDialogs md = new MessageDialogs(MessageDialogs.DialogButtonType.YesNo, "", MainClass.Languages.Translate("delete_barier_question"), Gtk.MessageType.Question); int result = md.ShowDialog(); if (result != (int)Gtk.ResponseType.Yes){ return; } if(DeleteBarierLayerEvent!= null) DeleteBarierLayerEvent(null,null); }; SetSensitive(false); this.Insert (btnShowHideBarier, 0); this.Insert (btnEditBarierPoint, 1); this.Insert (btnDeleteBarierPoint, 2); this.Insert (btnDeleteBarier, 3); Gtk.ToolButton btnZoomIn = new Gtk.ToolButton("zoom-in.png"); btnZoomIn.Label = MainClass.Languages.Translate("zoom_in"); btnZoomIn.TooltipText = MainClass.Languages.Translate("zoom_in"); //btnZoomIn.Relief = Gtk.ReliefStyle.None; btnZoomIn.CanFocus = false; btnZoomIn.Clicked+= delegate { ZoomIn(); }; Gtk.ToolButton btnZoomOriginal = new Gtk.ToolButton("zoom-original.png"); btnZoomOriginal.Label = MainClass.Languages.Translate("zoom_original"); btnZoomOriginal.TooltipText = MainClass.Languages.Translate("zoom_original"); //btnZoomOriginal.Relief = Gtk.ReliefStyle.None; btnZoomOriginal.CanFocus = false; btnZoomOriginal.Clicked+= delegate { cbeZoom.Active = 11; }; //btnZoomOriginal.WidthRequest = btnZoomOriginal.HeightRequest = 19; Gtk.ToolButton btnZoomOut = new Gtk.ToolButton("zoom-out.png"); btnZoomOut.TooltipText = MainClass.Languages.Translate("zoom_out"); btnZoomOut.Label = MainClass.Languages.Translate("zoom_out"); //btnZoomOut.Relief = Gtk.ReliefStyle.None; btnZoomOut.CanFocus = false; btnZoomOut.Clicked+= delegate { ZoomOut(); }; string[] zoomCollection = new string[] { "3600%", "2400%", "1600%", "1200%", "800%", "700%", "600%", "500%", "400%", "300%", "200%", "100%", "66%", "50%", "33%", "25%", "16%", "12%", "8%", "5%" }; cbeZoom = new ComboBoxEntry(zoomCollection); cbeZoom.Active = 11; cbeZoom.WidthRequest = 70; cbeZoom.Changed+= delegate(object sender, EventArgs e) { UpdateScale(); }; cbeZoom.Entry.FocusOutEvent+= delegate(object o, FocusOutEventArgs args) { //Console.WriteLine("FocusOutEvent"); UpdateScale(); }; cbeZoom.Entry.FocusInEvent+= delegate(object o, FocusInEventArgs args) { }; cbeZoom.Entry.Changed+= delegate(object sender, EventArgs e) { //UpdateScale(); }; ToolItem tic = new ToolItem(); tic.Add(cbeZoom); this.Insert(new SeparatorToolItem(),4); this.Insert(btnZoomIn,5); this.Insert(btnZoomOut,6); this.Insert(tic,7); this.Insert(btnZoomOriginal,8); }
public TestResultsPad() { title = "Test results"; testService.TestSuiteChanged += new EventHandler (OnTestSuiteChanged); panel = new VBox (); Toolbar toolbar = new Toolbar (); toolbar.IconSize = IconSize.SmallToolbar; panel.PackStart (toolbar, false, false, 0); buttonSuccess = new ToggleToolButton (); buttonSuccess.Label = "Successful Tests"; buttonSuccess.Active = false; buttonSuccess.IconWidget = new Gtk.Image (CircleImage.Success); buttonSuccess.IsImportant = true; buttonSuccess.Toggled += new EventHandler (OnShowSuccessfulToggled); buttonSuccess.SetTooltip (tips, "Show Successful Tests", "Show Successful Tests"); toolbar.Insert (buttonSuccess, -1); buttonFailures = new ToggleToolButton (); buttonFailures.Label = "Failed Tests"; buttonFailures.Active = true; buttonFailures.IconWidget = new Gtk.Image (CircleImage.Failure); buttonFailures.IsImportant = true; buttonFailures.Toggled += new EventHandler (OnShowFailuresToggled); buttonFailures.SetTooltip (tips, "Show Failed Tests", "Show Failed Tests"); toolbar.Insert (buttonFailures, -1); buttonIgnored = new ToggleToolButton (); buttonIgnored.Label = "Ignored Tests"; buttonIgnored.Active = true; buttonIgnored.IconWidget = new Gtk.Image (CircleImage.NotRun); buttonIgnored.Toggled += new EventHandler (OnShowIgnoredToggled); buttonIgnored.IsImportant = true; buttonIgnored.SetTooltip (tips, "Show Ignored Tests", "Show Ignored Tests"); toolbar.Insert (buttonIgnored, -1); buttonOutput = new ToggleToolButton (); buttonOutput.Label = "Output"; buttonOutput.Active = false; buttonOutput.IconWidget = Runtime.Gui.Resources.GetImage (MonoDevelop.Gui.Stock.OutputIcon, IconSize.SmallToolbar); buttonOutput.Toggled += new EventHandler (OnShowOutputToggled); buttonOutput.IsImportant = true; buttonOutput.SetTooltip (tips, "Show Output", "Show Output"); toolbar.Insert (buttonOutput, -1); toolbar.Insert (new SeparatorToolItem (), -1); buttonStop = new ToolButton ("gtk-stop"); toolbar.Insert (buttonStop, -1); toolbar.ToolbarStyle = ToolbarStyle.BothHoriz; toolbar.ShowArrow = false; // Results notebook book = new HPaned (); panel.PackStart (book, true, true, 0); // Failures tree failuresTreeView = new TreeView (); failuresTreeView.HeadersVisible = false; failuresStore = new TreeStore (typeof(Pixbuf), typeof (string), typeof(object)); CellRendererPixbuf pr = new CellRendererPixbuf (); CellRendererText tr = new CellRendererText (); TreeViewColumn col = new TreeViewColumn (); col.PackStart (pr, false); col.AddAttribute (pr, "pixbuf", 0); col.PackStart (tr, false); col.AddAttribute (tr, "markup", 1); failuresTreeView.AppendColumn (col); failuresTreeView.Model = failuresStore; Gtk.ScrolledWindow sw = new Gtk.ScrolledWindow (); sw.Add(failuresTreeView); Frame frame = new Frame (); frame.Add (sw); book.Pack1 (frame, true, true); outputView = new TextView(); outputView.Editable = false; sw = new Gtk.ScrolledWindow (); sw.Add(outputView); frame = new Frame (); frame.Add (sw); book.Pack2 (frame, true, true); outputViewScrolled = frame; // Run panel HBox runPanel = new HBox (); runPanel.BorderWidth = 5; infoSep = new VSeparator (); resultLabel.UseMarkup = true; runPanel.PackStart (resultLabel, false, false, 0); runPanel.PackStart (progressBar, false, false, 0); runPanel.PackStart (infoCurrent, true, true, 10); labels = new HBox (false, 10); infoFailed.UseMarkup = true; infoIgnored.UseMarkup = true; labels.PackStart (infoFailed, true, false, 0); labels.PackStart (infoIgnored, true, false, 0); runPanel.PackEnd (labels, false, false, 0); runPanel.PackEnd (infoSep, false, false, 10); panel.PackStart (runPanel, false, false, 0); progressBar.HeightRequest = infoFailed.SizeRequest().Height; buttonStop.Clicked += new EventHandler (OnStopClicked); failuresTreeView.ButtonReleaseEvent += new Gtk.ButtonReleaseEventHandler (OnPopupMenu); Control.ShowAll (); outputViewScrolled.Hide (); }
public SearchResultWidget () { var vbox = new VBox (); var toolbar = new Toolbar () { Orientation = Orientation.Vertical, IconSize = IconSize.Menu, ToolbarStyle = ToolbarStyle.Icons, }; this.PackStart (vbox, true, true, 0); this.PackStart (toolbar, false, false, 0); labelStatus = new Label () { Xalign = 0, Justify = Justification.Left, }; var hpaned = new HPaned (); vbox.PackStart (hpaned, true, true, 0); vbox.PackStart (labelStatus, false, false, 0); var resultsScroll = new CompactScrolledWindow (); hpaned.Pack1 (resultsScroll, true, true); scrolledwindowLogView = new CompactScrolledWindow (); hpaned.Pack2 (scrolledwindowLogView, true, true); textviewLog = new TextView () { Editable = false, }; scrolledwindowLogView.Add (textviewLog); store = new ListStore (typeof (SearchResult), typeof (bool) // didRead ); treeviewSearchResults = new PadTreeView () { Model = store, HeadersClickable = true, RulesHint = true, }; treeviewSearchResults.Selection.Mode = Gtk.SelectionMode.Multiple; resultsScroll.Add (treeviewSearchResults); var projectColumn = new TreeViewColumn { Resizable = true, SortColumnId = 1, Title = GettextCatalog.GetString ("Project"), Sizing = TreeViewColumnSizing.Fixed, FixedWidth = 100 }; var projectPixbufRenderer = new CellRendererImage (); projectColumn.PackStart (projectPixbufRenderer, false); projectColumn.SetCellDataFunc (projectPixbufRenderer, ResultProjectIconDataFunc); var renderer = treeviewSearchResults.TextRenderer; renderer.Ellipsize = Pango.EllipsizeMode.End; projectColumn.PackStart (renderer, true); projectColumn.SetCellDataFunc (renderer, ResultProjectDataFunc); treeviewSearchResults.AppendColumn (projectColumn); var fileNameColumn = new TreeViewColumn { Resizable = true, SortColumnId = 2, Title = GettextCatalog.GetString ("File"), Sizing = TreeViewColumnSizing.Fixed, FixedWidth = 200 }; var fileNamePixbufRenderer = new CellRendererImage (); fileNameColumn.PackStart (fileNamePixbufRenderer, false); fileNameColumn.SetCellDataFunc (fileNamePixbufRenderer, FileIconDataFunc); fileNameColumn.PackStart (renderer, true); fileNameColumn.SetCellDataFunc (renderer, FileNameDataFunc); treeviewSearchResults.AppendColumn (fileNameColumn); TreeViewColumn textColumn = treeviewSearchResults.AppendColumn (GettextCatalog.GetString ("Text"), renderer, ResultTextDataFunc); textColumn.Resizable = true; textColumn.Sizing = TreeViewColumnSizing.Fixed; textColumn.FixedWidth = 300; pathColumn = treeviewSearchResults.AppendColumn (GettextCatalog.GetString ("Path"), renderer, ResultPathDataFunc); pathColumn.SortColumnId = 3; pathColumn.Resizable = true; pathColumn.Sizing = TreeViewColumnSizing.Fixed; pathColumn.FixedWidth = 500; store.DefaultSortFunc = DefaultSortFunc; store.SetSortFunc (1, CompareProjectFileNames); store.SetSortFunc (2, CompareFileNames); store.SetSortFunc (3, CompareFilePaths); treeviewSearchResults.RowActivated += TreeviewSearchResultsRowActivated; buttonStop = new ToolButton (new ImageView (Gui.Stock.Stop, Gtk.IconSize.Menu), null) { Sensitive = false }; buttonStop.Clicked += ButtonStopClicked; buttonStop.TooltipText = GettextCatalog.GetString ("Stop"); toolbar.Insert (buttonStop, -1); var buttonClear = new ToolButton (new ImageView (Gui.Stock.Clear, Gtk.IconSize.Menu), null); buttonClear.Clicked += ButtonClearClicked; buttonClear.TooltipText = GettextCatalog.GetString ("Clear results"); toolbar.Insert (buttonClear, -1); var buttonOutput = new ToggleToolButton (); buttonOutput.IconWidget = new ImageView (Gui.Stock.OutputIcon, Gtk.IconSize.Menu); buttonOutput.Clicked += ButtonOutputClicked; buttonOutput.TooltipText = GettextCatalog.GetString ("Show output"); toolbar.Insert (buttonOutput, -1); buttonPin = new ToggleToolButton (); buttonPin.IconWidget = new ImageView (Gui.Stock.PinUp, Gtk.IconSize.Menu); buttonPin.Clicked += ButtonPinClicked; buttonPin.TooltipText = GettextCatalog.GetString ("Pin results pad"); toolbar.Insert (buttonPin, -1); // store.SetSortColumnId (3, SortType.Ascending); ShowAll (); scrolledwindowLogView.Hide (); treeviewSearchResults.FixedHeightMode = true; UpdateStyles (); IdeApp.Preferences.ColorScheme.Changed += UpdateStyles; }
public Toolbox(ServiceContainer parentServices) { this.parentServices = parentServices; //we need this service, so create it if not present toolboxService = parentServices.GetService (typeof (IToolboxService)) as ToolboxService; if (toolboxService == null) { toolboxService = new ToolboxService (); parentServices.AddService (typeof (IToolboxService), toolboxService); } #region Toolbar toolbar = new Toolbar (); toolbar.ToolbarStyle = ToolbarStyle.Icons; toolbar.IconSize = IconSize.SmallToolbar; base.PackStart (toolbar, false, false, 0); filterToggleButton = new ToggleToolButton (); filterToggleButton.IconWidget = new Image (Stock.MissingImage, IconSize.SmallToolbar); filterToggleButton.Toggled += new EventHandler (toggleFiltering); toolbar.Insert (filterToggleButton, 0); catToggleButton = new ToggleToolButton (); catToggleButton.IconWidget = new Image (Stock.MissingImage, IconSize.SmallToolbar); catToggleButton.Toggled += new EventHandler (toggleCategorisation); toolbar.Insert (catToggleButton, 1); SeparatorToolItem sep = new SeparatorToolItem(); toolbar.Insert (sep, 2); filterEntry = new Entry(); filterEntry.WidthRequest = 150; filterEntry.Changed += new EventHandler (filterTextChanged); #endregion scrolledWindow = new ScrolledWindow (); base.PackEnd (scrolledWindow, true, true, 0); //Initialise model store = new ToolboxStore (); //initialise view nodeView = new NodeView (store); nodeView.Selection.Mode = SelectionMode.Single; nodeView.HeadersVisible = false; //cell renderers CellRendererPixbuf pixbufRenderer = new CellRendererPixbuf (); CellRendererText textRenderer = new CellRendererText (); textRenderer.Ellipsize = Pango.EllipsizeMode.End; //Main column with text, icons TreeViewColumn col = new TreeViewColumn (); col.PackStart (pixbufRenderer, false); col.SetAttributes (pixbufRenderer, "pixbuf", ToolboxStore.Columns.Icon, "visible", ToolboxStore.Columns.IconVisible, "cell-background-gdk", ToolboxStore.Columns.BackgroundColour); col.PackEnd (textRenderer, true); col.SetAttributes (textRenderer, "text", ToolboxStore.Columns.Label, "weight", ToolboxStore.Columns.FontWeight, "cell-background-gdk", ToolboxStore.Columns.BackgroundColour); nodeView.AppendColumn (col); //Initialise self scrolledWindow.VscrollbarPolicy = PolicyType.Automatic; scrolledWindow.HscrollbarPolicy = PolicyType.Never; scrolledWindow.WidthRequest = 150; scrolledWindow.AddWithViewport (nodeView); //selection events nodeView.NodeSelection.Changed += OnSelectionChanged; nodeView.RowActivated += OnRowActivated; //update view when toolbox service updated toolboxService.ToolboxChanged += new EventHandler (tbsChanged); Refresh (); //track expanded state of nodes nodeView.RowCollapsed += new RowCollapsedHandler (whenRowCollapsed); nodeView.RowExpanded += new RowExpandedHandler (whenRowExpanded); //set initial state filterToggleButton.Active = false; catToggleButton.Active = true; }
void AppendCommand (CommandDescriptor cmd, ObjectWrapper widget) { Gtk.ToolButton button; if (cmd.IsToggleCommand (widget.Wrapped)) { button = new Gtk.ToggleToolButton (); ((Gtk.ToggleToolButton)button).Active = cmd.IsToogled (widget.Wrapped); toggles.Add (cmd); editors[cmd.Name] = button; } else { button = new Gtk.ToolButton (null, null); } Gtk.Image img = cmd.GetImage (); if (img != null) { button.IconWidget = img; button.Label = cmd.Label; if (cmd.Label != null && cmd.Label.Length > 0) button.TooltipText = cmd.Label; } else { button.Label = cmd.Label; button.IsImportant = true; } button.Clicked += delegate (object o, EventArgs args) { if (!updating) cmd.Run (widget.Wrapped); }; button.ShowAll (); Insert (button, -1); if (cmd.HasDependencies) { editors[cmd.Name] = button; sensitives[cmd] = cmd; } if (cmd.HasVisibility) { editors[cmd.Name] = button; invisibles[cmd] = cmd; } wrappers [cmd] = widget; }
public SearchResultPad() { // Toolbar Toolbar toolbar = new Toolbar (); toolbar.IconSize = IconSize.SmallToolbar; toolbar.Orientation = Orientation.Vertical; toolbar.ToolbarStyle = ToolbarStyle.Icons; buttonStop = new ToolButton ("gtk-stop"); buttonStop.Clicked += new EventHandler (OnButtonStopClick); buttonStop.SetTooltip (tips, "Stop", "Stop"); toolbar.Insert (buttonStop, -1); ToolButton buttonClear = new ToolButton ("gtk-clear"); buttonClear.Clicked += new EventHandler (OnButtonClearClick); buttonClear.SetTooltip (tips, "Clear results", "Clear results"); toolbar.Insert (buttonClear, -1); buttonOutput = new ToggleToolButton (MonoDevelop.Gui.Stock.OutputIcon); buttonOutput.Clicked += new EventHandler (OnButtonOutputClick); buttonOutput.SetTooltip (tips, "Show output", "Show output"); toolbar.Insert (buttonOutput, -1); // Results list store = new Gtk.ListStore ( typeof (Gdk.Pixbuf), // image typeof (int), // line typeof (int), // column typeof (string), // desc typeof (string), // file typeof (string), // path typeof (string), // full path typeof (bool), // read? typeof (int), // read? -- use Pango weight typeof (bool)); // is file view = new Gtk.TreeView (store); view.RulesHint = true; AddColumns (); sw = new Gtk.ScrolledWindow (); sw.ShadowType = ShadowType.In; sw.Add (view); // Log view logBuffer = new Gtk.TextBuffer (new Gtk.TextTagTable ()); logTextView = new Gtk.TextView (logBuffer); logTextView.Editable = false; logScroller = new Gtk.ScrolledWindow (); logScroller.ShadowType = ShadowType.In; logScroller.Add (logTextView); // HPaned Gtk.HPaned paned = new Gtk.HPaned (); paned.Pack1 (sw, true, true); paned.Pack2 (logScroller, true, true); // HBox status = new Label (); status.Xalign = 0.0f; VBox vbox = new VBox (); vbox.PackStart (paned, true, true, 0); vbox.PackStart (status, false, false, 3); HBox hbox = new HBox (); hbox.PackStart (vbox, true, true, 0); hbox.PackStart (toolbar, false, false, 0); control = hbox; Control.ShowAll (); logScroller.Hide (); view.RowActivated += new RowActivatedHandler (OnRowActivated); }
private void BuildAlphaBlending(Toolbar tb) { Image blending_on_icon = new Image (PintaCore.Resources.GetIcon ("Toolbar.BlendingEnabledIcon.png")); blending_on_icon.Show (); Image blending_off_icon = new Image (PintaCore.Resources.GetIcon ("Toolbar.BlendingOverwriteIcon.png")); blending_off_icon.Show (); alphablending_btn = new ToggleToolButton (); alphablending_btn.IconWidget = blending_off_icon; alphablending_btn.Show (); alphablending_btn.Label = Catalog.GetString ("Antialiasing"); alphablending_btn.TooltipText = Catalog.GetString ("Normal blending / Overwrite blending"); alphablending_btn.Toggled += delegate { if (alphablending_btn.Active) alphablending_btn.IconWidget = blending_on_icon; else alphablending_btn.IconWidget = blending_off_icon; }; tb.AppendItem (alphablending_btn); }
protected virtual ToggleToolButton CreateToolButton() { Image i2 = new Image (PintaCore.Resources.GetIcon (Icon)); i2.Show (); ToggleToolButton tool_item = new ToggleToolButton (); tool_item.IconWidget = i2; tool_item.Show (); tool_item.Label = Name; tool_item.TooltipText = Name; return tool_item; }
private void BuildAntialiasingTool(Toolbar tb) { Image antialiasing_on_icon = new Image (PintaCore.Resources.GetIcon ("Toolbar.AntiAliasingEnabledIcon.png")); antialiasing_on_icon.Show (); Image antialiasing_off_icon = new Image (PintaCore.Resources.GetIcon ("Toolbar.AntiAliasingDisabledIcon.png")); antialiasing_off_icon.Show (); antialiasing_btn = new ToggleToolButton (); antialiasing_btn.IconWidget = antialiasing_off_icon; antialiasing_btn.Show (); antialiasing_btn.Label = Catalog.GetString ("Antialiasing"); antialiasing_btn.TooltipText = Catalog.GetString ("Antialiasing"); antialiasing_btn.Toggled += delegate { if (antialiasing_btn.Active) antialiasing_btn.IconWidget = antialiasing_on_icon; else antialiasing_btn.IconWidget = antialiasing_off_icon; }; tb.AppendItem (antialiasing_btn); }
ToggleToolButton AddButton (string label) { ToggleToolButton newButton = new ToggleToolButton (); isUpdating = true; try { newButton.Label = label; newButton.IsImportant = true; newButton.Clicked += new EventHandler (OnButtonToggled); newButton.ShowAll (); this.toolbarPages.Insert (newButton, -1); } finally { isUpdating = false; } return newButton; }
// // Constructor // public MainWindow (Db db) { foreach (ServiceNode service in AddinManager.GetExtensionNodes ("/FSpot/Services")) { try { service.Initialize (); service.Start (); } catch (Exception e) { Log.WarningFormat ("Something went wrong while starting the {0} extension.", service.Id); Log.DebugException (e); } } Database = db; GtkBeans.Builder builder = new GtkBeans.Builder ("main_window.ui"); builder.Autoconnect (this); //Set the global DefaultColormap. Allows transparency according //to the theme (work on murrine engine) Gdk.Colormap colormap = ((Widget)main_window).Screen.RgbaColormap; if (colormap == null) { Log.Debug ("Your screen doesn't support alpha channels!"); colormap = ((Widget)main_window).Screen.RgbColormap; } Gtk.Widget.DefaultColormap = colormap; LoadPreference (Preferences.MAIN_WINDOW_WIDTH); LoadPreference (Preferences.MAIN_WINDOW_X); LoadPreference (Preferences.MAIN_WINDOW_MAXIMIZED); main_window.ShowAll (); LoadPreference (Preferences.SIDEBAR_POSITION); LoadPreference (Preferences.METADATA_EMBED_IN_IMAGE); pagesetup_menu_item.Activated += HandlePageSetupActivated; toolbar = new Gtk.Toolbar (); toolbar_vbox.PackStart (toolbar); ToolButton import_button = GtkUtil.ToolButtonFromTheme ("gtk-add", Catalog.GetString ("Import Photos…"), true); import_button.Clicked += (o, args) => StartImport (null); import_button.TooltipText = Catalog.GetString ("Import new photos"); toolbar.Insert (import_button, -1); toolbar.Insert (new SeparatorToolItem (), -1); rl_button = GtkUtil.ToolButtonFromTheme ("object-rotate-left", Catalog.GetString ("Rotate Left"), false); rl_button.Clicked += HandleRotate270Command; toolbar.Insert (rl_button, -1); rr_button = GtkUtil.ToolButtonFromTheme ("object-rotate-right", Catalog.GetString ("Rotate Right"), false); rr_button.Clicked += HandleRotate90Command; toolbar.Insert (rr_button, -1); toolbar.Insert (new SeparatorToolItem (), -1); browse_button = new ToggleToolButton (); browse_button.Label = Catalog.GetString ("Browsing"); browse_button.IconName = "mode-browse"; browse_button.IsImportant = true; browse_button.Toggled += HandleToggleViewBrowse; browse_button.TooltipText = Catalog.GetString ("Browse your photo library"); toolbar.Insert (browse_button, -1); edit_button = new ToggleToolButton (); edit_button.Label = Catalog.GetString ("Editing"); edit_button.IconName = "mode-image-edit"; edit_button.IsImportant = true; edit_button.Toggled += HandleToggleViewPhoto; edit_button.TooltipText = Catalog.GetString ("Edit your photos"); toolbar.Insert (edit_button, -1); toolbar.Insert (new SeparatorToolItem (), -1); ToolButton fs_button = GtkUtil.ToolButtonFromTheme ("view-fullscreen", Catalog.GetString ("Fullscreen"), false); fs_button.Clicked += HandleViewFullscreen; fs_button.TooltipText = Catalog.GetString ("View photos fullscreen"); toolbar.Insert (fs_button, -1); ToolButton ss_button = GtkUtil.ToolButtonFromTheme ("media-playback-start", Catalog.GetString ("Slideshow"), false); ss_button.Clicked += HandleViewSlideShow; ss_button.TooltipText = Catalog.GetString ("View photos in a slideshow"); toolbar.Insert (ss_button, -1); SeparatorToolItem white_space = new SeparatorToolItem (); white_space.Draw = false; white_space.Expand = true; toolbar.Insert (white_space, -1); ToolItem label_item = new ToolItem (); count_label = new Label (String.Empty); label_item.Child = count_label; toolbar.Insert (label_item, -1); display_previous_button = new ToolButton (Stock.GoBack); toolbar.Insert (display_previous_button, -1); display_previous_button.TooltipText = Catalog.GetString ("Previous photo"); display_previous_button.Clicked += new EventHandler (HandleDisplayPreviousButtonClicked); display_next_button = new ToolButton (Stock.GoForward); toolbar.Insert (display_next_button, -1); display_next_button.TooltipText = Catalog.GetString ("Next photo"); display_next_button.Clicked += new EventHandler (HandleDisplayNextButtonClicked); Sidebar = new Sidebar (); ViewModeChanged += Sidebar.HandleMainWindowViewModeChanged; sidebar_vbox.Add (Sidebar); tag_selection_scrolled = new Gtk.ScrolledWindow (); tag_selection_scrolled.ShadowType = ShadowType.In; tag_selection_widget = new TagSelectionWidget (Database.Tags); tag_selection_scrolled.Add (tag_selection_widget); Sidebar.AppendPage (tag_selection_scrolled, Catalog.GetString ("Tags"), "tag"); AddinManager.AddExtensionNodeHandler ("/FSpot/Sidebar", OnSidebarExtensionChanged); Sidebar.Context = ViewContext.Library; Sidebar.CloseRequested += HideSidebar; Sidebar.Show (); InfoBox = new InfoBox (); ViewModeChanged += InfoBox.HandleMainWindowViewModeChanged; InfoBox.VersionChanged += delegate (InfoBox box, IPhotoVersion version) { UpdateForVersionChange (version); }; sidebar_vbox.PackEnd (InfoBox, false, false, 0); InfoBox.Context = ViewContext.Library; tag_selection_widget.Selection.Changed += HandleTagSelectionChanged; tag_selection_widget.KeyPressEvent += HandleTagSelectionKeyPress; tag_selection_widget.ButtonPressEvent += HandleTagSelectionButtonPressEvent; tag_selection_widget.PopupMenu += HandleTagSelectionPopupMenu; tag_selection_widget.RowActivated += HandleTagSelectionRowActivated; LoadPreference (Preferences.TAG_ICON_SIZE); try { query = new PhotoQuery (Database.Photos); } catch (System.Exception e) { //FIXME assume any exception here is due to a corrupt db and handle that. new RepairDbDialog (e, Database.Repair (), main_window); query = new PhotoQuery (Database.Photos); } UpdateStatusLabel (); query.Changed += HandleQueryChanged; Database.Photos.ItemsChanged += HandleDbItemsChanged; Database.Tags.ItemsChanged += HandleTagsChanged; Database.Tags.ItemsAdded += HandleTagsChanged; Database.Tags.ItemsRemoved += HandleTagsChanged; group_selector = new GroupSelector (); group_selector.Adaptor = new TimeAdaptor (query, Preferences.Get<bool> (Preferences.GROUP_ADAPTOR_ORDER_ASC)); group_selector.ShowAll (); if (zoom_scale != null) { zoom_scale.ValueChanged += HandleZoomScaleValueChanged; } view_vbox.PackStart (group_selector, false, false, 0); view_vbox.ReorderChild (group_selector, 0); find_bar = new FindBar (query, tag_selection_widget.Model); view_vbox.PackStart (find_bar, false, false, 0); view_vbox.ReorderChild (find_bar, 1); main_window.KeyPressEvent += HandleKeyPressEvent; query_widget = new QueryWidget (query, Database); query_widget.Logic.Changed += HandleQueryLogicChanged; view_vbox.PackStart (query_widget, false, false, 0); view_vbox.ReorderChild (query_widget, 2); MenuItem findByTag = uimanager.GetWidget ("/ui/menubar1/find/find_by_tag") as MenuItem; query_widget.Hidden += delegate { ((Gtk.Label)findByTag.Child).TextWithMnemonic = Catalog.GetString ("Show _Find Bar"); }; query_widget.Shown += delegate { ((Gtk.Label)findByTag.Child).TextWithMnemonic = Catalog.GetString ("Hide _Find Bar"); }; icon_view = new QueryView (query); icon_view.ZoomChanged += HandleZoomChanged; LoadPreference (Preferences.ZOOM); LoadPreference (Preferences.SHOW_TAGS); LoadPreference (Preferences.SHOW_DATES); LoadPreference (Preferences.SHOW_RATINGS); icon_view_scrolled.Add (icon_view); icon_view.DoubleClicked += HandleDoubleClicked; icon_view.Vadjustment.ValueChanged += HandleIconViewScroll; icon_view.GrabFocus (); preview_popup = new PreviewPopup (icon_view); icon_view.DragBegin += HandleIconViewDragBegin; icon_view.DragEnd += HandleIconViewDragEnd; icon_view.DragDataGet += HandleIconViewDragDataGet; icon_view.DragMotion += HandleIconViewDragMotion; icon_view.DragDrop += HandleIconViewDragDrop; // StartDrag is fired by IconView icon_view.StartDrag += HandleIconViewStartDrag; TagMenu tag_menu = new TagMenu (null, Database.Tags); tag_menu.NewTagHandler += delegate { HandleCreateTagAndAttach (this, null); }; tag_menu.TagSelected += HandleAttachTagMenuSelected; tag_menu.Populate (); (uimanager.GetWidget ("/ui/menubar1/edit2/attach_tag") as MenuItem).Submenu = tag_menu; PhotoTagMenu pmenu = new PhotoTagMenu (); pmenu.TagSelected += HandleRemoveTagMenuSelected; (uimanager.GetWidget ("/ui/menubar1/edit2/remove_tag") as MenuItem).Submenu = pmenu; Gtk.Drag.DestSet (icon_view, DestDefaults.All, (TargetEntry[])iconDestTargetList, DragAction.Copy | DragAction.Move); icon_view.DragDataReceived += HandleIconViewDragDataReceived; icon_view.KeyPressEvent += HandleIconViewKeyPressEvent; photo_view = new PhotoView (query); photo_box.Add (photo_view); photo_view.DoubleClicked += HandleDoubleClicked; photo_view.KeyPressEvent += HandlePhotoViewKeyPressEvent; photo_view.UpdateStarted += HandlePhotoViewUpdateStarted; photo_view.UpdateFinished += HandlePhotoViewUpdateFinished; photo_view.View.ZoomChanged += HandleZoomChanged; // Tag typing: focus the tag entry if the user starts typing a tag icon_view.KeyPressEvent += HandlePossibleTagTyping; photo_view.KeyPressEvent += HandlePossibleTagTyping; tag_entry = new TagEntry (Database.Tags); tag_entry.KeyPressEvent += HandleTagEntryKeyPressEvent; tag_entry.TagsAttached += HandleTagEntryTagsAttached; tag_entry.TagsRemoved += HandleTagEntryRemoveTags; tag_entry.Activated += HandleTagEntryActivate; tag_entry_container.Add (tag_entry); Gtk.Drag.DestSet (photo_view, DestDefaults.All, tag_target_table, DragAction.Copy | DragAction.Move); photo_view.DragMotion += HandlePhotoViewDragMotion; photo_view.DragDrop += HandlePhotoViewDragDrop; photo_view.DragDataReceived += HandlePhotoViewDragDataReceived; view_notebook.SwitchPage += HandleViewNotebookSwitchPage; group_selector.Adaptor.GlassSet += HandleAdaptorGlassSet; group_selector.Adaptor.Changed += HandleAdaptorChanged; LoadPreference (Preferences.GROUP_ADAPTOR_ORDER_ASC); LoadPreference (Preferences.FILMSTRIP_ORIENTATION); Selection = new MainSelection (this); Selection.Changed += HandleSelectionChanged; Selection.ItemsChanged += HandleSelectionItemsChanged; Selection.Changed += Sidebar.HandleSelectionChanged; Selection.ItemsChanged += Sidebar.HandleSelectionItemsChanged; AddinManager.ExtensionChanged += PopulateExtendableMenus; PopulateExtendableMenus (null, null); UpdateMenus (); main_window.ShowAll (); tagbar.Hide (); find_bar.Hide (); UpdateFindByTagMenu (); LoadPreference (Preferences.SHOW_TOOLBAR); LoadPreference (Preferences.SHOW_SIDEBAR); LoadPreference (Preferences.SHOW_TIMELINE); LoadPreference (Preferences.SHOW_FILMSTRIP); LoadPreference (Preferences.GNOME_MAILTO_ENABLED); Preferences.SettingChanged += OnPreferencesChanged; main_window.DeleteEvent += HandleDeleteEvent; // When the icon_view is loaded, set it's initial scroll position icon_view.SizeAllocated += HandleIconViewReady; export.Activated += HandleExportActivated; UpdateToolbar (); (uimanager.GetWidget ("/ui/menubar1/file1/close1") as MenuItem).Hide (); Banshee.Kernel.Scheduler.Resume (); }
public static void Toggle(this Gtk.ToggleToolButton button) { button.Active = !button.Active; }
protected virtual void Build () { global::Stetic.Gui.Initialize (this); // Widget MonoGame.Tools.Pipeline.MainWindow this.UIManager = new global::Gtk.UIManager (); global::Gtk.ActionGroup w1 = new global::Gtk.ActionGroup ("Default"); this.FileAction = new global::Gtk.Action ("FileAction", global::Mono.Unix.Catalog.GetString ("File"), null, null); this.FileAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("File"); w1.Add (this.FileAction, null); this.NewAction = new global::Gtk.Action ("NewAction", global::Mono.Unix.Catalog.GetString ("New..."), null, "gtk-new"); this.NewAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("New..."); w1.Add (this.NewAction, "<Control>n"); this.OpenAction = new global::Gtk.Action ("OpenAction", global::Mono.Unix.Catalog.GetString ("Open..."), null, "gtk-open"); this.OpenAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Open..."); w1.Add (this.OpenAction, "<Control>o"); this.OpenRecentAction = new global::Gtk.Action ("OpenRecentAction", global::Mono.Unix.Catalog.GetString ("Open Recent"), null, null); this.OpenRecentAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Open Recent"); w1.Add (this.OpenRecentAction, null); this.CloseAction = new global::Gtk.Action ("CloseAction", global::Mono.Unix.Catalog.GetString ("Close"), null, "gtk-close"); this.CloseAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Close"); w1.Add (this.CloseAction, null); this.ImportAction = new global::Gtk.Action ("ImportAction", global::Mono.Unix.Catalog.GetString ("Import..."), null, null); this.ImportAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Import..."); w1.Add (this.ImportAction, null); this.SaveAction = new global::Gtk.Action ("SaveAction", global::Mono.Unix.Catalog.GetString ("Save"), null, "gtk-save"); this.SaveAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Save"); w1.Add (this.SaveAction, "<Control>s"); this.SaveAsAction = new global::Gtk.Action ("SaveAsAction", global::Mono.Unix.Catalog.GetString ("Save As..."), null, "gtk-save-as"); this.SaveAsAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Save As..."); w1.Add (this.SaveAsAction, null); this.ExitAction = new global::Gtk.Action ("ExitAction", global::Mono.Unix.Catalog.GetString ("Exit"), null, "gtk-quit"); this.ExitAction.HideIfEmpty = false; this.ExitAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Exit"); w1.Add (this.ExitAction, null); this.EditAction = new global::Gtk.Action ("EditAction", global::Mono.Unix.Catalog.GetString ("Edit"), null, null); this.EditAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Edit"); w1.Add (this.EditAction, null); this.UndoAction = new global::Gtk.Action ("UndoAction", global::Mono.Unix.Catalog.GetString ("Undo"), null, "gtk-undo"); this.UndoAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Undo"); w1.Add (this.UndoAction, "<Control>z"); this.RedoAction = new global::Gtk.Action ("RedoAction", global::Mono.Unix.Catalog.GetString ("Redo"), null, "gtk-redo"); this.RedoAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Redo"); w1.Add (this.RedoAction, "<Control>y"); RenameAction = new Action ("RenameAction", global::Mono.Unix.Catalog.GetString ("Rename"), null, null); RenameAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Rename"); w1.Add (RenameAction, null); this.DeleteAction = new global::Gtk.Action ("DeleteAction", global::Mono.Unix.Catalog.GetString ("Delete"), null, "gtk-delete"); this.DeleteAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Delete"); w1.Add (this.DeleteAction, null); this.BuildAction = new global::Gtk.Action ("BuildAction", global::Mono.Unix.Catalog.GetString ("Build"), null, null); this.BuildAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Build"); w1.Add (this.BuildAction, null); this.BuildAction1 = new global::Gtk.Action ("BuildAction1", global::Mono.Unix.Catalog.GetString ("Build"), null, "gtk-execute"); this.BuildAction1.ShortLabel = global::Mono.Unix.Catalog.GetString ("Build"); w1.Add (this.BuildAction1, "<Mod2>F6"); this.RebuildAction = new global::Gtk.Action ("RebuildAction", global::Mono.Unix.Catalog.GetString ("Rebuild"), null, "gtk-execute"); this.RebuildAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Rebuild"); w1.Add (this.RebuildAction, null); this.CleanAction = new global::Gtk.Action ("CleanAction", global::Mono.Unix.Catalog.GetString ("Clean"), null, null); this.CleanAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Clean"); w1.Add (this.CleanAction, null); this.DebugModeAction = new global::Gtk.ToggleAction ("DebugModeAction", global::Mono.Unix.Catalog.GetString ("Debug Mode"), null, null); this.DebugModeAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Debug Mode"); w1.Add (this.DebugModeAction, null); this.FilterOutputAction = new global::Gtk.ToggleAction ("FilterOutputAction", global::Mono.Unix.Catalog.GetString ("Filter Output"), null, null); this.FilterOutputAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Filter Output"); this.FilterOutputAction.Active = true; w1.Add (this.FilterOutputAction, null); this.HelpAction = new global::Gtk.Action ("HelpAction", global::Mono.Unix.Catalog.GetString ("Help"), null, null); this.HelpAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Help"); w1.Add (this.HelpAction, null); this.ViewHelpAction = new global::Gtk.Action ("ViewHelpAction", global::Mono.Unix.Catalog.GetString ("View Help"), null, "gtk-help"); this.ViewHelpAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("View Help"); w1.Add (this.ViewHelpAction, "<Mod2>F1"); this.AboutAction = new global::Gtk.Action ("AboutAction", global::Mono.Unix.Catalog.GetString ("About"), null, "gtk-about"); this.AboutAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("About"); w1.Add (this.AboutAction, null); this.CancelBuildAction = new global::Gtk.Action ("CancelBuildAction", global::Mono.Unix.Catalog.GetString ("Cancel Build"), null, "gtk-stop"); this.CancelBuildAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Cancel Build"); w1.Add (this.CancelBuildAction, null); this.AddAction = new global::Gtk.Action ("AddAction", global::Mono.Unix.Catalog.GetString ("Add"), null, null); this.AddAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Add"); w1.Add (this.AddAction, null); this.NewItemAction = new global::Gtk.Action ("NewItemAction", global::Mono.Unix.Catalog.GetString ("New Item..."), null, "gtk-file"); this.NewItemAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("New Item..."); w1.Add (this.NewItemAction, null); this.NewFolderAction = new global::Gtk.Action ("NewFolderAction", global::Mono.Unix.Catalog.GetString ("New Folder..."), null, "gtk-directory"); this.NewFolderAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("New Folder..."); w1.Add (this.NewFolderAction, null); this.ExistingItemAction = new global::Gtk.Action ("ExistingItemAction", global::Mono.Unix.Catalog.GetString ("Existing Item..."), null, null); this.ExistingItemAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Add Existing Item..."); w1.Add (this.ExistingItemAction, null); this.ExistingFolderAction = new global::Gtk.Action ("ExistingFolderAction", global::Mono.Unix.Catalog.GetString ("Existing Folder..."), null, null); this.ExistingFolderAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Add Existing Folder..."); w1.Add (this.ExistingFolderAction, null); this.UIManager.InsertActionGroup (w1, 0); this.AddAccelGroup (this.UIManager.AccelGroup); this.Name = "MonoGame.Tools.Pipeline.MainWindow"; this.Icon = global::Gdk.Pixbuf.LoadFromResource ("MonoGame.Tools.Pipeline.App.ico"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Container child MonoGame.Tools.Pipeline.MainWindow.Gtk.Container+ContainerChild this.vbox2 = new global::Gtk.VBox (); this.vbox2.Name = "vbox2"; // Container child vbox2.Gtk.Box+BoxChild this.UIManager.AddUiFromString ("<ui><menubar name='menubar1'><menu name='FileAction' action='FileAction'><menuitem name='NewAction' action='NewAction'/><menuitem name='OpenAction' action='OpenAction'/><menuitem name='OpenRecentAction' action='OpenRecentAction'/><menuitem name='CloseAction' action='CloseAction'/><separator/><menuitem name='ImportAction' action='ImportAction'/><separator/><menuitem name='SaveAction' action='SaveAction'/><menuitem name='SaveAsAction' action='SaveAsAction'/><separator/><menuitem name='ExitAction' action='ExitAction'/></menu><menu name='EditAction' action='EditAction'><menuitem name='UndoAction' action='UndoAction'/><menuitem name='RedoAction' action='RedoAction'/><separator/><menu name='AddAction' action='AddAction'><menuitem name='NewItemAction' action='NewItemAction'/><menuitem name='NewFolderAction' action='NewFolderAction'/><separator/><menuitem name='ExistingItemAction' action='ExistingItemAction'/><menuitem name='ExistingFolderAction' action='ExistingFolderAction'/></menu><separator/><menuitem name='RenameAction' action='RenameAction'/><menuitem name='DeleteAction' action='DeleteAction'/></menu><menu name='BuildAction' action='BuildAction'><menuitem name='BuildAction1' action='BuildAction1'/><menuitem name='RebuildAction' action='RebuildAction'/><menuitem name='CleanAction' action='CleanAction'/><menuitem name='CancelBuildAction' action='CancelBuildAction'/><separator name='sep1'/><menuitem name='DebugModeAction' action='DebugModeAction'/><menuitem name='FilterOutputAction' action='FilterOutputAction'/></menu><menu name='HelpAction' action='HelpAction'><menuitem name='ViewHelpAction' action='ViewHelpAction'/><separator/><menuitem name='AboutAction' action='AboutAction'/></menu></menubar></ui>"); this.menubar1 = ((global::Gtk.MenuBar)(this.UIManager.GetWidget ("/menubar1"))); this.menubar1.Name = "menubar1"; this.vbox2.Add (this.menubar1); toolBar1 = new Toolbar(); toolNew = new ToolButton(new Image(null, "Toolbar.New.png"), "New"); toolNew.TooltipText = toolNew.Label; toolBar1.Add(toolNew); toolOpen = new ToolButton(new Image(null, "Toolbar.Open.png"), "Open"); toolOpen.TooltipText = toolOpen.Label; toolBar1.Add(toolOpen); toolSave = new ToolButton(new Image(null, "Toolbar.Save.png"), "Save"); toolSave.TooltipText = toolSave.Label; toolBar1.Add(toolSave); toolBar1.Add(new SeparatorToolItem()); toolNewItem = new ToolButton(new Image(null, "Toolbar.NewItem.png"), "Add New Item"); toolNewItem.TooltipText = toolNewItem.Label; toolBar1.Add(toolNewItem); toolAddItem = new ToolButton(new Image(null, "Toolbar.ExistingItem.png"), "Add Existing Item"); toolAddItem.TooltipText = toolAddItem.Label; toolBar1.Add(toolAddItem); toolNewFolder = new ToolButton(new Image(null, "Toolbar.NewFolder.png"), "Add New Folder"); toolNewFolder.TooltipText = toolNewFolder.Label; toolBar1.Add(toolNewFolder); toolAddFolder = new ToolButton(new Image(null, "Toolbar.ExistingFolder.png"), "Add Existing Folder"); toolAddFolder.TooltipText = toolAddFolder.Label; toolBar1.Add(toolAddFolder); toolBar1.Add(new SeparatorToolItem()); toolBuild = new ToolButton(new Image(null, "Toolbar.Build.png"), "Build"); toolBuild.TooltipText = toolBuild.Label; toolBar1.Add(toolBuild); toolRebuild = new ToolButton(new Image(null, "Toolbar.Rebuild.png"), "Rebuild"); toolRebuild.TooltipText = toolRebuild.Label; toolBar1.Add(toolRebuild); toolClean = new ToolButton(new Image(null, "Toolbar.Clean.png"), "Clean"); toolClean.TooltipText = toolClean.Label; toolBar1.Add(toolClean); toolBar1.Add(new SeparatorToolItem()); toolFilterOutput = new ToggleToolButton(); toolFilterOutput.Label = toolFilterOutput.TooltipText = "Filter Output"; toolFilterOutput.IconWidget = new Image(null, "Toolbar.FilterOutput.png"); toolBar1.Add(toolFilterOutput); if (!Global.UseHeaderBar) this.vbox2.PackStart(toolBar1, false, true, 0); global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.menubar1])); w2.Position = 0; w2.Expand = false; w2.Fill = false; // Container child vbox2.Gtk.Box+BoxChild this.hpaned1 = new global::Gtk.HPaned (); this.hpaned1.CanFocus = true; this.hpaned1.Name = "hpaned1"; this.hpaned1.Position = 179; // Container child hpaned1.Gtk.Paned+PanedChild this.vpaned2 = new global::Gtk.VPaned (); this.vpaned2.CanFocus = true; this.vpaned2.Name = "vpaned2"; this.vpaned2.Position = 247; // Container child vpaned2.Gtk.Paned+PanedChild this.projectview1 = new global::MonoGame.Tools.Pipeline.ProjectView (); this.projectview1.Events = ((global::Gdk.EventMask)(256)); this.projectview1.Name = "projectview1"; this.vpaned2.Add (this.projectview1); global::Gtk.Paned.PanedChild w3 = ((global::Gtk.Paned.PanedChild)(this.vpaned2 [this.projectview1])); w3.Resize = false; // Container child vpaned2.Gtk.Paned+PanedChild this.propertiesview1 = new global::MonoGame.Tools.Pipeline.PropertiesView (); this.propertiesview1.Events = ((global::Gdk.EventMask)(256)); this.propertiesview1.Name = "propertiesview1"; this.vpaned2.Add (this.propertiesview1); global::Gtk.Paned.PanedChild w4 = ((global::Gtk.Paned.PanedChild)(this.vpaned2 [this.propertiesview1])); w4.Resize = false; this.hpaned1.Add (this.vpaned2); global::Gtk.Paned.PanedChild w5 = ((global::Gtk.Paned.PanedChild)(this.hpaned1 [this.vpaned2])); w5.Resize = false; // Container child hpaned1.Gtk.Paned+PanedChild buildOutput1 = new BuildOutput(); this.hpaned1.Add (this.buildOutput1); this.vbox2.Add (this.hpaned1); global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.hpaned1])); w8.Position = 2; this.Add (this.vbox2); treeview1 = new TreeView(); #if GTK3 if(Global.UseHeaderBar) { Builder builder = new Builder(null, "MonoGame.Tools.Pipeline.Gtk.MainWindow.HeaderBar.glade", null); hbar = new HeaderBar(builder.GetObject("headerbar").Handle); builder.Autoconnect(this); hbar.AttachToWindow(this); hbar.ShowCloseButton = true; hbar.Show(); foreach(var o in menubar1.Children) { menubar1.Remove(o); menu2.Insert(o, 4); } new_button.Clicked += OnNewActionActivated; save_button.Clicked += OnSaveActionActivated; build_button.Clicked += OnBuildAction1Activated; rebuild_button.Clicked += OnRebuildActionActivated; cancel_button.Clicked += OnCancelBuildActionActivated; filteroutput_button.ButtonReleaseEvent += ToggleFilterOutput; filteroutput_button.Sensitive = true; vbox2.Remove (menubar1); open_menubutton = new MenuButton(open_button.Handle); var popover = new Popover(open_menubutton); var vbox = new VBox(); vbox.WidthRequest = 350; vbox.HeightRequest = 300; Gtk3Wrapper.gtk_tree_view_set_activate_on_single_click(treeview1.Handle, true); treeview1.HeadersVisible = false; treeview1.EnableGridLines = TreeViewGridLines.Horizontal; treeview1.HoverSelection = true; treeview1.RowActivated += delegate(object o, RowActivatedArgs args) { popover.Hide(); TreeIter iter; if(!recentListStore.GetIter(out iter, args.Path)) return; OpenProject(recentListStore.GetValue(iter, 1).ToString()); }; ScrolledWindow scroll1 = new ScrolledWindow(); scroll1.WidthRequest = 350; scroll1.HeightRequest = 300; scroll1.Add(treeview1); vbox.PackStart(scroll1, true, true, 0); var openButton = new Button("Open Other..."); openButton.Clicked += delegate(object sender, System.EventArgs e) { popover.Hide(); OnOpenActionActivated(sender, e); }; vbox.PackStart(openButton, false, true, 0); vbox.ShowAll(); popover.Add(vbox); open_menubutton.Popup = popover; } #endif this.Title = basetitle; if ((this.Child != null)) { this.Child.ShowAll (); } this.DefaultWidth = 751; this.DefaultHeight = 557; #if GTK3 Gdk.Geometry geom = new Gdk.Geometry(); geom.MinWidth = 400; geom.MinHeight = 300; this.SetGeometryHints(this, geom, Gdk.WindowHints.MinSize); #endif this.Show (); this.DeleteEvent += new global::Gtk.DeleteEventHandler (this.OnDeleteEvent); this.NewAction.Activated += new global::System.EventHandler (this.OnNewActionActivated); this.toolNew.Clicked += OnNewActionActivated; this.OpenAction.Activated += new global::System.EventHandler (this.OnOpenActionActivated); this.toolOpen.Clicked += OnOpenActionActivated; this.CloseAction.Activated += new global::System.EventHandler (this.OnCloseActionActivated); this.ImportAction.Activated += new global::System.EventHandler (this.OnImportActionActivated); this.SaveAction.Activated += new global::System.EventHandler (this.OnSaveActionActivated); this.toolSave.Clicked += OnSaveActionActivated; this.SaveAsAction.Activated += new global::System.EventHandler (this.OnSaveAsActionActivated); this.ExitAction.Activated += new global::System.EventHandler (this.OnExitActionActivated); this.UndoAction.Activated += new global::System.EventHandler (this.OnUndoActionActivated); this.RedoAction.Activated += new global::System.EventHandler (this.OnRedoActionActivated); RenameAction.Activated += this.OnRenameActionActivated; this.DeleteAction.Activated += new global::System.EventHandler (this.OnDeleteActionActivated); this.BuildAction1.Activated += new global::System.EventHandler (this.OnBuildAction1Activated); toolBuild.Clicked += OnBuildAction1Activated; this.RebuildAction.Activated += new global::System.EventHandler (this.OnRebuildActionActivated); toolRebuild.Clicked += OnRebuildActionActivated; this.CleanAction.Activated += new global::System.EventHandler (this.OnCleanActionActivated); toolClean.Clicked += OnCleanActionActivated; this.ViewHelpAction.Activated += new global::System.EventHandler (this.OnViewHelpActionActivated); this.AboutAction.Activated += new global::System.EventHandler (this.OnAboutActionActivated); this.NewItemAction.Activated += new global::System.EventHandler (this.OnNewItemActionActivated); this.toolNewItem.Clicked += OnNewItemActionActivated; this.NewFolderAction.Activated += new global::System.EventHandler (this.OnNewFolderActionActivated); this.toolNewFolder.Clicked += OnNewFolderActionActivated; this.ExistingItemAction.Activated += new global::System.EventHandler (this.OnAddItemActionActivated); this.toolAddItem.Clicked += OnAddItemActionActivated; this.ExistingFolderAction.Activated += new global::System.EventHandler (this.OnAddFolderActionActivated); this.toolAddFolder.Clicked += OnAddFolderActionActivated; this.DebugModeAction.Activated += new global::System.EventHandler (this.OnDebugModeActionActivated); this.FilterOutputAction.Activated += OnFilterOutputActionActivated; this.toolFilterOutput.ButtonReleaseEvent += ToggleFilterOutput; this.CancelBuildAction.Activated += new global::System.EventHandler (this.OnCancelBuildActionActivated); this.SizeAllocated += MainWindow_SizeAllocated; }