Exemple #1
0
 public TestViewContent()
 {
     data = TextEditorFactory.CreateNewEditor();
     Contents.Add(data);;
     Name = "";
 }
Exemple #2
0
 public TestViewContent(IReadonlyTextDocument doc)
 {
     data = TextEditorFactory.CreateNewEditor(doc);
     Contents.Add(data);
     Name = "";
 }
        void Init()
        {
            _mainBox   = new VBox();
            _headerBox = new HBox();

            _widthLabel = new Label("Width:");
            _widthLabel.SetPadding(6, 0);

            _widthEntry = new Entry
            {
                WidthRequest = 60
            };

            _heightLabel = new Label("Height:");
            _heightLabel.SetPadding(6, 0);

            _heightEntry = new Entry
            {
                WidthRequest = 60
            };

            _contentBox = new HPaned();

            _codeFrame = new Frame
            {
                BorderWidth = 1
            };

            _codeBox             = new VBox();
            _codeLabel           = new Label("Code");
            _textEditor          = TextEditorFactory.CreateNewEditor();
            _textEditor.MimeType = "text/x-csharp";

            _outputFrame = new Frame
            {
                BorderWidth  = 1,
                WidthRequest = 512
            };

            _outputBox   = new VBox();
            _outputLabel = new Label("Output");
            _skWidget    = new SKWidget();

            _messagesFrame = new Frame
            {
                BorderWidth = 1
            };

            _messagesBox   = new VBox();
            _messagesLabel = new Label("Messages");

            _messagesView = new TreeView
            {
                HeadersVisible = true,
                HeightRequest  = 60,
                WidthRequest   = 400
            };

            _messagesView.RulesHint      = true;
            _messagesView.Selection.Mode = Gtk.SelectionMode.Single;

            _messagesView.AppendColumn("Line", new CellRendererText(), "text", 0);
            _messagesView.AppendColumn("Message", new CellRendererText(), "text", 1);

            _messagesStore = new ListStore(typeof(string), typeof(string));

            _messagesView.Model = _messagesStore;

            var xwtMainBox = Xwt.Toolkit.CurrentEngine.WrapWidget(_mainBox);

            _control = new XwtControl(xwtMainBox);
        }