コード例 #1
0
        private Widget CreateGuiEditor()
        {
            // Create the editor for the user.
            commandController = new ProjectCommandController();

            editorView = new EditorView();
            editorView.Controller.CommandController = commandController;
            EditorViewTheme.SetupTheme(editorView.Theme);

            // Remove the default margins because they aren't helpful at this
            // point and whenever they load, it causes the document to reset.
            editorView.Margins.Clear();

            // Wrap the text editor in a scrollbar.
            var scrolledWindow = new ScrolledWindow();

            scrolledWindow.VscrollbarPolicy = PolicyType.Always;
            scrolledWindow.Add(editorView);

            // Create the indicator bar that is 10 px wide.
            indicatorView = new IndicatorView(editorView);
            indicatorView.SetSizeRequest(20, 1);

            var indicatorFrame = new Frame
            {
                BorderWidth = 2,
                ShadowType  = ShadowType.None,
                Shadow      = ShadowType.None
            };

            indicatorFrame.Add(indicatorView);

            // Add the editor and bar to the current tab.
            var editorBand = new HBox(false, 0);

            editorBand.PackStart(indicatorFrame, false, false, 0);
            editorBand.PackStart(scrolledWindow, true, true, 4);

            // Return the top-most frame.
            return(editorBand);
        }
コード例 #2
0
        private Widget CreateGuiEditor()
        {
            // Create the editor for the user.
            commandController = new ProjectCommandController();

            editorView = new EditorView();
            editorView.Controller.CommandController = commandController;
            EditorViewTheme.SetupTheme(editorView.Theme);

            // Remove the default margins because they aren't helpful at this
            // point and whenever they load, it causes the document to reset.
            editorView.Margins.Clear();

            // Wrap the text editor in a scrollbar.
            var scrolledWindow = new ScrolledWindow();
            scrolledWindow.VscrollbarPolicy = PolicyType.Always;
            scrolledWindow.Add(editorView);

            // Create the indicator bar that is 10 px wide.
            indicatorView = new IndicatorView(editorView);
            indicatorView.SetSizeRequest(20, 1);

            var indicatorFrame = new Frame
            {
                BorderWidth = 2,
                ShadowType = ShadowType.None,
                Shadow = ShadowType.None
            };
            indicatorFrame.Add(indicatorView);

            // Add the editor and bar to the current tab.
            var editorBand = new HBox(false, 0);
            editorBand.PackStart(indicatorFrame, false, false, 0);
            editorBand.PackStart(scrolledWindow, true, true, 4);

            // Return the top-most frame.
            return editorBand;
        }