override protected bool OnButtonPressEvent(Gdk.EventButton evnt) { TreePath[] paths = Selection.GetSelectedRows(); if (Misc.RightButtonClicked(evnt)) { // We don't want to unselect the play when several // plays are selected and we clik the right button // For multiedition if (paths.Length <= 1) { base.OnButtonPressEvent(evnt); paths = Selection.GetSelectedRows(); } if (paths.Length == 1) { TimeNode selectedTimeNode = GetValueFromPath(paths [0]) as TimeNode; if (selectedTimeNode is TimelineEvent) { ShowMenu(); } } else if (paths.Length > 1) { ShowMenu(); } } else { GetPathAtPos((int)evnt.X, (int)evnt.Y, out pathClicked); base.OnButtonPressEvent(evnt); } return(true); }
protected override bool OnButtonPressEvent(Gdk.EventButton evnt) { if (Misc.RightButtonClicked(evnt)) { TreePath path; GetPathAtPos((int)evnt.X, (int)evnt.Y, out path); if (path != null) { Model.GetIter(out selectedIter, path); object el = Model.GetValue(selectedIter, 0); if (el is Playlist) { ShowPlaylistMenu(el as Playlist); } else { TreeIter parent; Model.IterParent(out parent, selectedIter); Playlist playlist = Model.GetValue(parent, 0) as Playlist; ShowPlaylistElementMenu(playlist, el as IPlaylistElement, parent); } } } else { GetPathAtPos((int)evnt.X, (int)evnt.Y, out pathClicked); } return(base.OnButtonPressEvent(evnt)); }
public ProjectListWidget() { this.Build(); store = CreateStore(); iconview.TextColumn = COL_DISPLAY_NAME; iconview.PixbufColumn = COL_PIXBUF1; iconview.SelectionChanged += HandleIconViewSelectionChanged; iconview.ItemActivated += HandleItemActivated; iconview.ItemWidth = 200; treeview.HeadersVisible = false; treeview.AppendColumn("Home", new CellRendererPixbuf(), "pixbuf", COL_PIXBUF2); treeview.AppendColumn("Away", new CellRendererPixbuf(), "pixbuf", COL_PIXBUF3); treeview.AppendColumn("Desc", new CellRendererText(), "text", COL_DISPLAY_NAME); treeview.Selection.Mode = SelectionMode.Multiple; treeview.EnableGridLines = TreeViewGridLines.None; treeview.Selection.Changed += HandleTreeviewSelectionChanged; sortcombobox.Active = (int)Config.ProjectSortMethod; sortcombobox.Changed += (sender, e) => { /* Hack to make it actually resort */ sort.SetSortFunc(COL_DISPLAY_NAME, SortFunc); Config.ProjectSortMethod = (ProjectSortMethod)sortcombobox.Active; }; focusimage.Pixbuf = Misc.LoadIcon("longomatch-search", 27); ShowList = false; }
public VideoFileInfo () { this.Build (); eventbox3.ButtonPressEvent += HandleButtonPressEvent; HeightRequest = 100; filelabel.ModifyFg (StateType.Normal, Misc.ToGdkColor (Config.Style.PaletteText)); }
protected override bool OnButtonPressEvent(Gdk.EventButton evnt) { if (Misc.RightButtonClicked(evnt)) { playersMenu.Popup(); } return(base.OnButtonPressEvent(evnt)); }
Button Button(string name) { Button b = new Button(); Alignment a = new Alignment(0.5F, 0.5F, 0F, 0F); Gtk.Image i = new Gtk.Image(Misc.LoadStockIcon(this, name, IconSize.Button)); a.Add(i); b.Add(a); return(b); }
override protected bool OnButtonPressEvent(Gdk.EventButton evnt) { TreePath[] paths = Selection.GetSelectedRows(); if (Misc.RightButtonClicked(evnt)) { // We don't want to unselect the play when several // plays are selected and we clik the right button // For multiedition if (paths.Length <= 1) { base.OnButtonPressEvent(evnt); paths = Selection.GetSelectedRows(); } if (paths.Length == 1) { TimeNode selectedTimeNode = GetValueFromPath(paths [0]) as TimeNode; if (selectedTimeNode != null) { ShowMenu(); } else { EventType eventType = GetValueFromPath(paths [0]) as EventType; SetupSortMenu(eventType.SortMethod); categoriesMenu.Popup(); } } else if (paths.Length > 1) { ShowMenu(); } return(true); } else if ((evnt.Type == Gdk.EventType.ButtonPress) && (evnt.Button == 1)) { base.OnButtonPressEvent(evnt); paths = Selection.GetSelectedRows(); if (paths.Length == 1 && GetValueFromPath(paths [0]) is EventType) { dragging = true; catClicked = true; dragStarted = false; startX = (int)evnt.X; startY = (int)evnt.Y; } return(true); } else { return(base.OnButtonPressEvent(evnt)); } }
Button CreateButton(string s, IconSize size) { Button b = new Button(); Gtk.Image i = new Gtk.Image(Misc.LoadStockIcon(this, "gtk-add", size)); Label l = new Label(s); HBox box = new HBox(); box.PackStart(i, false, false, 5); box.PackStart(l, false, false, 5); b.Add(box); return(b); }
Pixbuf PlayerPhoto(Player p) { Pixbuf playerImage; if (p.Photo != null) { playerImage = p.Photo.Value; } else { playerImage = Misc.LoadIcon("longomatch-player-pic", 45, IconLookupFlags.ForceSvg); } return(playerImage); }
public VideoPreferencesPanel() { this.Build(); if (Config.FPS_N == 30000) { fpscombobox.Active = 1; } else { fpscombobox.Active = 0; } fpscombobox.Changed += HandleFPSChanged; Misc.FillImageFormat(renderimagecombo, Config.RenderVideoStandard); Misc.FillEncodingFormat(renderenccombo, Config.RenderEncodingProfile); Misc.FillQuality(renderqualcombo, Config.RenderEncodingQuality); Misc.FillImageFormat(captureimagecombo, Config.CaptureVideoStandard); Misc.FillEncodingFormat(captureenccombo, Config.CaptureEncodingProfile); Misc.FillQuality(capturequalcombo, Config.CaptureEncodingQuality); renderimagecombo.Changed += HandleImageChanged; captureimagecombo.Changed += HandleImageChanged; renderenccombo.Changed += HandleEncodingChanged; captureenccombo.Changed += HandleEncodingChanged; renderqualcombo.Changed += HandleQualityChanged; captureimagecombo.Changed += HandleImageChanged; enableSound = new CheckButton(); rendertable.Attach(enableSound, 1, 2, 3, 4, AttachOptions.Fill, AttachOptions.Fill, 0, 0); enableSound.CanFocus = false; enableSound.Show(); enableSound.Active = Config.EnableAudio; enableSound.Toggled += (sender, e) => { Config.EnableAudio = enableSound.Active; }; overlayTitle = new CheckButton(); rendertable.Attach(overlayTitle, 1, 2, 4, 5, AttachOptions.Fill, AttachOptions.Fill, 0, 0); overlayTitle.CanFocus = false; overlayTitle.Show(); overlayTitle.Active = Config.OverlayTitle; overlayTitle.Toggled += (sender, e) => { Config.OverlayTitle = overlayTitle.Active; }; }
void SetStyle() { Pango.FontDescription numDesc = Pango.FontDescription.FromString(Config.Style.Font + " 48px"); Pango.FontDescription nameDesc = Pango.FontDescription.FromString(Config.Style.Font + " 30px"); homescoreeventbox.ModifyBg(StateType.Normal, Misc.ToGdkColor(Config.Style.PaletteBackgroundDark)); homescorelabel.ModifyFg(StateType.Normal, Misc.ToGdkColor(Config.Style.PaletteText)); homescorelabel.ModifyFont(numDesc); awayscoreeventbox.ModifyBg(StateType.Normal, Misc.ToGdkColor(Config.Style.PaletteBackgroundDark)); awayscorelabel.ModifyBg(StateType.Normal, Misc.ToGdkColor(Config.Style.PaletteText)); awayscorelabel.ModifyFont(numDesc); homenamelabel.ModifyFont(nameDesc); homenamelabel.ModifyFg(StateType.Normal, Misc.ToGdkColor(Config.Style.PaletteText)); awaynamelabel.ModifyFont(nameDesc); awaynamelabel.ModifyFg(StateType.Normal, Misc.ToGdkColor(Config.Style.PaletteText)); }
public void Fill(List <ProjectDescription> projects) { Pixbuf image, homeShield, awayShield; swallowSignals = true; this.projects = projects; store.Clear(); foreach (ProjectDescription pdesc in projects) { MediaFile file = pdesc.FileSet.FirstOrDefault(); if (file != null && file.FilePath == Constants.FAKE_PROJECT) { image = Misc.LoadIcon("longomatch-video-device-fake", 50); } else if (pdesc.FileSet.Preview != null) { image = pdesc.FileSet.Preview.Value; } else { image = Misc.LoadIcon("longomatch-video-file", 50); } if (pdesc.LocalShield != null) { homeShield = pdesc.LocalShield.Scale(50, 50).Value; } else { homeShield = Misc.LoadIcon("longomatch-default-shield", 50); } if (pdesc.VisitorShield != null) { awayShield = pdesc.VisitorShield.Scale(50, 50).Value; } else { awayShield = Misc.LoadIcon("longomatch-default-shield", 50); } store.AppendValues(FormatDesc(pdesc), image, homeShield, awayShield, pdesc); } swallowSignals = false; iconview.SetCursor(new TreePath("0"), null, false); treeview.SetCursor(new TreePath("0"), null, false); }
void HandleColorSet(object sender, EventArgs e) { if (ignoreChanges) { return; } if (sender == colorbutton1) { template.Colors [0] = Misc.ToLgmColor(colorbutton1.Color); template.UpdateColors(); drawingarea.QueueDraw(); } else { template.Colors [1] = Misc.ToLgmColor(colorbutton2.Color); } Edited = true; }
public TeamTemplateEditor() { this.Build(); teamtagger = new TeamTagger(new WidgetWrapper(drawingarea)); teamtagger.SelectionMode = MultiSelectionMode.MultipleWithModifier; teamtagger.PlayersSelectionChangedEvent += HandlePlayersSelectionChangedEvent; teamtagger.PlayersSubstitutionEvent += HandlePlayersSubstitutionEvent; shieldimage.HeightRequest = shieldvbox.WidthRequest = SHIELD_SIZE; colorbutton1.Color = Misc.ToGdkColor(Color.Red1); colorbutton1.ColorSet += HandleColorSet; colorbutton2.Color = Misc.ToGdkColor(Color.Green1); colorbutton2.ColorSet += HandleColorSet; ConnectSignals(); ClearPlayer(); }
void HandleButtonPressEvent (object o, Gtk.ButtonPressEventArgs args) { if (args.Event.Button != 1 || disableChanges) { return; } MediaFile file = Misc.OpenFile (this); if (file != null) { if (mediaFile != null) { file.Offset = mediaFile.Offset; } fileSet.Replace (mediaFile, file); mediaFile = file; UpdateMediaFile (); if (Changed != null) { Changed (this, new EventArgs ()); } } }
public PlayListWidget() { this.Build(); playlisttreeview1.Reorderable = true; playlisttreeview1.RowActivated += HandleRowActivated; // Force tooltips to be translatable as there seems to be a bug in stetic // code generation for translatable tooltips. newbutton.TooltipMarkup = Catalog.GetString("Create a new playlist"); newvideobutton.TooltipMarkup = Catalog.GetString("Export the playlist to new video file"); newbutton.CanFocus = false; newvideobutton.CanFocus = false; Config.EventsBroker.PlaylistsChangedEvent += HandlePlaylistsChangedEvent; Config.EventsBroker.PlaylistElementSelectedEvent += HandlePlaylistElementSelectedEvent; hbox2.HeightRequest = StyleConf.PlayerCapturerControlsHeight; recimage.Pixbuf = Misc.LoadIcon("longomatch-control-record", StyleConf.PlayerCapturerIconSize); newimage.Pixbuf = Misc.LoadIcon("longomatch-playlist-new", StyleConf.PlayerCapturerIconSize); }
void UpdateMediaFile () { if (mediaFile == null) { Visible = false; return; } namelabel.Text = mediaFile.Name; if (mediaFile.FilePath == Constants.FAKE_PROJECT) { filelabel.Text = Catalog.GetString ("No video file associated yet for live project"); snapshotimage.Pixbuf = Misc.LoadIcon ("longomatch-video-device-fake", 80); table1.Visible = false; disableChanges = true; return; } table1.Visible = true; filelabel.Text = mediaFile.FilePath; if (mediaFile.Preview != null) { snapshotimage.Pixbuf = mediaFile.Preview.Value; } else { snapshotimage.Pixbuf = Misc.LoadIcon ("longomatch-video-file", 80); } if (mediaFile.Duration != null) { durationlabel.Text = String.Format ("{0}: {1}", Catalog.GetString ("Duration"), mediaFile.Duration.ToSecondsString ()); } else { durationlabel.Text = Catalog.GetString ("Missing duration info, reload this file."); } formatlabel.Text = String.Format ("{0}: {1}x{2}@{3}fps", Catalog.GetString ("Format"), mediaFile.VideoWidth, mediaFile.VideoHeight, mediaFile.Fps); videolabel.Text = String.Format ("{0}: {1}", Catalog.GetString ("Video codec"), mediaFile.VideoCodec); audiolabel.Text = String.Format ("{0}: {1}", Catalog.GetString ("Audio codec"), mediaFile.AudioCodec); containerlabel.Text = String.Format ("{0}: {1}", Catalog.GetString ("Container"), mediaFile.Container); offsetlabel.Markup = String.Format ("<span foreground=\"{0}\">{1}: {2}</span>", Config.Style.PaletteActive.ToRGBString (false), Catalog.GetString ("Offset"), mediaFile.Offset.ToMSecondsString ()); }
public VideoPreferencesPanel() { this.Build(); if (Config.FPS_N == 30) { fpscombobox.Active = 1; } else if (Config.FPS_N == 50) { fpscombobox.Active = 2; } else if (Config.FPS_N == 60) { fpscombobox.Active = 3; } else { fpscombobox.Active = 0; } fpscombobox.Changed += HandleFPSChanged; Misc.FillImageFormat(renderimagecombo, VideoStandards.Rendering, Config.RenderVideoStandard); Misc.FillEncodingFormat(renderenccombo, Config.RenderEncodingProfile); Misc.FillQuality(renderqualcombo, Config.RenderEncodingQuality); Misc.FillImageFormat(captureimagecombo, VideoStandards.Capture, Config.CaptureVideoStandard); Misc.FillEncodingFormat(captureenccombo, Config.CaptureEncodingProfile); Misc.FillQuality(capturequalcombo, Config.CaptureEncodingQuality); renderimagecombo.Changed += HandleImageChanged; captureimagecombo.Changed += HandleImageChanged; renderenccombo.Changed += HandleEncodingChanged; captureenccombo.Changed += HandleEncodingChanged; renderqualcombo.Changed += HandleQualityChanged; capturequalcombo.Changed += HandleQualityChanged; enableSound = new CheckButton(); rendertable.Attach(enableSound, 1, 2, 3, 4, AttachOptions.Fill, AttachOptions.Fill, 0, 0); enableSound.CanFocus = false; enableSound.Show(); enableSound.Active = Config.EnableAudio; enableSound.Toggled += (sender, e) => { Config.EnableAudio = enableSound.Active; }; overlayTitle = new CheckButton(); rendertable.Attach(overlayTitle, 1, 2, 4, 5, AttachOptions.Fill, AttachOptions.Fill, 0, 0); overlayTitle.CanFocus = false; overlayTitle.Show(); overlayTitle.Active = Config.OverlayTitle; overlayTitle.Toggled += (sender, e) => { Config.OverlayTitle = overlayTitle.Active; }; SizeGroup sgroup = new SizeGroup(SizeGroupMode.Horizontal); foreach (Widget w in capturetable) { if (w is Label) { sgroup.AddWidget(w); } } foreach (Widget w in rendertable) { if (w is Label) { sgroup.AddWidget(w); } } sgroup.AddWidget(fameratelabel); }