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, 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.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);
                }
            };

            // 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));
//				}
//			};
        }
Пример #2
0
        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));
//				}
//			};
        }