void RegisterWindow(Stetic.WidgetInfo widget, bool notify) { if (formInfos != null) { foreach (GuiBuilderWindow w in formInfos) { if (w.RootWidget == widget) { return; } } GuiBuilderWindow win = new GuiBuilderWindow(this, gproject, widget); formInfos.Add(win); if (notify) { if (WindowAdded != null) { WindowAdded(this, new WindowEventArgs(win)); } NotifyChanged(); } } }
void ISupportsProjectReload.Update(Project project) { if (gproject != null && gproject.Project == project) { return; } if (designer != null) { designerStatus = designer.SaveStatus(); } CloseDesigner(); CloseProject(); if (project != null) { GuiBuilderWindow w = GuiBuilderDisplayBinding.GetWindow(this.ContentName); if (w != null) { AttachWindow(w); if (designerStatus != null) { designer.LoadStatus(designerStatus); } designerStatus = null; } } }
void LoadDesigner() { this.window = gproject.GetWindow(rootName); if (window == null) { // The window doesn't exist anymore return; } gproject.Unloaded += OnDisposeProject; designer = gproject.SteticProject.CreateWidgetDesigner(window.RootWidget, false); // Designer page designerPage.ClearChild(); designerPage.Add(designer); if (designer.RootComponent == null) { // Something went wrong while creating the designer. Show it, but don't do aything else. designer.ShowAll(); return; } /* * designer.AllowWidgetBinding = !gproject.Project.UsePartialTypes; * * codeBinder = new CodeBinder (gproject.Project, new OpenDocumentFileProvider (), designer.RootComponent); */ designer.BindField += OnBindWidgetField; designer.ModifiedChanged += OnWindowModifiedChanged; designer.SignalAdded += OnSignalAdded; designer.SignalRemoved += OnSignalRemoved; designer.SignalChanged += OnSignalChanged; designer.ComponentNameChanged += OnComponentNameChanged; designer.RootComponentChanged += OnRootComponentChanged; designer.ComponentTypesChanged += OnComponentTypesChanged; designer.ImportFileCallback = ImportFile; // Actions designer actionsBox = designer.CreateActionGroupDesigner(); //actionsBox.AllowActionBinding = !gproject.Project.UsePartialTypes; actionsBox.BindField += new EventHandler(OnBindActionField); actionsBox.ModifiedChanged += new EventHandler(OnActionshanged); /* * actionsPage.ClearChild (); * actionsPage.PackStart (actionsBox, true, true, 0); * actionsPage.ShowAll (); * * if (actionsBox.HasData) { * if (!HasPage (actionsPage)) * AddButton (GettextCatalog.GetString ("Actions"), actionsPage); * } else { * RemoveButton (actionsPage); * } */ designer.ShowAll(); //GuiBuilderService.SteticApp.ActiveDesigner = designer; }
void AttachWindow(GuiBuilderWindow window) { gproject = window.Project; GtkDesignInfo info = GtkDesignInfo.FromProject(gproject.Project); /*gproject.SteticProject.ImagesRootPath = FileService.AbsoluteToRelativePath (info.GtkGuiFolder, gproject.Project.BaseDirectory); * gproject.UpdateLibraries (); */LoadDesigner(); }
public GuiBuilderView(IViewContent content, GuiBuilderWindow window) : base(content) { rootName = window.Name; designerPage = new DesignerPage(window.Project); designerPage.Show(); AddButton(GettextCatalog.GetString("Designer"), designerPage); /* * actionsPage = new ActionGroupPage (); * actionsPage.Show (); */ AttachWindow(window); }
void UnregisterWindow(GuiBuilderWindow win) { if (!formInfos.Contains(win)) { return; } formInfos.Remove(win); if (WindowRemoved != null) { WindowRemoved(this, new WindowEventArgs(win)); } win.Dispose(); NotifyChanged(); }
public WindowEventArgs(GuiBuilderWindow win) { this.win = win; }
public void Remove(GuiBuilderWindow win) { gproject.RemoveComponent(win.RootWidget); UnregisterWindow(win); }