void FillFormats() { videoStandardList = Misc.FillImageFormat(imagecombobox, VideoStandards.Capture, App.Current.Config.CaptureVideoStandard); encProfileList = Misc.FillEncodingFormat(encodingcombobox, App.Current.Config.CaptureEncodingProfile); qualList = Misc.FillQuality(qualitycombobox, App.Current.Config.CaptureEncodingQuality); }
public VideoFileInfo() { this.Build(); eventbox3.ButtonPressEvent += HandleButtonPressEvent; HeightRequest = 100; snapshotimage.SetSize(100); filelabel.ModifyFg(StateType.Normal, Misc.ToGdkColor(App.Current.Style.PaletteText)); }
public EntryDialog(Window parent) { TransientFor = parent; this.Build(); // Configure window icon Icon = Misc.LoadIcon(App.Current.SoftwareIconName, IconSize.Dialog); ShowCount = false; setAvailableTemplatesVisible(false); }
void SetButtonColor(DrawingArea area, Color color) { Gdk.Color gcolor = Misc.ToGdkColor(color); area.ModifyBg(StateType.Normal, gcolor); area.ModifyBg(StateType.Active, gcolor); area.ModifyBg(StateType.Insensitive, gcolor); area.ModifyBg(StateType.Prelight, gcolor); area.ModifyBg(StateType.Selected, gcolor); }
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); }
public CalendarDialog(DateTime date) { this.Build(); Icon = Misc.LoadIcon(App.Current.SoftwareIconName, IconSize.Button, 0); SkipPagerHint = true; SkipTaskbarHint = true; //Decorated = false; Modal = true; calendar1.Date = date; }
void SetStyle() { FontDescription desc = FontDescription.FromString(App.Current.Style.Font + " 18"); infoeventbox.ModifyBg(StateType.Normal, Misc.ToGdkColor(App.Current.Style.ThemeBase)); infolabel.ModifyFg(StateType.Normal, Misc.ToGdkColor(App.Current.Style.TextBase)); infolabel.ModifyFont(desc); videoseventbox.ModifyBg(StateType.Normal, Misc.ToGdkColor(App.Current.Style.ThemeBase)); videoslabel.ModifyFg(StateType.Normal, Misc.ToGdkColor(App.Current.Style.TextBase)); videoslabel.ModifyFont(desc); }
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 { ShowEventTypeMenu(GetValueFromPath(paths [0]) as EventType, paths); } } 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)); } }
public VideoEditionProperties(Window parent) { TransientFor = parent; this.Build(); Icon = Misc.LoadIcon(App.Current.SoftwareIconName, IconSize.Button, 0); encSettings = new EncodingSettings(); stdStore = Misc.FillImageFormat(sizecombobox, VideoStandards.Rendering, App.Current.Config.RenderVideoStandard); encStore = Misc.FillEncodingFormat(formatcombobox, App.Current.Config.RenderEncodingProfile); qualStore = Misc.FillQuality(qualitycombobox, App.Current.Config.RenderEncodingQuality); descriptioncheckbutton.Active = App.Current.Config.OverlayTitle; audiocheckbutton.Active = App.Current.Config.EnableAudio; mediafilechooser1.FileChooserMode = FileChooserMode.File; mediafilechooser1.FilterName = "Multimedia Files"; mediafilechooser1.FilterExtensions = new string [] { "*.mkv", "*.mp4", "*.ogg", "*.avi", "*.mpg", "*.vob" }; mediafilechooser2.FileChooserMode = FileChooserMode.Directory; mediafilechooser2.ChangedEvent += (sender, e) => { OutputDir = mediafilechooser2.CurrentPath; }; watermarkSelector.ResetButtonHeight = RESET_BUTTON_HEIGHT; watermarkSelector.ImageButtonPressEvent += HandleChangeWatermarkClicked; watermarkSelector.ResetButton.Clicked += (sender, e) => ResetWatermark(); watermarkcheckbutton.Toggled += HandleWatermarkCheckToggled; if (App.Current.Config.Watermark != null) { SetWatermarkPreview(); } else { ResetWatermark(); } watermarkcheckbutton.Active = App.Current.Config.AddWatermark; if (App.Current.LicenseManager != null) { bool canRemoveWatermark = App.Current.LicenseLimitationsService.CanExecute(VASFeature.Watermark.ToString()); watermarkcheckbutton.Sensitive = canRemoveWatermark; if (!canRemoveWatermark) { watermarkcheckbutton.Active = true; watermarkLabel.Visible = watermarkSelector.Visible = false; if (App.Current.Config.Watermark != null) { ResetWatermark(); } } } ModifyBg(StateType.Normal, Misc.ToGdkColor(App.Current.Style.ThemeContrastDisabled)); containerRegular.ModifyBg(StateType.Normal, Misc.ToGdkColor(App.Current.Style.ThemeBase)); }
//FIXME: all the watermark behaviour is duplicated in VideoEditionProperties void HandleChangeWatermarkClicked(object o, ButtonPressEventArgs args) { var imageTuple = Misc.OpenImageAndFilename(this); string filename = imageTuple.Item1; Image image = imageTuple.Item2; if (image != null) { App.Current.Config.Watermark = image; App.Current.Config.WatermarkName = System.IO.Path.GetFileName(filename); SetWatermarkPreview(); } }
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); }
void SetStyle() { Pango.FontDescription numDesc = Pango.FontDescription.FromString(App.Current.Style.Font + " 48px"); Pango.FontDescription nameDesc = Pango.FontDescription.FromString(App.Current.Style.Font + " 30px"); homescoreeventbox.ModifyBg(StateType.Normal, Misc.ToGdkColor(App.Current.Style.PaletteBackgroundDark)); homescorelabel.ModifyFg(StateType.Normal, Misc.ToGdkColor(App.Current.Style.PaletteText)); homescorelabel.ModifyFont(numDesc); awayscoreeventbox.ModifyBg(StateType.Normal, Misc.ToGdkColor(App.Current.Style.PaletteBackgroundDark)); awayscorelabel.ModifyBg(StateType.Normal, Misc.ToGdkColor(App.Current.Style.PaletteText)); awayscorelabel.ModifyFont(numDesc); homenamelabel.ModifyFont(nameDesc); homenamelabel.ModifyFg(StateType.Normal, Misc.ToGdkColor(App.Current.Style.PaletteText)); awaynamelabel.ModifyFont(nameDesc); awaynamelabel.ModifyFg(StateType.Normal, Misc.ToGdkColor(App.Current.Style.PaletteText)); }
protected override bool OnButtonPressEvent(Gdk.EventButton evnt) { bool ret = true; pathClicked = null; TreeViewColumn column; int cellX, cellY; IViewModel vm = GetViewModelAtPosition((int)evnt.X, (int)evnt.Y, out column, out cellX, out cellY); if (vm != null && ProcessViewModelClicked(vm, cellX, cellY, column.Width, evnt.State)) { return(true); } TreePath [] paths = Selection.GetSelectedRows(); if (Misc.RightButtonClicked(evnt)) { // We don't want to unselect the play when several // plays are selected and we click the right button // For multiedition if (paths.Length <= 1) { ret = base.OnButtonPressEvent(evnt); paths = Selection.GetSelectedRows(); } ShowMenu(); } else { ret = base.OnButtonPressEvent(evnt); if (paths.Length > 0 && enableDragSource && AllowDrag(vm)) { dragging = true; dragStarted = false; dragStart = new Point(evnt.X, evnt.Y); } int modifier = App.Current.Keyboard.ParseModifier(evnt); if (modifier == 0) { GetPathAtPos((int)evnt.X, (int)evnt.Y, out pathClicked); } } return(ret); }
public void Fill(List <LMProject> projects) { Pixbuf image, homeShield, awayShield; swallowSignals = true; this.projects = projects; store.Clear(); selectedProjects.Clear(); foreach (LMProject p in projects) { ProjectDescription pdesc = p.Description; MediaFile file = pdesc.FileSet.FirstOrDefault(); if (file != null && file.IsFakeCapture) { image = Misc.LoadIcon("lm-video-device-fake", 50); } else if (pdesc.FileSet.Preview != null) { image = pdesc.FileSet.Preview.Scale(PREVIEW_SIZE, PREVIEW_SIZE).Value; } else { image = Misc.LoadIcon("lm-video-file", 50); } if (pdesc.LocalShield != null) { homeShield = pdesc.LocalShield.Scale(50, 50).Value; } else { homeShield = Misc.LoadIcon("vas-default-shield", 50); } if (pdesc.VisitorShield != null) { awayShield = pdesc.VisitorShield.Scale(50, 50).Value; } else { awayShield = Misc.LoadIcon("vas-default-shield", 50); } store.AppendValues(FormatDesc(pdesc), image, homeShield, awayShield, p, false); } swallowSignals = false; iconview.SelectPath(new TreePath("0")); treeview.SetCursor(new TreePath("0"), null, false); }
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 { ShowPlayerMenu(paths); } } else if (paths.Length > 1) { ShowMenu(); } } else { GetPathAtPos((int)evnt.X, (int)evnt.Y, out pathClicked); base.OnButtonPressEvent(evnt); } return(true); }
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 FilterTreeViewBase() { Selection.Mode = SelectionMode.None; HeadersVisible = false; EnableGridLines = TreeViewGridLines.Horizontal; SearchColumn = COL_DESCRIPTION; Model = store = new TreeStore(typeof(string), typeof(bool), typeof(object)); TreeViewColumn filterColumn = new TreeViewColumn(); CellRendererToggle filterCell = new CellRendererToggle(); filterCell.Width = Sizes.FilterTreeViewToogleWidth; filterCell.Toggled += HandleFilterCellToggled; filterColumn.PackStart(filterCell, false); filterColumn.AddAttribute(filterCell, "active", COL_ACTIVE); CellRendererText nameCell = new CellRendererText(); nameCell.FontDesc = FontDescription.FromString( String.Format("{0} {1} {2}px", App.Current.Style.Font, "semibold", Sizes.ListTextFontSize)); nameCell.Height = 32; filterColumn.PackStart(nameCell, true); filterColumn.AddAttribute(nameCell, "text", COL_DESCRIPTION); TreeViewColumn onlyColumn = new TreeViewColumn(); CellRendererButton onlyCell = new CellRendererButton(Catalog.GetString("Only")); onlyColumn.PackStart(onlyCell, false); onlyCell.Clicked += HandleOnlyClicked; AppendColumn(filterColumn); AppendColumn(onlyColumn); ModifyFg(StateType.Normal, Misc.ToGdkColor(App.Current.Style.ThemeContrastDisabled)); }
public void Initialize() { Show(); // Configure window icon Icon = Misc.LoadIcon(App.Current.SoftwareIconName, IconSize.Dialog); // Populate the menu items from pluggable tools List <ITool> tools = new List <ITool> (); App.Current.EventsBroker.Publish <QueryToolsEvent> ( new QueryToolsEvent { Tools = tools } ); Menu menu = (this.UIManager.GetWidget("/menubar1/ToolsAction") as MenuItem).Submenu as Menu; MenuItem before = this.UIManager.GetWidget("/menubar1/ToolsAction/DatabasesManagerAction") as MenuItem; int idx = 1; // Find position of the database manager foreach (Widget child in menu.Children) { if (child == before) { break; } idx++; } // Get the default action group ActionGroup ag = this.UIManager.ActionGroups [0]; uint mergeId; mergeId = this.UIManager.NewMergeId(); // Insert our tools foreach (ITool tool in tools) { if (tool.MenubarLabel != null) { // Use the class name as the action name to avoid collisions string actionName = tool.ToString().Substring(tool.ToString().LastIndexOf('.') + 1) + "Action"; Gtk.Action itemAction = new Gtk.Action(actionName, tool.MenubarLabel, null, null); itemAction.Sensitive = true; itemAction.ShortLabel = tool.MenubarLabel; itemAction.Activated += async(sender, e) => { await App.Current.StateController.MoveTo(tool.UIFlow.First().Key, null); }; this.UIManager.AddUi(mergeId, "/menubar1/ToolsAction", actionName, actionName, UIManagerItemType.Menuitem, false); ag.Add(itemAction, tool.MenubarAccelerator); // Ugly hack, given that we cannot add a menu item at a specific position // we remove it and finally add it back again. MenuItem item = (this.UIManager.GetWidget("/menubar1/ToolsAction/" + actionName) as MenuItem); menu.Remove(item); menu.Insert(item, idx++); } } this.UIManager.EnsureUpdate(); renderingstatebarview1.SetViewModel(App.Current.JobsManager); ConnectSignals(); FileMenuEntry = new MenuExtensionEntry("/menubar1/FileAction", 3); ToolMenuEntry = new MenuExtensionEntry("/menubar1/ToolsAction", 6); }
public VideoPlayerView() { this.Build(); // The editor keeps changing that value to false. var panedChild = ((Paned.PanedChild)(this.videohpaned [this.videobox])); panedChild.Resize = true; timerulearea.HeightRequest = DConstants.TIMERULE_PLAYER_HEIGHT; timerule = new Timerule(new WidgetWrapper(timerulearea)) { PlayerMode = true, ContinuousSeek = true, AutoUpdate = true, AdjustSizeToDuration = true, }; editeventtimeruledrawingarea.HeightRequest = DConstants.TIMERULE_PLAYER_HEIGHT; eventEditionTimerule = new EventEditionTimeruleView(new WidgetWrapper(editeventtimeruledrawingarea)); rateLabel.ModifyFont(FontDescription.FromString(App.Current.Style.Font + " 8px")); jumpsLabel.ModifyFont(FontDescription.FromString(App.Current.Style.Font + " 8px")); zoomLabel.ModifyFont(FontDescription.FromString(App.Current.Style.Font + " 8px")); CreateTimeText(); eventNameLabel.Ellipsize = EllipsizeMode.End; centerplayheadbuttonimage.Image = App.Current.ResourcesLocator.LoadIcon("vas-dash-center-view", Sizes.PlayerCapturerIconSize); DurationButtonImage.Image = App.Current.ResourcesLocator.LoadIcon("vas-control-duration", 15); // Force tooltips to be translatable as there seems to be a bug in stetic // code generation for translatable tooltips. centerplayheadbutton.TooltipMarkup = Catalog.GetString("Center Playhead"); volumeWindow = new SliderView(0, 101, 1, 1); volumeWindow.FormatValue = (double val) => { return(val + "%"); }; jumpsWindow = new SliderView(0, App.Current.StepList.Count, 1, 1); jumpsWindow.FormatValue = (double val) => { return(App.Current.StepList [(int)val] + "s"); }; zoomWindow = new SliderView(0, App.Current.ZoomLevels.Count, 1, 1); zoomWindow.FormatValue = (double val) => { return((App.Current.ZoomLevels [(int)val] * 100) + "%"); }; rateWindow = new SliderView(0, App.Current.RateList.Count, 1, 1); rateWindow.FormatValue = (double val) => { return(App.Current.RateList [(int)val] + "X"); }; blackboard = new Blackboard(new WidgetWrapper(blackboarddrawingarea)); blackboarddrawingarea.Visible = false; blackboarddrawingarea.NoShowAll = true; ConnectSignals(); totalbox.NoShowAll = true; Misc.SetFocus(totalbox, false); mainviewport.CanFocus = true; maineventbox.ModifyBg(StateType.Normal, Misc.ToGdkColor(App.Current.Style.ScreenBase)); controlsbox.HeightRequest = Sizes.PlayerCapturerControlsHeight; cameraConfigsOutOfScreen = new List <CameraConfig> (); CreateWindows(); Bind(); }
public VideoPreferencesPanel() { this.Build(); if (App.Current.Config.FPS_N == 30) { fpscombobox.Active = 1; } else if (App.Current.Config.FPS_N == 50) { fpscombobox.Active = 2; } else if (App.Current.Config.FPS_N == 60) { fpscombobox.Active = 3; } else { fpscombobox.Active = 0; } fpscombobox.Changed += HandleFPSChanged; Misc.FillImageFormat(renderimagecombo, VideoStandards.Rendering, App.Current.Config.RenderVideoStandard); Misc.FillEncodingFormat(renderenccombo, App.Current.Config.RenderEncodingProfile); Misc.FillQuality(renderqualcombo, App.Current.Config.RenderEncodingQuality); Misc.FillImageFormat(captureimagecombo, VideoStandards.Capture, App.Current.Config.CaptureVideoStandard); Misc.FillEncodingFormat(captureenccombo, App.Current.Config.CaptureEncodingProfile); Misc.FillQuality(capturequalcombo, App.Current.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 = App.Current.Config.EnableAudio; enableSound.Toggled += (sender, e) => { App.Current.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 = App.Current.Config.OverlayTitle; overlayTitle.Toggled += (sender, e) => { App.Current.Config.OverlayTitle = overlayTitle.Active; }; addWatermark = new CheckButton(); rendertable.Attach(addWatermark, 1, 2, 5, 6, AttachOptions.Fill, AttachOptions.Fill, 0, 0); addWatermark.CanFocus = false; addWatermark.Show(); addWatermark.Active = App.Current.Config.AddWatermark; addWatermark.Toggled += (sender, e) => { App.Current.Config.AddWatermark = addWatermark.Active; }; SizeGroup sgroup = new SizeGroup(SizeGroupMode.Horizontal); SizeGroup sgroup2 = new SizeGroup(SizeGroupMode.Horizontal); foreach (Widget w in generaltable) { if (w is Label) { sgroup.AddWidget(w); } else { sgroup2.AddWidget(w); } } foreach (Widget w in capturetable) { if (w is Label) { sgroup.AddWidget(w); } else { sgroup2.AddWidget(w); } } foreach (Widget w in rendertable) { if (w is Label) { sgroup.AddWidget(w); } else { sgroup2.AddWidget(w); } } }
public ChooseOptionDialog(Window parent) { TransientFor = parent; this.Build(); Icon = Misc.LoadIcon(App.Current.SoftwareIconName, IconSize.Button, 0); }
public VideoPreferencesPanel() { this.Build(); if (App.Current.Config.FPS_N == 30) { fpscombobox.Active = 1; } else if (App.Current.Config.FPS_N == 50) { fpscombobox.Active = 2; } else if (App.Current.Config.FPS_N == 60) { fpscombobox.Active = 3; } else { fpscombobox.Active = 0; } fpscombobox.Changed += HandleFPSChanged; Misc.FillImageFormat(renderimagecombo, VideoStandards.Rendering, App.Current.Config.RenderVideoStandard); Misc.FillEncodingFormat(renderenccombo, App.Current.Config.RenderEncodingProfile); Misc.FillQuality(renderqualcombo, App.Current.Config.RenderEncodingQuality); Misc.FillImageFormat(captureimagecombo, VideoStandards.Capture, App.Current.Config.CaptureVideoStandard); Misc.FillEncodingFormat(captureenccombo, App.Current.Config.CaptureEncodingProfile); Misc.FillQuality(capturequalcombo, App.Current.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 = App.Current.Config.EnableAudio; enableSound.Toggled += (sender, e) => { App.Current.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 = App.Current.Config.OverlayTitle; overlayTitle.Toggled += (sender, e) => { App.Current.Config.OverlayTitle = overlayTitle.Active; }; addWatermark = new CheckButton(); rendertable.Attach(addWatermark, 1, 2, 5, 6, AttachOptions.Fill, AttachOptions.Fill, 0, 0); addWatermark.CanFocus = false; addWatermark.Show(); watermarkSelector.ResetButtonHeight = RESET_BUTTON_HEIGHT; watermarkSelector.ImageButtonPressEvent += HandleChangeWatermarkClicked; watermarkSelector.ResetButton.Clicked += (sender, e) => ResetWatermark(); if (App.Current.Config.Watermark != null) { SetWatermarkPreview(); } else { ResetWatermark(); } if (App.Current.LicenseManager != null) { bool canRemoveWatermark = App.Current.LicenseLimitationsService.CanExecute(VASFeature.Watermark.ToString()); addWatermark.Sensitive = canRemoveWatermark; if (!canRemoveWatermark) { addWatermark.Active = true; watermarkLabel.Visible = watermarkSelector.Visible = false; } else { addWatermark.Active = App.Current.Config.AddWatermark; watermarkLabel.Visible = watermarkSelector.Visible = addWatermark.Active; } } addWatermark.Toggled += (sender, e) => { App.Current.Config.AddWatermark = addWatermark.Active; watermarkLabel.Visible = watermarkSelector.Visible = addWatermark.Active; }; SizeGroup sgroup = new SizeGroup(SizeGroupMode.Horizontal); SizeGroup sgroup2 = new SizeGroup(SizeGroupMode.Horizontal); foreach (Widget w in generaltable) { if (w is Label) { sgroup.AddWidget(w); } else { sgroup2.AddWidget(w); } } foreach (Widget w in capturetable) { if (w is Label) { sgroup.AddWidget(w); } else { sgroup2.AddWidget(w); } } foreach (Widget w in rendertable) { if (w is Label) { sgroup.AddWidget(w); } else { sgroup2.AddWidget(w); } } }