public SdiWorkspaceWindow(DefaultWorkbench workbench, IViewContent content, Notebook tabControl, TabLabel tabLabel) : base() { this.workbench = workbench; this.tabControl = tabControl; this.content = content; this.tabLabel = tabLabel; this.tabPage = content.Control; content.WorkbenchWindow = this; content.ContentNameChanged += new EventHandler(SetTitleEvent); content.DirtyChanged += new EventHandler(SetTitleEvent); content.BeforeSave += new EventHandler(BeforeSave); content.ContentChanged += new EventHandler(OnContentChanged); ShadowType = ShadowType.None; box = new VBox(); box.PackStart(content.Control); Add(box); box.Show(); SetTitleEvent(null, null); commandHandler = new ViewCommandHandlers(this); Show(); }
internal PadWindow(DefaultWorkbench workbench, PadCodon codon) { this.workbench = workbench; this.codon = codon; this.title = codon.Label; this.icon = codon.Icon; }
public LoadFileWrapper(IProgressMonitor monitor, DefaultWorkbench workbench, IViewDisplayBinding binding, FileOpenInformation fileInfo) { this.monitor = monitor; this.workbench = workbench; this.fileInfo = fileInfo; this.binding = binding; }
internal void Initialize(IProgressMonitor monitor) { monitor.BeginTask(GettextCatalog.GetString("Initializing Main Window"), 4); try { Counters.Initialization.Trace("Creating DefaultWorkbench"); workbench = new DefaultWorkbench(); monitor.Step(1); Counters.Initialization.Trace("Initializing Workspace"); workbench.InitializeWorkspace(); monitor.Step(1); Counters.Initialization.Trace("Initializing Layout"); workbench.InitializeLayout(); monitor.Step(1); ((Gtk.Window)workbench).Visible = false; workbench.ActiveWorkbenchWindowChanged += OnDocumentChanged; IdeApp.Workspace.StoringUserPreferences += OnStoringWorkspaceUserPreferences; IdeApp.Workspace.LoadingUserPreferences += OnLoadingWorkspaceUserPreferences; IdeApp.CommandService.ApplicationFocusOut += delegate(object o, EventArgs args) { SaveFileStatus(); }; IdeApp.CommandService.ApplicationFocusIn += delegate(object o, EventArgs args) { CheckFileStatus(); }; pads = null; // Make sure we get an up to date pad list. monitor.Step(1); } finally { monitor.EndTask(); } }
internal PadWindow(DefaultWorkbench workbench, PadCodon codon) { this.workbench = workbench; this.codon = codon; this.title = GettextCatalog.GetString(codon.Label); this.icon = codon.Icon; }
public SdiWorkspaceWindow(DefaultWorkbench workbench, IViewContent content, Notebook tabControl, TabLabel tabLabel) : base() { this.workbench = workbench; this.tabControl = tabControl; this.content = content; this.tabLabel = tabLabel; this.tabPage = content.Control; ShadowType = ShadowType.None; box = new VBox(); Add(box); box.PackStart(content.Control); fileTypeCondition.SetFileName(content.ContentName ?? content.UntitledName); extensionContext = AddinManager.CreateExtensionContext(); extensionContext.RegisterCondition("FileType", fileTypeCondition); content.WorkbenchWindow = this; content.ContentNameChanged += new EventHandler(SetTitleEvent); content.DirtyChanged += new EventHandler(SetTitleEvent); content.BeforeSave += new EventHandler(BeforeSave); content.ContentChanged += new EventHandler(OnContentChanged); box.Show(); SetTitleEvent(null, null); commandHandler = new ViewCommandHandlers(this); Show(); }
public SdiWorkspaceWindow(DefaultWorkbench workbench, ViewContent content, DockNotebook tabControl, DockNotebookTab tabLabel) : base() { this.workbench = workbench; this.tabControl = tabControl; this.content = content; this.tab = tabLabel; this.tabPage = content.Control; fileTypeCondition.SetFileName(content.ContentName ?? content.UntitledName); extensionContext = AddinManager.CreateExtensionContext(); extensionContext.RegisterCondition("FileType", fileTypeCondition); box = new VBox(); viewContents.Add(content); //this fires an event that the content uses to access this object's ExtensionContext content.WorkbenchWindow = this; // The previous WorkbenchWindow property assignement may end with a call to AttachViewContent, // which will add the content control to the subview notebook. In that case, we don't need to add it to box if (subViewNotebook == null) { box.PackStart(content.Control); } content.ContentNameChanged += new EventHandler(SetTitleEvent); content.DirtyChanged += HandleDirtyChanged; box.Show(); Add(box); SetTitleEvent(null, null); }
internal Pad(DefaultWorkbench workbench, PadCodon content) { this.window = workbench.GetPadWindow(content); this.window.PadHidden += delegate { IsOpenedAutomatically = false; }; this.content = content; this.workbench = workbench; }
internal async Task Initialize(ProgressMonitor monitor) { monitor.BeginTask(GettextCatalog.GetString("Initializing Main Window"), 4); try { monitors = (IdeProgressMonitorManager)await Runtime.GetService <ProgressMonitorManager> (); documentManager = await Runtime.GetService <DocumentManager> (); await Runtime.GetService <DocumentModelRegistry> (); await Runtime.GetService <DocumentControllerService> (); Counters.Initialization.Trace("Creating DefaultWorkbench"); workbench = (DefaultWorkbench)await Runtime.GetService <IShell> (); monitor.Step(1); Counters.Initialization.Trace("Initializing Workspace"); workbench.InitializeWorkspace(); monitor.Step(1); Counters.Initialization.Trace("Initializing Layout"); workbench.InitializeLayout(); monitor.Step(1); ((Gtk.Window)workbench).Visible = false; workbench.WorkbenchTabsChanged += WorkbenchTabsChanged; IdeApp.Workspace.StoringUserPreferences += OnStoringWorkspaceUserPreferences; IdeApp.Workspace.LoadingUserPreferences += OnLoadingWorkspaceUserPreferences; IdeApp.FocusOut += delegate(object o, EventArgs args) { if (!fileEventsFrozen) { fileEventsFrozen = true; FileService.FreezeEvents(); } }; IdeApp.FocusIn += delegate(object o, EventArgs args) { if (fileEventsFrozen) { fileEventsFrozen = false; FileService.ThawEvents(); } }; pads = null; // Make sure we get an up to date pad list. monitor.Step(1); } finally { monitor.EndTask(); } }
public SdiWorkspaceWindow(DefaultWorkbench workbench, DocumentController controller, DockNotebook tabControl, DockNotebookTab tabLabel) : base() { this.workbench = workbench; this.tabControl = tabControl; this.controller = controller; this.tab = tabLabel; // The previous WorkbenchWindow property assignement may end with a call to AttachViewContent, // which will add the content control to the subview notebook. In that case, we don't need to add it to box controller.DocumentTitleChanged += SetTitleEvent; controller.HasUnsavedChangesChanged += HandleDirtyChanged; SetTitleEvent(); }
static void PlaceInFloatingFrame(DockNotebook notebook, DockNotebookTab tab, Rectangle allocation, int ox, int oy) { var newWindow = new DockWindow(); var newNotebook = newWindow.Container.GetFirstNotebook(); var newTab = newNotebook.AddTab(); var workspaceWindow = (SdiWorkspaceWindow)tab.Content; newTab.Content = workspaceWindow; newWindow.Title = DefaultWorkbench.GetTitle(workspaceWindow); workspaceWindow.SetDockNotebook(newNotebook, newTab); newWindow.Move(ox - w / 2, oy - h / 2); newWindow.Resize(w, h); newWindow.ShowAll(); DockNotebook.ActiveNotebook = newNotebook; }
static PlaceholderWindow() { IdeApp.Workbench.ActiveDocumentChanged += delegate { var doc = IdeApp.Workbench.ActiveDocument; if (doc == null) { return; } var rootWindow = doc.Window.ActiveViewContent.Control.Toplevel as DockWindow; if (rootWindow == null) { return; } rootWindow.Title = DefaultWorkbench.GetTitle(doc.Window); }; }
public static DockWindow MoveToFloatingWindow(SdiWorkspaceWindow workspaceWindow, int x, int y, int width, int height) { var window = new DockWindow(); var notebook = window.Container.GetFirstNotebook(); var tab = notebook.AddTab(); tab.Content = workspaceWindow; window.Title = DefaultWorkbench.GetTitle(workspaceWindow); workspaceWindow.SetDockNotebook(notebook, tab); window.Move(x, y); window.Resize(width, height); window.ShowAll(); return(window); }
static PlaceholderWindow() { IdeApp.Workbench.ActiveDocumentChanged += delegate { var doc = IdeApp.Workbench.ActiveDocument; if (doc == null) { return; } var workspaceWindow = doc.Window as SdiWorkspaceWindow; var rootWindow = workspaceWindow?.Toplevel as DockWindow; if (rootWindow == null) { return; } rootWindow.Title = DefaultWorkbench.GetTitle(workspaceWindow); }; }
public override void Run(object sender, System.EventArgs e) { try { string systemType = Config.GetConfigValue("SystemType"); if (systemType != "2D" && systemType != "3D") { systemType = "2D3D"; } string startTime = DateTime.Now.ToString(); //string res = WebApp.CallWebService(SystemInfo.Instance.ZYWKIPPORT + "SystemLog.asmx", "WriteSystemInfo", // new string[] { "systemname", "location", "dimension", "version", "clienttype", "starttime" }, // new string[] { SystemInfo.Instance.SystemName, SystemInfo.Instance.Location, systemType, SystemInfo.Instance.Version, "CS", startTime }); //string res = WebApp.CallWebService(SystemInfo.Instance.ZYWKIPPORT + "SystemLog.asmx", "WriteSystemInfo", // new string[] { "str" }, // new string[] { "232" }); DefaultWorkbench form = new DefaultWorkbench(); ResourceManager resource = new ResourceManager(typeof(DefaultWorkbench)); DFApplication.Application.Workbench = form; form.Text = SystemInfo.Instance.SystemFullName; //form.Icon = (Icon)resource.GetObject("$this.Icon"); form.Initialize(); LoggingService.Info(form.Text + "Æô¶¯£¡"); Application.AddMessageFilter(new FormKeyHandler()); Application.DoEvents(); Application.Run((Form)DFApplication.Application.Workbench); } catch (SEHException se) { LoggingService.Fatal(se.Message + "\r\n" + se.StackTrace); } catch (Exception ex) { LoggingService.Fatal(ex.Message + "\r\n" + ex.StackTrace); } finally { System.Environment.Exit(0); } }
protected override bool OnExposeEvent(Gdk.EventExpose evnt) { bool ret = base.OnExposeEvent(evnt); if (HasResizeGrip) { DefaultWorkbench wb = (DefaultWorkbench)IdeApp.Workbench.RootWindow; wb.DockFrame.ShadedContainer.DrawBackground(this, GetGripRect()); Gdk.Rectangle rect = GetGripRect(); int w = rect.Width - Style.Xthickness; int h = Allocation.Height - Style.YThickness; if (h < 18 - Style.YThickness) { h = 18 - Style.YThickness; } Gdk.WindowEdge edge = Direction == TextDirection.Ltr ? Gdk.WindowEdge.SouthEast : Gdk.WindowEdge.SouthWest; Gtk.Style.PaintResizeGrip(Style, GdkWindow, State, evnt.Area, this, "statusbar", edge, rect.X, rect.Y, w, h); } return(ret); }
public SideBar(DefaultWorkbench workbench, Gtk.Orientation orientation) { bars.Add(this); this.orientation = orientation; if (orientation == Orientation.Vertical) { mainBox = this; boxTabs = new VBox(false, 0); } else { mainBox = new HBox(); PackStart(mainBox); boxTabs = new HBox(false, 0); } this.workbench = workbench; mainBox.PackStart(boxTabs, true, true, 0); AddinManager.ExtensionChanged += HandleAddinManagerExtensionChanged; ShowAll(); IdeApp.Workbench.LayoutChanged += HandleIdeAppWorkbenchLayoutChanged; UpdateTabs(); }
internal MonoDevelopStatusBar() { BorderWidth = 0; Spacing = 0; HasResizeGrip = true; Accessible.Role = Atk.Role.Filler; HeaderBox hb = new HeaderBox(1, 0, 0, 0); hb.Accessible.Role = Atk.Role.Filler; hb.StyleSet += (o, args) => { hb.BorderColor = Styles.DockSeparatorColor.ToGdkColor(); hb.BackgroundColor = Styles.DockBarBackground.ToGdkColor(); }; var mainBox = new HBox(); mainBox.Accessible.Role = Atk.Role.Filler; var alignment = new Alignment(0f, 0f, 0f, 0f); alignment.Accessible.Role = Atk.Role.Filler; mainBox.PackStart(alignment, true, true, 0); hb.Add(mainBox); hb.ShowAll(); PackStart(hb, true, true, 0); // Dock area CustomFrame dfr = new CustomFrame(0, 0, 1, 0); dfr.Accessible.Role = Atk.Role.Filler; dfr.StyleSet += (o, args) => { dfr.BorderColor = Styles.DockSeparatorColor.ToGdkColor(); }; dfr.ShowAll(); DefaultWorkbench wb = (DefaultWorkbench)IdeApp.Workbench.RootWindow; var dockBar = wb.DockFrame.ExtractDockBar(PositionType.Bottom); dockBar.AlignToEnd = true; dockBar.ShowBorder = false; dockBar.NoShowAll = true; dfr.Add(dockBar); mainBox.PackStart(dfr, false, false, 0); // Resize grip resizeGrip.Accessible.SetRole(AtkCocoa.Roles.AXGrowArea); resizeGrip.WidthRequest = ResizeGripWidth; resizeGrip.HeightRequest = 0; resizeGrip.VisibleWindow = false; mainBox.PackStart(resizeGrip, false, false, 0); resizeGrip.ButtonPressEvent += delegate(object o, ButtonPressEventArgs args) { if (args.Event.Button == 1) { GdkWindow.BeginResizeDrag(Gdk.WindowEdge.SouthEast, (int)args.Event.Button, (int)args.Event.XRoot, (int)args.Event.YRoot, args.Event.Time); } }; this.ShowAll(); // // todo: Move this to the CompletionWindowManager when it's possible. // StatusBarContext completionStatus = null; // CompletionWindowManager.WindowShown += delegate { // CompletionListWindow wnd = CompletionWindowManager.Wnd; // if (wnd != null && wnd.List != null && wnd.List.CategoryCount > 1) { // if (completionStatus == null) // completionStatus = CreateContext (); // completionStatus.ShowMessage (string.Format (GettextCatalog.GetString ("To toggle categorized completion mode press {0}."), IdeApp.CommandService.GetCommandInfo (Commands.TextEditorCommands.ShowCompletionWindow).AccelKey)); // } // }; }
internal MonoDevelopStatusBar() { BorderWidth = 0; Spacing = 0; HasResizeGrip = true; HeaderBox hb = new HeaderBox(1, 0, 0, 0); hb.StyleSet += (o, args) => { hb.BorderColor = Styles.DockSeparatorColor.ToGdkColor(); hb.BackgroundColor = Styles.DockBarBackground.ToGdkColor(); }; var mainBox = new HBox(); mainBox.PackStart(new Label(""), true, true, 0); hb.Add(mainBox); hb.ShowAll(); PackStart(hb, true, true, 0); // Feedback button if (FeedbackService.Enabled) { CustomFrame fr = new CustomFrame(0, 0, 1, 0); var px = Xwt.Drawing.Image.FromResource("feedback-16.png"); HBox b = new HBox(false, 3); b.PackStart(new Xwt.ImageView(px).ToGtkWidget()); b.PackStart(new Gtk.Label("Feedback")); Gtk.Alignment al = new Gtk.Alignment(0f, 0f, 1f, 1f); al.RightPadding = 5; al.LeftPadding = 3; al.Add(b); feedbackButton = new MiniButton(al); //feedbackButton.BackroundColor = new Gdk.Color (200, 200, 255); fr.Add(feedbackButton); mainBox.PackStart(fr, false, false, 0); feedbackButton.Clicked += HandleFeedbackButtonClicked; feedbackButton.ButtonPressEvent += HandleFeedbackButtonButtonPressEvent; ; feedbackButton.ClickOnRelease = true; FeedbackService.FeedbackPositionGetter = delegate { int x, y; if (feedbackButton.GdkWindow != null) { feedbackButton.GdkWindow.GetOrigin(out x, out y); x += feedbackButton.Allocation.Width; y -= 6; } else { x = y = -1; } return(new Gdk.Point(x, y)); }; } // Dock area CustomFrame dfr = new CustomFrame(0, 0, 1, 0); dfr.StyleSet += (o, args) => { dfr.BorderColor = Styles.DockSeparatorColor.ToGdkColor(); }; dfr.ShowAll(); DefaultWorkbench wb = (DefaultWorkbench)IdeApp.Workbench.RootWindow; var dockBar = wb.DockFrame.ExtractDockBar(PositionType.Bottom); dockBar.AlignToEnd = true; dockBar.ShowBorder = false; dockBar.NoShowAll = true; dfr.Add(dockBar); mainBox.PackStart(dfr, false, false, 0); // Resize grip resizeGrip.WidthRequest = ResizeGripWidth; resizeGrip.HeightRequest = 0; resizeGrip.VisibleWindow = false; mainBox.PackStart(resizeGrip, false, false, 0); resizeGrip.ButtonPressEvent += delegate(object o, ButtonPressEventArgs args) { if (args.Event.Button == 1) { GdkWindow.BeginResizeDrag(Gdk.WindowEdge.SouthEast, (int)args.Event.Button, (int)args.Event.XRoot, (int)args.Event.YRoot, args.Event.Time); } }; this.ShowAll(); // // todo: Move this to the CompletionWindowManager when it's possible. // StatusBarContext completionStatus = null; // CompletionWindowManager.WindowShown += delegate { // CompletionListWindow wnd = CompletionWindowManager.Wnd; // if (wnd != null && wnd.List != null && wnd.List.CategoryCount > 1) { // if (completionStatus == null) // completionStatus = CreateContext (); // completionStatus.ShowMessage (string.Format (GettextCatalog.GetString ("To toggle categorized completion mode press {0}."), IdeApp.CommandService.GetCommandInfo (Commands.TextEditorCommands.ShowCompletionWindow).AccelKey)); // } // }; }
public LoadFileWrapper(DefaultWorkbench workbench, IViewDisplayBinding binding, Project project, FileOpenInformation fileInfo) : this(workbench, binding, fileInfo) { this.project = project; }
internal MonoDevelopStatusBar() { mainContext = new MainStatusBarContextImpl(this); activeContext = mainContext; contexts.Add(mainContext); Frame originalFrame = (Frame)Children[0]; // originalFrame.WidthRequest = 8; // originalFrame.Shadow = ShadowType.In; // originalFrame.BorderWidth = 0; BorderWidth = 0; Spacing = 0; // Feedback button CustomFrame fr = new CustomFrame(0, 0, 1, 1); Gdk.Pixbuf px = Gdk.Pixbuf.LoadFromResource("balloon.png"); HBox b = new HBox(false, 3); b.PackStart(new Gtk.Image(px)); b.PackStart(new Gtk.Label("Feedback")); Gtk.Alignment al = new Gtk.Alignment(0f, 0f, 1f, 1f); al.RightPadding = 5; al.LeftPadding = 3; al.Add(b); feedbackButton = new MiniButton(al); //feedbackButton.BackroundColor = new Gdk.Color (200, 200, 255); fr.Add(feedbackButton); PackStart(fr, false, false, 0); feedbackButton.Clicked += HandleFeedbackButtonClicked; feedbackButton.ButtonPressEvent += HandleFeedbackButtonButtonPressEvent;; feedbackButton.ClickOnRelease = true; FeedbackService.FeedbackPositionGetter = delegate { int x, y; feedbackButton.GdkWindow.GetOrigin(out x, out y); x += feedbackButton.Allocation.Width; y -= 6; return(new Gdk.Point(x, y)); }; // Dock area DefaultWorkbench wb = (DefaultWorkbench)IdeApp.Workbench.RootWindow; wb.DockFrame.ShadedContainer.Add(this); Gtk.Widget dockBar = wb.DockFrame.ExtractDockBar(PositionType.Bottom); dockBar.NoShowAll = true; PackStart(dockBar, false, false, 0); // Status panels progressBar = new ProgressBar(); progressBar.PulseStep = 0.1; progressBar.SizeRequest(); progressBar.HeightRequest = 1; statusBox = new HBox(false, 0); statusBox.BorderWidth = 0; statusLabel = new Label(); statusLabel.SetAlignment(0, 0.5f); statusLabel.Wrap = false; int w, h; Gtk.Icon.SizeLookup(IconSize.Menu, out w, out h); statusLabel.HeightRequest = h; statusLabel.SetPadding(0, 0); EventBox eventMessageBox = new EventBox(); messageBox = new HBox(); messageBox.PackStart(progressBar, false, false, 0); messageBox.PackStart(statusLabel, true, true, 0); eventMessageBox.Add(messageBox); statusBox.PackStart(eventMessageBox, true, true, 0); eventMessageBox.ButtonPressEvent += HandleEventMessageBoxButtonPressEvent; textStatusBarPanel.BorderWidth = 0; textStatusBarPanel.ShadowType = ShadowType.None; textStatusBarPanel.Add(statusBox); Label fillerLabel = new Label(); fillerLabel.WidthRequest = 8; statusBox.PackEnd(fillerLabel, false, false, 0); modeLabel = new Label(" "); statusBox.PackEnd(modeLabel, false, false, 8); cursorLabel = new Label(" "); statusBox.PackEnd(cursorLabel, false, false, 0); statusIconBox = new HBox(); statusIconBox.BorderWidth = 0; statusIconBox.Spacing = 3; statusBox.PackEnd(statusIconBox, false, false, 4); this.PackStart(textStatusBarPanel, true, true, 0); ShowReady(); Gtk.Box.BoxChild boxChild = (Gtk.Box.BoxChild) this[textStatusBarPanel]; boxChild.Position = 0; boxChild.Expand = boxChild.Fill = true; // boxChild = (Gtk.Box.BoxChild)this[originalFrame]; // boxChild.Padding = 0; // boxChild.Expand = boxChild.Fill = false; this.progressBar.Fraction = 0.0; this.ShowAll(); statusIconBox.HideAll(); originalFrame.HideAll(); progressBar.Visible = false; StatusBarContext completionStatus = null; // todo: Move this to the CompletionWindowManager when it's possible. CompletionWindowManager.WindowShown += delegate { CompletionListWindow wnd = CompletionWindowManager.Wnd; if (wnd != null && wnd.List != null && wnd.List.CategoryCount > 1) { if (completionStatus == null) { completionStatus = CreateContext(); } completionStatus.ShowMessage(string.Format(GettextCatalog.GetString("To toggle categorized completion mode press {0}."), IdeApp.CommandService.GetCommandInfo(Commands.TextEditorCommands.ShowCompletionWindow).AccelKey)); } }; CompletionWindowManager.WindowClosed += delegate { if (completionStatus != null) { completionStatus.Dispose(); completionStatus = null; } }; }
public LoadFileWrapper(DefaultWorkbench workbench, IViewDisplayBinding binding, FileOpenInformation fileInfo) { this.workbench = workbench; this.fileInfo = fileInfo; this.binding = binding; }
internal MonoDevelopStatusBar() { BorderWidth = 0; Spacing = 0; HasResizeGrip = true; HeaderBox hb = new HeaderBox(1, 0, 0, 0); hb.BorderColor = Styles.DockSeparatorColor; var mainBox = new HBox(); mainBox.PackStart(new Label(""), true, true, 0); hb.Add(mainBox); hb.ShowAll(); PackStart(hb, true, true, 0); // Feedback button if (FeedbackService.Enabled) { CustomFrame fr = new CustomFrame(0, 0, 1, 1); Gdk.Pixbuf px = Gdk.Pixbuf.LoadFromResource("balloon.png"); HBox b = new HBox(false, 3); b.PackStart(new Gtk.Image(px)); b.PackStart(new Gtk.Label("Feedback")); Gtk.Alignment al = new Gtk.Alignment(0f, 0f, 1f, 1f); al.RightPadding = 5; al.LeftPadding = 3; al.Add(b); feedbackButton = new MiniButton(al); //feedbackButton.BackroundColor = new Gdk.Color (200, 200, 255); fr.Add(feedbackButton); mainBox.PackStart(fr, false, false, 0); feedbackButton.Clicked += HandleFeedbackButtonClicked; feedbackButton.ButtonPressEvent += HandleFeedbackButtonButtonPressEvent; ; feedbackButton.ClickOnRelease = true; FeedbackService.FeedbackPositionGetter = delegate { int x, y; feedbackButton.GdkWindow.GetOrigin(out x, out y); x += feedbackButton.Allocation.Width; y -= 6; return(new Gdk.Point(x, y)); }; } // Dock area DefaultWorkbench wb = (DefaultWorkbench)IdeApp.Workbench.RootWindow; var dockBar = wb.DockFrame.ExtractDockBar(PositionType.Bottom); dockBar.AlignToEnd = true; dockBar.ShowBorder = false; dockBar.NoShowAll = true; mainBox.PackStart(dockBar, false, false, 0); // Resize grip resizeGrip.WidthRequest = ResizeGripWidth; resizeGrip.HeightRequest = 0; mainBox.PackStart(resizeGrip, false, false, 0); // Status panels statusBox = new HBox(false, 0); statusBox.BorderWidth = 0; statusLabel.SetAlignment(0, 0.5f); statusLabel.Wrap = false; int w, h; Gtk.Icon.SizeLookup(IconSize.Menu, out w, out h); statusLabel.HeightRequest = h; statusLabel.SetPadding(0, 0); statusLabel.ShowAll(); messageBox.PackStart(statusLabel, true, true, 0); var eventCaretBox = new EventBox(); var caretStatusBox = new HBox(); modeLabel = new Label(" "); caretStatusBox.PackEnd(modeLabel, false, false, 8); cursorLabel = new CaretStatusLabel(" "); caretStatusBox.PackEnd(cursorLabel, false, false, 0); caretStatusBox.GetSizeRequest(out w, out h); caretStatusBox.WidthRequest = w; caretStatusBox.HeightRequest = h; eventCaretBox.Add(caretStatusBox); statusBox.PackEnd(eventCaretBox, false, false, 0); this.ShowAll(); // // todo: Move this to the CompletionWindowManager when it's possible. // StatusBarContext completionStatus = null; // CompletionWindowManager.WindowShown += delegate { // CompletionListWindow wnd = CompletionWindowManager.Wnd; // if (wnd != null && wnd.List != null && wnd.List.CategoryCount > 1) { // if (completionStatus == null) // completionStatus = CreateContext (); // completionStatus.ShowMessage (string.Format (GettextCatalog.GetString ("To toggle categorized completion mode press {0}."), IdeApp.CommandService.GetCommandInfo (Commands.TextEditorCommands.ShowCompletionWindow).AccelKey)); // } // }; }
internal MonoDevelopStatusBar() { mainContext = new MainStatusBarContextImpl(this); activeContext = mainContext; contexts.Add(mainContext); Frame originalFrame = (Frame)Children[0]; // originalFrame.WidthRequest = 8; // originalFrame.Shadow = ShadowType.In; // originalFrame.BorderWidth = 0; BorderWidth = 0; DefaultWorkbench wb = (DefaultWorkbench)IdeApp.Workbench.RootWindow; wb.DockFrame.ShadedContainer.Add(this); Gtk.Widget dockBar = wb.DockFrame.ExtractDockBar(PositionType.Bottom); dockBar.NoShowAll = true; PackStart(dockBar, false, false, 0); progressBar = new ProgressBar(); progressBar.PulseStep = 0.1; progressBar.SizeRequest(); progressBar.HeightRequest = 1; statusBox = new HBox(false, 0); statusBox.BorderWidth = 0; statusLabel = new Label(); statusLabel.SetAlignment(0, 0.5f); statusLabel.Wrap = false; int w, h; Gtk.Icon.SizeLookup(IconSize.Menu, out w, out h); statusLabel.HeightRequest = h; statusLabel.SetPadding(0, 0); EventBox eventMessageBox = new EventBox(); messageBox = new HBox(); messageBox.PackStart(progressBar, false, false, 0); messageBox.PackStart(statusLabel, true, true, 0); eventMessageBox.Add(messageBox); statusBox.PackStart(eventMessageBox, true, true, 0); eventMessageBox.ButtonPressEvent += HandleEventMessageBoxButtonPressEvent; textStatusBarPanel.BorderWidth = 0; textStatusBarPanel.ShadowType = ShadowType.None; textStatusBarPanel.Add(statusBox); Label fillerLabel = new Label(); fillerLabel.WidthRequest = 8; statusBox.PackEnd(fillerLabel, false, false, 0); modeLabel = new Label(" "); statusBox.PackEnd(modeLabel, false, false, 8); cursorLabel = new Label(" "); statusBox.PackEnd(cursorLabel, false, false, 0); statusIconBox = new HBox(); statusIconBox.BorderWidth = 0; statusIconBox.Spacing = 3; statusBox.PackEnd(statusIconBox, false, false, 4); this.PackStart(textStatusBarPanel, true, true, 0); ShowReady(); Gtk.Box.BoxChild boxChild = (Gtk.Box.BoxChild) this[textStatusBarPanel]; boxChild.Position = 0; boxChild.Expand = boxChild.Fill = true; // boxChild = (Gtk.Box.BoxChild)this[originalFrame]; // boxChild.Padding = 0; // boxChild.Expand = boxChild.Fill = false; this.progressBar.Fraction = 0.0; this.ShowAll(); statusIconBox.HideAll(); originalFrame.HideAll(); progressBar.Visible = false; StatusBarContext completionStatus = null; // todo: Move this to the CompletionWindowManager when it's possible. CompletionWindowManager.WindowShown += delegate { CompletionListWindow wnd = CompletionWindowManager.Wnd; if (wnd != null && wnd.List != null && wnd.List.CategoryCount > 1) { if (completionStatus == null) { completionStatus = CreateContext(); } completionStatus.ShowMessage(string.Format(GettextCatalog.GetString("To toggle categorized completion mode press {0}."), IdeApp.CommandService.GetCommandInfo(Commands.TextEditorCommands.ShowCompletionWindow).AccelKey)); } }; CompletionWindowManager.WindowClosed += delegate { if (completionStatus != null) { completionStatus.Dispose(); completionStatus = null; } }; }