public void AddTab(Gtk.Widget page, Gdk.Pixbuf icon, string label) { Tab tab = new Tab(); tab.SetLabel(page, icon, label); tab.ShowAll(); box.PackStart(tab, true, true, 0); if (currentTab == -1) { CurrentTab = box.Children.Length - 1; } else { tab.Active = false; page.Hide(); } tab.ButtonPressEvent += OnTabPress; }
public StatusArea() { theme = new StatusAreaTheme(); renderArg = new RenderArg(); mainContext = new MainStatusBarContextImpl(this); activeContext = mainContext; contexts.Add(mainContext); VisibleWindow = false; NoShowAll = true; WidgetFlags |= Gtk.WidgetFlags.AppPaintable; statusIconBox.BorderWidth = 0; statusIconBox.Spacing = 3; Action <bool> animateProgressBar = showing => this.Animate("ProgressBarFade", val => renderArg.ProgressBarAlpha = val, renderArg.ProgressBarAlpha, showing ? 1.0f : 0.0f, easing: Easing.CubicInOut); ProgressBegin += delegate { renderArg.ShowProgressBar = true; // StartBuildAnimation (); renderArg.ProgressBarFraction = 0; QueueDraw(); animateProgressBar(true); }; ProgressEnd += delegate { renderArg.ShowProgressBar = false; // StopBuildAnimation (); QueueDraw(); animateProgressBar(false); }; ProgressFraction += delegate(object sender, FractionEventArgs e) { renderArg.ProgressBarFraction = (float)e.Work; QueueDraw(); }; contentBox.PackStart(messageBox, true, true, 0); contentBox.PackEnd(statusIconBox, false, false, 0); contentBox.PackEnd(statusIconSeparator = new StatusAreaSeparator(), false, false, 0); contentBox.PackEnd(buildResultWidget = CreateBuildResultsWidget(Orientation.Horizontal), false, false, 0); HasTooltip = true; QueryTooltip += messageBoxToolTip; mainAlign = new Alignment(0, 0.5f, 1, 0); mainAlign.LeftPadding = 12; mainAlign.RightPadding = 8; mainAlign.Add(contentBox); Add(mainAlign); mainAlign.ShowAll(); statusIconBox.Hide(); statusIconSeparator.Hide(); buildResultWidget.Hide(); Show(); this.ButtonPressEvent += delegate { if (sourcePad != null) { sourcePad.BringToFront(true); } }; statusIconBox.Shown += delegate { UpdateSeparators(); }; statusIconBox.Hidden += delegate { UpdateSeparators(); }; messageQueue = new Queue <Message> (); tracker = new MouseTracker(this); tracker.MouseMoved += (sender, e) => QueueDraw(); tracker.HoveredChanged += (sender, e) => { this.Animate("Hovered", x => renderArg.HoverProgress = x, renderArg.HoverProgress, tracker.Hovered ? 1.0f : 0.0f, easing: Easing.SinInOut); }; IdeApp.FocusIn += delegate { // If there was an error while the application didn't have the focus, // trigger the error animation again when it gains the focus if (errorAnimPending) { errorAnimPending = false; TriggerErrorAnimation(); } }; }
public TestResultsPad () { testService.TestSuiteChanged += new EventHandler (OnTestSuiteChanged); panel = new VBox (); // Results notebook book = new HPaned (); panel.PackStart (book, true, true, 0); panel.FocusChain = new Gtk.Widget [] { book }; // Failures tree failuresTreeView = new MonoDevelop.Ide.Gui.Components.PadTreeView (); failuresTreeView.HeadersVisible = false; failuresStore = new TreeStore (typeof(Xwt.Drawing.Image), typeof(string), typeof(object), typeof(string), typeof(int)); var pr = new CellRendererImage (); CellRendererText tr = new CellRendererText (); TreeViewColumn col = new TreeViewColumn (); col.PackStart (pr, false); col.AddAttribute (pr, "image", 0); col.PackStart (tr, false); col.AddAttribute (tr, "markup", 1); failuresTreeView.AppendColumn (col); failuresTreeView.Model = failuresStore; var sw = new MonoDevelop.Components.CompactScrolledWindow (); sw.ShadowType = ShadowType.None; sw.Add (failuresTreeView); book.Pack1 (sw, true, true); outputView = new MonoDevelop.Ide.Gui.Components.LogView.LogTextView (); outputView.Editable = false; bold = new TextTag ("bold"); bold.Weight = Pango.Weight.Bold; outputView.Buffer.TagTable.Add (bold); sw = new MonoDevelop.Components.CompactScrolledWindow (); sw.ShadowType = ShadowType.None; sw.Add (outputView); book.Pack2 (sw, true, true); outputViewScrolled = sw; failuresTreeView.RowActivated += OnRowActivated; failuresTreeView.Selection.Changed += OnRowSelected; failuresTreeView.DoPopupMenu = delegate (EventButton evt) { IdeApp.CommandService.ShowContextMenu (failuresTreeView, evt, "/MonoDevelop/NUnit/ContextMenu/TestResultsPad"); }; Control.ShowAll (); outputViewScrolled.Hide (); }
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 (); }
private void HandleDragLeave(object o, EventArgs args) { preview = false; preview_widget.Hide(); }
public TestResultsPad () { testService.TestSuiteChanged += new EventHandler (OnTestSuiteChanged); panel = new VBox (); // Results notebook book = new HPaned (); panel.PackStart (book, true, true, 0); panel.FocusChain = new Gtk.Widget [] { book }; // Failures tree failuresTreeView = new TreeView (); failuresTreeView.HeadersVisible = false; failuresStore = new TreeStore (typeof(Pixbuf), typeof (string), typeof(object), typeof(string)); var 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; var sw = new MonoDevelop.Components.CompactScrolledWindow (); sw.ShadowType = ShadowType.None; sw.Add(failuresTreeView); book.Pack1 (sw, true, true); outputView = new TextView(); outputView.Editable = false; bold = new TextTag ("bold"); bold.Weight = Pango.Weight.Bold; outputView.Buffer.TagTable.Add (bold); sw = new MonoDevelop.Components.CompactScrolledWindow (); sw.ShadowType = ShadowType.None; sw.Add(outputView); book.Pack2 (sw, true, true); outputViewScrolled = sw; failuresTreeView.ButtonReleaseEvent += new Gtk.ButtonReleaseEventHandler (OnPopupMenu); failuresTreeView.RowActivated += OnRowActivated; failuresTreeView.Selection.Changed += OnRowSelected; Control.ShowAll (); outputViewScrolled.Hide (); }
public TestResultsPad () { UnitTestService.TestSuiteChanged += new EventHandler (OnTestSuiteChanged); IdeApp.Workspace.WorkspaceItemClosed += OnWorkspaceItemClosed; panel = new VBox { Name = "testResultBox" }; // Results notebook book = new HPaned (); panel.PackStart (book, true, true, 0); panel.FocusChain = new Gtk.Widget [] { book }; // Failures tree failuresTreeView = new MonoDevelop.Ide.Gui.Components.PadTreeView { Name = "testResultsTree" }; failuresTreeView.HeadersVisible = false; failuresStore = new TreeStore (typeof(Xwt.Drawing.Image), typeof(string), typeof(object), typeof(string), typeof(int), typeof(int)); SemanticModelAttribute modelAttr = new SemanticModelAttribute ("store__Image", "store__Message","store__RootTest", "store__FileName", "store__FileNumber", "store__ErrorOrStackTrace"); TypeDescriptor.AddAttributes (failuresStore, modelAttr); var pr = new CellRendererImage (); CellRendererText tr = new CellRendererText (); TreeViewColumn col = new TreeViewColumn (); col.PackStart (pr, false); col.AddAttribute (pr, "image", 0); col.PackStart (tr, false); col.AddAttribute (tr, "markup", 1); failuresTreeView.AppendColumn (col); failuresTreeView.Model = failuresStore; var sw = new MonoDevelop.Components.CompactScrolledWindow (); sw.ShadowType = ShadowType.None; sw.Add (failuresTreeView); book.Pack1 (sw, true, true); outputView = new MonoDevelop.Ide.Gui.Components.LogView.LogTextView { Name = "testResultOutput" }; outputView.ModifyFont (FontService.MonospaceFont); outputView.Editable = false; bold = new TextTag ("bold"); bold.Weight = Pango.Weight.Bold; outputView.Buffer.TagTable.Add (bold); sw = new MonoDevelop.Components.CompactScrolledWindow (); sw.ShadowType = ShadowType.None; sw.Add (outputView); book.Pack2 (sw, true, true); outputViewScrolled = sw; failuresTreeView.RowActivated += OnRowActivated; failuresTreeView.Selection.Changed += OnRowSelected; failuresTreeView.DoPopupMenu = delegate (EventButton evt) { IdeApp.CommandService.ShowContextMenu (failuresTreeView, evt, "/MonoDevelop/UnitTesting/ContextMenu/TestResultsPad"); }; panel.ShowAll (); outputViewScrolled.Hide (); }
public StatusArea() { theme = new StatusAreaTheme (); renderArg = new RenderArg (); mainContext = new MainStatusBarContextImpl (this); activeContext = mainContext; contexts.Add (mainContext); VisibleWindow = false; NoShowAll = true; WidgetFlags |= Gtk.WidgetFlags.AppPaintable; statusIconBox.BorderWidth = 0; statusIconBox.Spacing = 3; Action<bool> animateProgressBar = showing => this.Animate ("ProgressBarFade", val => renderArg.ProgressBarAlpha = val, renderArg.ProgressBarAlpha, showing ? 1.0f : 0.0f, easing: Easing.CubicInOut); ProgressBegin += delegate { renderArg.ShowProgressBar = true; // StartBuildAnimation (); renderArg.ProgressBarFraction = 0; QueueDraw (); animateProgressBar (true); }; ProgressEnd += delegate { renderArg.ShowProgressBar = false; // StopBuildAnimation (); QueueDraw (); animateProgressBar (false); }; ProgressFraction += delegate(object sender, FractionEventArgs e) { renderArg.ProgressBarFraction = (float)e.Work; QueueDraw (); }; contentBox.PackStart (messageBox, true, true, 0); contentBox.PackEnd (statusIconBox, false, false, 0); contentBox.PackEnd (statusIconSeparator = new StatusAreaSeparator (), false, false, 0); contentBox.PackEnd (buildResultWidget = CreateBuildResultsWidget (Orientation.Horizontal), false, false, 0); HasTooltip = true; QueryTooltip += messageBoxToolTip; mainAlign = new Alignment (0, 0.5f, 1, 0); mainAlign.LeftPadding = 12; mainAlign.RightPadding = 8; mainAlign.Add (contentBox); Add (mainAlign); mainAlign.ShowAll (); statusIconBox.Hide (); statusIconSeparator.Hide (); buildResultWidget.Hide (); Show (); this.ButtonPressEvent += delegate { if (sourcePad != null) sourcePad.BringToFront (true); }; statusIconBox.Shown += delegate { UpdateSeparators (); }; statusIconBox.Hidden += delegate { UpdateSeparators (); }; messageQueue = new Queue<Message> (); tracker = new MouseTracker(this); tracker.MouseMoved += (sender, e) => QueueDraw (); tracker.HoveredChanged += (sender, e) => { this.Animate ("Hovered", x => renderArg.HoverProgress = x, renderArg.HoverProgress, tracker.Hovered ? 1.0f : 0.0f, easing: Easing.SinInOut); }; IdeApp.FocusIn += delegate { // If there was an error while the application didn't have the focus, // trigger the error animation again when it gains the focus if (errorAnimPending) { errorAnimPending = false; TriggerErrorAnimation (); } }; }
void UpdateChestData() { Chest chest = ActiveRoom.Chest; if (chest != null) { ValueReferenceGroup vrg = ActiveRoom.Chest.ValueReferenceGroup; if (chestVre == null) { chestVre = new ValueReferenceEditor(Project, vrg); chestVreHolder.Add(chestVre); } else { chestVre.ReplaceValueReferenceGroup(vrg); } TreasureObject treasure = chest.Treasure; if (treasure == null) { nonExistentTreasureHolder.ShowAll(); treasureVreHolder.Hide(); if (chest.TreasureID >= Project.NumTreasures) { treasureDataFrame.Hide(); } else { treasureDataFrame.Show(); } } else { nonExistentTreasureHolder.Hide(); treasureDataFrame.Show(); treasureVreHolder.Show(); if (treasureVre == null) { treasureVre = new ValueReferenceEditor(Project, treasure.ValueReferenceGroup); treasureVreHolder.Add(treasureVre); } else { treasureVre.ReplaceValueReferenceGroup(treasure.ValueReferenceGroup); } } treasureDataLabel.Text = string.Format("Treasure ${0:X2} Subid ${1:X2} Data", vrg.GetIntValue("ID"), vrg.GetIntValue("SubID")); } if (chest == null) { chestEditorBox.Hide(); treasureDataFrame.Hide(); chestAddHolder.ShowAll(); } else { chestEditorBox.ShowAll(); chestAddHolder.Hide(); } chestEventWrapper.ReplaceEventSource(chest); }