public static LoadIcon ( string name, Gtk size, IconLookupFlags flags = IconLookupFlags.ForceSvg ) : Gdk.Pixbuf | ||
name | string | Icon Name. |
size | Gtk | Icon Size as a Gtk.IconSize. |
flags | IconLookupFlags | Lookup Flags like ForceSVG. |
Résultat | Gdk.Pixbuf |
static public string QueryMessage(Widget sender, string key, string title = null, string value = "") { string ret = null; Window parent; if (sender != null) { parent = sender.Toplevel as Window; } else { parent = null; } Label label = new Label(key); Entry entry = new Entry(value); Gtk.Dialog dialog = new Gtk.Dialog(title, parent, DialogFlags.DestroyWithParent); dialog.Modal = true; dialog.AddButton(Catalog.GetString("Add"), ResponseType.Ok); dialog.VBox.PackStart(label, false, false, 0); dialog.VBox.PackStart(entry, true, true, 0); dialog.Icon = Misc.LoadIcon("longomatch", Gtk.IconSize.Dialog, 0); dialog.ShowAll(); if (dialog.Run() == (int)ResponseType.Ok) { ret = entry.Text; } dialog.Destroy(); return(ret); }
public ProjectsManagerPanel(Project openedProject) { this.openedProject = openedProject; this.DB = Config.DatabaseManager.ActiveDB; this.gkit = Config.GUIToolkit; this.Build(); this.videoFileInfos = new List <VideoFileInfo> (); savebuttonimage.Pixbuf = Misc.LoadIcon("longomatch-project-save", 34); exportbuttonimage.Pixbuf = Misc.LoadIcon("longomatch-project-export", 34); resyncbuttonimage.Pixbuf = Misc.LoadIcon("longomatch-project-resync", 34); deletebuttonimage.Pixbuf = Misc.LoadIcon("longomatch-project-delete", 34); openbuttonimage.Pixbuf = Misc.LoadIcon("longomatch-project-open", 34); // Force tooltips to be translatable as there seems to be a bug in stetic // code generation for translatable tooltips. savebutton.TooltipMarkup = Catalog.GetString("Save"); exportbutton.TooltipMarkup = Catalog.GetString("Export"); openbutton.TooltipMarkup = Catalog.GetString("Open"); deletebutton.TooltipMarkup = Catalog.GetString("Delete"); notebook1.ShowTabs = false; notebook1.ShowBorder = false; projectlistwidget1.SelectionMode = SelectionMode.Multiple; projectlistwidget1.ProjectsSelected += HandleProjectsSelected; projectlistwidget1.Fill(DB.GetAllProjects()); seasonentry.Changed += HandleChanged; competitionentry.Changed += HandleChanged; savebutton.Clicked += HandleSaveClicked; exportbutton.Clicked += HandleExportClicked; resyncbutton.Clicked += HandleResyncClicked; deletebutton.Clicked += HandleDeleteClicked; openbutton.Clicked += HandleOpenClicked; datepicker.ValueChanged += HandleDateChanged; desctextview.Buffer.Changed += HandleChanged; notebook1.Page = 0; panelheader1.Title = Catalog.GetString("PROJECTS MANAGER"); panelheader1.ApplyVisible = false; panelheader1.BackClicked += HandleBackClicked; projectlistwidget1.ShowList = true; // Only visible when multi camera is supported. Indeed periods can be edited in the timeline of the project. resyncbutton.Visible = Config.SupportsMultiCamera; SetStyle(); }
public CapturerBin() { this.Build(); LongoMatch.Gui.Helpers.Misc.SetFocus(vbox1, false); videowindow.ReadyEvent += HandleReady; videowindow.ExposeEvent += HandleExposeEvent; videowindow.CanFocus = true; recbutton.Clicked += (sender, e) => StartPeriod(); stopbutton.Clicked += (sender, e) => StopPeriod(); pausebutton.Clicked += (sender, e) => PausePeriod(); resumebutton.Clicked += (sender, e) => ResumePeriod(); savebutton.Clicked += HandleSaveClicked; cancelbutton.Clicked += HandleCloseClicked; // Force tooltips to be translatable as there seems to be a bug in stetic // code generation for translatable tooltips. recbutton.TooltipMarkup = Catalog.GetString("Start recording period"); stopbutton.TooltipMarkup = Catalog.GetString("Stop recording period"); pausebutton.TooltipMarkup = Catalog.GetString("Pause clock"); resumebutton.TooltipMarkup = Catalog.GetString("Resume clock"); savebutton.TooltipMarkup = Catalog.GetString("Save project"); cancelbutton.TooltipMarkup = Catalog.GetString("Cancel capture"); deletelastbutton.TooltipMarkup = Catalog.GetString("Delete event"); playlastbutton.TooltipMarkup = Catalog.GetString("Replay event"); recimage.Pixbuf = Misc.LoadIcon("longomatch-control-record", StyleConf.PlayerCapturerIconSize); stopimage.Pixbuf = Misc.LoadIcon("longomatch-stop", StyleConf.PlayerCapturerIconSize); pauseimage.Pixbuf = Misc.LoadIcon("longomatch-pause-clock", StyleConf.PlayerCapturerIconSize); resumeimage.Pixbuf = Misc.LoadIcon("longomatch-resume-clock", StyleConf.PlayerCapturerIconSize); saveimage.Pixbuf = Misc.LoadIcon("longomatch-save", StyleConf.PlayerCapturerIconSize); cancelimage.Pixbuf = Misc.LoadIcon("longomatch-cancel-rec", StyleConf.PlayerCapturerIconSize); deletelastimage.Pixbuf = Misc.LoadIcon("longomatch-delete", StyleConf.PlayerCapturerIconSize); playlastimage.Pixbuf = Misc.LoadIcon("longomatch-control-play", StyleConf.PlayerCapturerIconSize); lasteventbox.Visible = false; deletelastbutton.Clicked += HandleDeleteLast; playlastbutton.Clicked += HandlePlayLast; Periods = new List <Period> (); Reset(); Mode = CapturerType.Live; Config.EventsBroker.EventCreatedEvent += HandleEventCreated; lastlabel.ModifyFont(Pango.FontDescription.FromString(Config.Style.Font + " 8px")); }
public static int PopupMessage(Widget sender, MessageType type, String errorMessage, CustomizeDialog customize = null) { Window toplevel; int ret; if (sender != null) { toplevel = sender.Toplevel as Window; } else { toplevel = null; } MessageDialog md = new MessageDialog(toplevel, DialogFlags.Modal, type, ButtonsType.Ok, errorMessage); md.Icon = Misc.LoadIcon("longomatch", Gtk.IconSize.Dialog, 0); try { var vbox = md.MessageDialogGetMessageArea(); var label = (Label)vbox.Children [0]; label.SetLinkHandler(url => { try { System.Diagnostics.Process.Start(url); } catch (Exception ex) { Log.WarningFormat("Could not spawn process for url {0}\n{1}", url, ex); } }); } catch (Exception ex) { Log.WarningFormat("Could not set link handler for Message Dialog\n{0}", ex); } if (customize != null) { customize(md); } ret = md.Run(); md.Destroy(); return(ret); }
public VideoConversionTool() { this.Build(); buttonOk.Sensitive = false; Files = new List <MediaFile> (); supportedVideoStandards = VideoStandards.Transcode; maxHeight = supportedVideoStandards [0].Height; mediafilechooser1.FileChooserMode = FileChooserMode.File; mediafilechooser1.ChangedEvent += HandleFileChanges; mediafilechooser1.ProposedFileName = String.Format("{0}-Video-{1}.mp4", Constants.SOFTWARE_NAME, DateTime.Now.ToShortDateString().Replace('/', '-')); FillStandards(); FillBitrates(); addbutton1.Clicked += OnAddbuttonClicked; buttonOk.Clicked += OnButtonOkClicked; convertimage.Pixbuf = Misc.LoadIcon("longomatch-video-converter-big", 64); addimage.Pixbuf = Misc.LoadStockIcon(addimage, "gtk-add", IconSize.Button); eventbox1.ModifyBg(StateType.Normal, Misc.ToGdkColor(Config.Style.PaletteBackgroundDark)); addbutton1.CanFocus = false; scrolledwindow1.Visible = false; }
static public bool QuestionMessage(Widget parent, string question, string title = null) { Window toplevel; if (parent != null) { toplevel = parent.Toplevel as Window; } else { toplevel = null; } MessageDialog md = new MessageDialog(toplevel, DialogFlags.Modal, MessageType.Question, ButtonsType.YesNo, question); md.Icon = Misc.LoadIcon("longomatch", IconSize.Button, 0); md.Title = title; var res = md.Run(); md.Destroy(); return(res == (int)ResponseType.Yes); }
public DrawingTool(Window parent) { TransientFor = parent; this.Build(); savebutton.Clicked += OnSavebuttonClicked; savetoprojectbutton.Clicked += OnSavetoprojectbuttonClicked; blackboard = new Blackboard(new WidgetWrapper(drawingarea)); blackboard.ConfigureObjectEvent += HandleConfigureObjectEvent; blackboard.ShowMenuEvent += HandleShowMenuEvent; blackboard.DrawableChangedEvent += HandleDrawableChangedEvent; blackboard.RegionOfInterestChanged += HandleRegionOfInterestChanged; selectbutton.Active = true; selectbuttonimage.Pixbuf = Misc.LoadIcon("longomatch-select", 20); eraserbuttonimage.Pixbuf = Misc.LoadIcon("longomatch-eraser", 20); penbuttonimage.Pixbuf = Misc.LoadIcon("longomatch-pencil", 20); textbuttonimage.Pixbuf = Misc.LoadIcon("longomatch-text", 20); linebuttonimage.Pixbuf = Misc.LoadIcon("longomatch-arrow", 20); crossbuttonimage.Pixbuf = Misc.LoadIcon("longomatch-mark", 20); rectanglebuttonimage.Pixbuf = Misc.LoadIcon("longomatch-square", 20); ellipsebuttonimage.Pixbuf = Misc.LoadIcon("longomatch-circle", 20); rectanglefilledbuttonimage.Pixbuf = Misc.LoadIcon("longomatch-square-fill", 20); ellipsefilledbuttonimage.Pixbuf = Misc.LoadIcon("longomatch-circle-fill", 20); playerbuttonimage.Pixbuf = Misc.LoadIcon("longomatch-person", 20); numberbuttonimage.Pixbuf = Misc.LoadIcon("longomatch-counter", 20); anglebuttonimage.Pixbuf = Misc.LoadIcon("longomatch-angle", 20); zoombuttonimage.Pixbuf = Misc.LoadIcon("longomatch-search", 20); zoomoutimage.Pixbuf = Helpers.Misc.LoadIcon("longomatch-zoom-out", 14); zoominimage.Pixbuf = Helpers.Misc.LoadIcon("longomatch-zoom-in", 14); selectbutton.Toggled += HandleToolClicked; eraserbutton.Toggled += HandleToolClicked; penbutton.Toggled += HandleToolClicked; textbutton.Toggled += HandleToolClicked; linebutton.Toggled += HandleToolClicked; crossbutton.Toggled += HandleToolClicked; rectanglebutton.Toggled += HandleToolClicked; ellipsebutton.Toggled += HandleToolClicked; rectanglefilledbutton.Toggled += HandleToolClicked; ellipsefilledbutton.Toggled += HandleToolClicked; playerbutton.Toggled += HandleToolClicked; anglebutton.Toggled += HandleToolClicked; numberbutton.Toggled += HandleToolClicked; zoombutton.Toggled += HandleToolClicked; // Force tooltips to be translatable as there seems to be a bug in stetic // code generation for translatable tooltips. selectbutton.TooltipMarkup = Catalog.GetString("Selection tool"); eraserbutton.TooltipMarkup = Catalog.GetString("Rubber tool"); penbutton.TooltipMarkup = Catalog.GetString("Pencil tool"); textbutton.TooltipMarkup = Catalog.GetString("Text tool"); linebutton.TooltipMarkup = Catalog.GetString("Line tool"); crossbutton.TooltipMarkup = Catalog.GetString("Cross tool"); rectanglebutton.TooltipMarkup = Catalog.GetString("Rectangle tool"); ellipsebutton.TooltipMarkup = Catalog.GetString("Ellipse tool"); rectanglefilledbutton.TooltipMarkup = Catalog.GetString("Filled rectangle tool"); ellipsefilledbutton.TooltipMarkup = Catalog.GetString("Filled ellipse tool"); playerbutton.TooltipMarkup = Catalog.GetString("Player tool"); numberbutton.TooltipMarkup = Catalog.GetString("Index tool"); anglebutton.TooltipMarkup = Catalog.GetString("Angle tool"); stylecombobox.TooltipMarkup = Catalog.GetString("Change the line style"); typecombobox.TooltipMarkup = Catalog.GetString("Change the line style"); clearbutton.TooltipMarkup = Catalog.GetString("Clear all drawings"); zoombutton.TooltipMarkup = Catalog.GetString("Zoom tool. Click to zoom in, Alt+Shift to zoom out"); FillLineStyle(); FillLineType(); colorbutton.ColorSet += HandleColorSet; colorbutton.Color = Misc.ToGdkColor(Color.Red1); blackboard.Color = Color.Red1; textcolorbutton.ColorSet += HandleTextColorSet; textcolorbutton.Color = Misc.ToGdkColor(Color.White); blackboard.TextColor = Color.White; backgroundcolorbutton.UseAlpha = true; backgroundcolorbutton.Alpha = (ushort)(ushort.MaxValue * 0.8); backgroundcolorbutton.ColorSet += HandleBackgroundColorSet; backgroundcolorbutton.Color = Misc.ToGdkColor(Color.Green1); blackboard.TextBackgroundColor = Misc.ToLgmColor(backgroundcolorbutton.Color, backgroundcolorbutton.Alpha); textspinbutton.Value = 12; textspinbutton.ValueChanged += (sender, e) => UpdateTextSize(); linesizespinbutton.ValueChanged += (sender, e) => UpdateLineWidth(); linesizespinbutton.Value = 4; clearbutton.Clicked += HandleClearClicked; zoomscale.CanFocus = false; zoomscale.SetRange(1, 4); zoomscale.SetIncrements(0.2, 0.2); zoomscale.ValueChanged += HandleZoomValueChanged; hscrollbar.ValueChanged += HandleScrollValueChanged; wscrollbar.ValueChanged += HandleScrollValueChanged; hscrollbar.Visible = wscrollbar.Visible = false; zoomscale.Value = 1; if (!Config.SupportsZoom) { zoombox.Visible = false; zoombutton.Visible = false; hscrollbar.Visible = false; wscrollbar.Visible = false; } }