public void Dispose() { sourceProject.ComponentTypesChanged -= OnSourceProjectLibsChanged; sourceProject.ProjectReloaded -= OnSourceProjectReloaded; gproject.ModifiedChanged -= new EventHandler(OnModifiedChanged); gproject.Changed -= new EventHandler(OnChanged); gproject.ProjectReloaded -= OnProjectReloaded; gproject.ProjectReloading -= OnProjectReloading; // gproject.WidgetMemberNameChanged -= new Stetic.Wrapper.WidgetNameChangedHandler (OnWidgetNameChanged); if (!autoCommitChanges) { // Don't dispose the project here! it will be disposed by the frontend if (widget != null) { widget.SelectionChanged -= OnSelectionChanged; // Don't dispose the widget. It will be disposed when destroyed together // with the container widget = null; } } if (plug != null) { plug.Destroy(); } gproject = null; rootWidget = null; frontend = null; System.Runtime.Remoting.RemotingServices.Disconnect(this); disposed = true; }
void OnProjectReloaded(object s, EventArgs a) { Gtk.Widget topWidget = project.GetWidget(sourceWidget); if (topWidget != null) { rootWidget = Stetic.Wrapper.Container.Lookup(topWidget); undoManager.RootObject = rootWidget; if (rootWidget != null) { Gtk.Widget oldWidget = designer; if (widget != null) { widget.SelectionChanged -= OnSelectionChanged; widget = null; } OnRootWidgetChanged(); if (oldWidget != null) { // Delay the destruction of the old widget, so the designer has time to // show the new widget. This avoids flickering. GLib.Timeout.Add(500, delegate { oldWidget.Destroy(); return(false); }); } project.NotifyComponentTypesChanged(); return; } } SetErrorMode(); }
void SetErrorMode() { Gtk.Label lab = new Gtk.Label(); lab.Markup = "<b>" + Catalog.GetString("The form designer could not be loaded") + "</b>"; Gtk.EventBox box = new Gtk.EventBox(); box.Add(lab); widget = Stetic.UserInterface.CreateWidgetDesigner(box, 100, 100); rootWidget = null; OnRootWidgetChanged(); }
void OnProjectReloaded(object s, EventArgs a) { // Update the actions group list if (!autoCommitChanges) { gproject.AttachActionGroups(sourceProject.ActionGroups); gproject.WidgetLibraries = (ArrayList)sourceProject.WidgetLibraries.Clone(); gproject.InternalWidgetLibraries = (ArrayList)sourceProject.InternalWidgetLibraries.Clone(); } Gtk.Widget[] tops = gproject.Toplevels; if (tops.Length > 0) { rootWidget = Stetic.Wrapper.Container.Lookup(tops[0]); undoManager.RootObject = rootWidget; if (rootWidget != null) { Gtk.Widget oldWidget = designer; if (widget != null) { widget.SelectionChanged -= OnSelectionChanged; widget = null; } OnRootWidgetChanged(); if (oldWidget != null) { // Delay the destruction of the old widget, so the designer has time to // show the new widget. This avoids flickering. GLib.Timeout.Add(500, delegate { oldWidget.Destroy(); return(false); }); } gproject.NotifyComponentTypesChanged(); return; } } SetErrorMode(); }
void SetErrorMode () { Gtk.Label lab = new Gtk.Label (); lab.Markup = "<b>" + Catalog.GetString ("The form designer could not be loaded") + "</b>"; Gtk.EventBox box = new Gtk.EventBox (); box.Add (lab); widget = Stetic.UserInterface.CreateWidgetDesigner (box, 100, 100); rootWidget = null; OnRootWidgetChanged (); }
void OnProjectReloaded (object s, EventArgs a) { // Update the actions group list if (!autoCommitChanges) { gproject.AttachActionGroups (sourceProject.ActionGroups); gproject.WidgetLibraries = (ArrayList) sourceProject.WidgetLibraries.Clone (); gproject.InternalWidgetLibraries = (ArrayList) sourceProject.InternalWidgetLibraries.Clone (); } Gtk.Widget[] tops = gproject.Toplevels; if (tops.Length > 0) { rootWidget = Stetic.Wrapper.Container.Lookup (tops[0]); undoManager.RootObject = rootWidget; if (rootWidget != null) { Gtk.Widget oldWidget = designer; if (widget != null) { widget.SelectionChanged -= OnSelectionChanged; widget = null; } OnRootWidgetChanged (); if (oldWidget != null) { // Delay the destruction of the old widget, so the designer has time to // show the new widget. This avoids flickering. GLib.Timeout.Add (500, delegate { oldWidget.Destroy (); return false; }); } gproject.NotifyComponentTypesChanged (); return; } } SetErrorMode (); }
public void Dispose () { sourceProject.ComponentTypesChanged -= OnSourceProjectLibsChanged; sourceProject.ProjectReloaded -= OnSourceProjectReloaded; gproject.ModifiedChanged -= new EventHandler (OnModifiedChanged); gproject.Changed -= new EventHandler (OnChanged); gproject.ProjectReloaded -= OnProjectReloaded; gproject.ProjectReloading -= OnProjectReloading; // gproject.WidgetMemberNameChanged -= new Stetic.Wrapper.WidgetNameChangedHandler (OnWidgetNameChanged); if (!autoCommitChanges) { // Don't dispose the project here! it will be disposed by the frontend if (widget != null) { widget.SelectionChanged -= OnSelectionChanged; // Don't dispose the widget. It will be disposed when destroyed together // with the container widget = null; } } if (plug != null) plug.Destroy (); gproject = null; rootWidget = null; frontend = null; System.Runtime.Remoting.RemotingServices.Disconnect (this); disposed = true; }
void OnProjectReloaded (object s, EventArgs a) { Gtk.Widget topWidget = project.GetWidget (sourceWidget); if (topWidget != null) { rootWidget = Stetic.Wrapper.Container.Lookup (topWidget); undoManager.RootObject = rootWidget; if (rootWidget != null) { Gtk.Widget oldWidget = designer; if (widget != null) { widget.SelectionChanged -= OnSelectionChanged; widget = null; } OnRootWidgetChanged (); if (oldWidget != null) { // Delay the destruction of the old widget, so the designer has time to // show the new widget. This avoids flickering. GLib.Timeout.Add (500, delegate { oldWidget.Destroy (); return false; }); } project.NotifyComponentTypesChanged (); return; } } SetErrorMode (); }