static void OnProjectReloaded(object sender, EventArgs a) { if (WidgetNotebook.Page == -1) { return; } // Get the opened components int active = WidgetNotebook.Page; ArrayList pages = new ArrayList(); while (WidgetNotebook.NPages > 0) { DesignerView view = (DesignerView)WidgetNotebook.GetNthPage(0); pages.Add(view.Component.Name); WidgetNotebook.Remove(view); view.Dispose(); } openWindows.Clear(); // Reopen the components foreach (string s in pages) { WidgetInfo w = Project.GetWidget(s); if (w != null) { OpenWindow(w); } } WidgetNotebook.Page = active; }
static void OnPageChanged(object s, EventArgs a) { if (WidgetNotebook != null) { DesignerView view = WidgetNotebook.CurrentPageWidget as DesignerView; if (view != null) { ProjectView.Selection = view.ProjectItem; SteticApp.ActiveDesigner = view.Designer; } } if (CurrentDesignerChanged != null) { CurrentDesignerChanged(null, a); } }
static void OpenWindow(ProjectItemInfo item) { Gtk.Widget page = (Gtk.Widget)openWindows [item]; if (page != null) { page.Show(); WidgetNotebook.Page = WidgetNotebook.PageNum(page); } else { DesignerView view = new DesignerView(Project, item); // Tab label HBox tabLabel = new HBox(); tabLabel.PackStart(new Gtk.Image(item.Component.Type.Icon), true, true, 0); tabLabel.PackStart(new Label(item.Name), true, true, 3); Button b = new Button(new Gtk.Image("gtk-close", IconSize.Menu)); b.Relief = Gtk.ReliefStyle.None; b.WidthRequest = b.HeightRequest = 24; b.Clicked += delegate(object s, EventArgs a) { view.Hide(); WidgetNotebook.QueueResize(); }; tabLabel.PackStart(b, false, false, 0); tabLabel.ShowAll(); // Notebook page int p = WidgetNotebook.AppendPage(view, tabLabel); view.ShowAll(); openWindows [item] = view; WidgetNotebook.Page = p; } }
static void OpenWindow(ProjectItemInfo item) { Gtk.Widget page = (Gtk.Widget) openWindows [item]; if (page != null) { page.Show (); WidgetNotebook.Page = WidgetNotebook.PageNum (page); } else { DesignerView view = new DesignerView (Project, item); // Tab label HBox tabLabel = new HBox (); tabLabel.PackStart (new Gtk.Image (item.Component.Type.Icon), true, true, 0); tabLabel.PackStart (new Label (item.Name), true, true, 3); Button b = new Button (new Gtk.Image ("gtk-close", IconSize.Menu)); b.Relief = Gtk.ReliefStyle.None; b.WidthRequest = b.HeightRequest = 24; b.Clicked += delegate (object s, EventArgs a) { view.Hide (); WidgetNotebook.QueueResize (); }; tabLabel.PackStart (b, false, false, 0); tabLabel.ShowAll (); // Notebook page int p = WidgetNotebook.AppendPage (view, tabLabel); view.ShowAll (); openWindows [item] = view; WidgetNotebook.Page = p; } }
public static UndoQueue GetUndoQueue() { DesignerView view = (DesignerView)WidgetNotebook.CurrentPageWidget; return(view.UndoQueue); }