예제 #1
0
        /// <summary>
        /// Constructor. Initialises the widget and will show a world
        /// map with no markers until <see cref="ShowMap" /> is called.
        /// </summary>
        /// <param name="owner">Owner view.</param>
        public MapView(ViewBase owner) : base(owner)
        {
            image = new Gtk.Image();
            var container = new Gtk.EventBox();

            container.Add(image);

            VPaned box = new VPaned();

            PropertiesGrid = new PropertyView(this);
            box.Pack1(((ViewBase)PropertiesGrid).MainWidget, true, false);
            box.Pack2(container, true, true);

            container.AddEvents(
                (int)Gdk.EventMask.ButtonPressMask
                | (int)Gdk.EventMask.ButtonReleaseMask
                | (int)Gdk.EventMask.ScrollMask);
            container.ButtonPressEvent   += OnButtonPress;
            container.ButtonReleaseEvent += OnButtonRelease;
            image.SizeAllocated          += OnSizeAllocated;
#if NETFRAMEWORK
            image.ExposeEvent += OnImageExposed;
#else
            image.Drawn += OnImageExposed;
#endif
            container.Destroyed   += OnMainWidgetDestroyed;
            container.ScrollEvent += OnMouseScroll;

            mainWidget = box;
            mainWidget.ShowAll();
        }
예제 #2
0
    public static int Main(string[] args)
    {
        Gtk.Application.Init();
        Window win = new Window("Custom Scrollable Widget Test");

        win.DeleteEvent += new DeleteEventHandler(OnQuit);

        VPaned paned = new VPaned();

        ScrolledWindow scroll = new ScrolledWindow();

        scroll.HscrollbarPolicy = PolicyType.Automatic;
        scroll.VscrollbarPolicy = PolicyType.Automatic;

        var cw = new DerivedScrollableWidget <string> ("This one label that is repeated");

        scroll.Add(cw);
        paned.Pack1(scroll, true, false);

        scroll = new ScrolledWindow();
        scroll.HscrollbarPolicy = PolicyType.Automatic;
        scroll.VscrollbarPolicy = PolicyType.Automatic;

        var cw2 = new DerivedScrollableWidget <object> ("Another label that is repeated");

        scroll.Add(cw2);
        paned.Pack2(scroll, true, false);

        win.Add(paned);
        win.DefaultWidth  = 200;
        win.DefaultHeight = 200;
        win.ShowAll();
        Gtk.Application.Run();
        return(0);
    }
예제 #3
0
파일: MapView.cs 프로젝트: shenyczz/ApsimX
        /// <summary>
        /// Constructor. Initialises the widget and will show a world
        /// map with no markers until <see cref="ShowMap" /> is called.
        /// </summary>
        /// <param name="owner">Owner view.</param>
        public MapView(ViewBase owner) : base(owner)
        {
            GeometryServiceProvider.Instance = new NtsGeometryServices();

            image = new Gtk.Image();
            var container = new Gtk.EventBox();

            container.Add(image);

            VPaned box = new VPaned();

            Grid = new GridView(this);
            box.Pack1(((ViewBase)Grid).MainWidget, true, false);
            box.Pack2(container, true, true);

            container.AddEvents(
                (int)Gdk.EventMask.ButtonPressMask
                | (int)Gdk.EventMask.ButtonReleaseMask
                | (int)Gdk.EventMask.ScrollMask);
            container.ButtonPressEvent   += OnButtonPress;
            container.ButtonReleaseEvent += OnButtonRelease;
            image.SizeAllocated          += OnSizeAllocated;
            image.ExposeEvent            += OnImageExposed;
            container.Destroyed          += OnMainWidgetDestroyed;
            container.ScrollEvent        += OnMouseScroll;

            mainWidget = box;
            mainWidget.ShowAll();
        }
예제 #4
0
	public static int Main9 (string[] args)
	{
		Gtk.Application.Init ();
		Window win = new Window ("Custom Widget Test");
		win.DeleteEvent += new DeleteEventHandler (OnQuit);
		
		VPaned paned = new VPaned ();
		CustomWidget cw = new CustomWidget ();
		cw.Label = "This one contains a button";
		Button button = new Button ("Ordinary button");
		cw.Add (button);
		paned.Pack1 (cw, true, false);

		cw = new CustomWidget ();
		cw.Label = "And this one a TextView";
		cw.StockId = Stock.JustifyLeft;
		ScrolledWindow sw = new ScrolledWindow (null, null);
		sw.ShadowType = ShadowType.In;
		sw.HscrollbarPolicy = PolicyType.Automatic;
		sw.VscrollbarPolicy = PolicyType.Automatic;
		TextView textView = new TextView ();
		sw.Add (textView);
		cw.Add (sw);
		paned.Pack2 (cw, true, false);
		
		win.Add (paned);
		win.ShowAll ();
		Gtk.Application.Run ();
		return 0;
	}
예제 #5
0
    public MainWindow()
        : base(Gtk.WindowType.Toplevel)
    {
        var webView = new WebKit.WebView();
        var scrolled = new ScrolledWindow();
        var v = new VPaned();

        scrolled.Add(webView);
        v.Pack1(scrolled, true, true);
        scrolled.SetSizeRequest(-1, 50);

        var button = new Button("foo");
        v.Pack2(button, true, true);

        this.Add(v);
        this.ShowAll();

        webView.LoadString("<p>foo</p>", "text/html", "utf-8", null);

        // This won't show up until we've returned from the constructor
        // so let's do something easy that can happen after the window shows
        button.Clicked += (object sender, EventArgs e) => {
            var document = webView.DomDocument;
            var first = document.FirstChild;
            var body = document.GetElementsByTagName("body").Item(0);
            var para = document.CreateElement("p");
            para.AppendChild(document.CreateTextNode("this is some text"));
            body.AppendChild(para);
        };
    }
예제 #6
0
    public MainWindow() : base(Gtk.WindowType.Toplevel)
    {
        var webView  = new WebKit.WebView();
        var scrolled = new ScrolledWindow();
        var v        = new VPaned();

        scrolled.Add(webView);
        v.Pack1(scrolled, true, true);
        scrolled.SetSizeRequest(-1, 50);

        var button = new Button("foo");

        v.Pack2(button, true, true);

        this.Add(v);
        this.ShowAll();

        webView.LoadString("<p>foo</p>", "text/html", "utf-8", null);

        // This won't show up until we've returned from the constructor
        // so let's do something easy that can happen after the window shows
        button.Clicked += (object sender, EventArgs e) => {
            var document = webView.DomDocument;
            var first    = document.FirstChild;
            var body     = document.GetElementsByTagName("body").Item(0);
            var para     = document.CreateElement("p");
            para.AppendChild(document.CreateTextNode("this is some text"));
            body.AppendChild(para);
        };
    }
예제 #7
0
    public static int Main(string[] args)
    {
        Gtk.Application.Init();
        Window win = new Window("Custom Widget Test");

        win.DeleteEvent += new DeleteEventHandler(OnQuit);

        VPaned       paned = new VPaned();
        CustomWidget cw    = new CustomWidget();

        cw.Label = "This one contains a button";
        Button button = new Button("Ordinary button");

        cw.Add(button);
        paned.Pack1(cw, true, false);

        cw         = new CustomWidget();
        cw.Label   = "And this one a TextView";
        cw.StockId = Stock.JustifyLeft;
        ScrolledWindow sw = new ScrolledWindow(null, null);

        sw.ShadowType       = ShadowType.In;
        sw.HscrollbarPolicy = PolicyType.Automatic;
        sw.VscrollbarPolicy = PolicyType.Automatic;
        TextView textView = new TextView();

        sw.Add(textView);
        cw.Add(sw);
        paned.Pack2(cw, true, false);

        win.Add(paned);
        win.ShowAll();
        Gtk.Application.Run();
        return(0);
    }
예제 #8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="InitialWaterView" /> class.
 /// </summary>
 public XYPairsView(ViewBase owner) : base(owner)
 {
     vpaned      = new VPaned();
     _mainWidget = vpaned;
     gridView    = new GridView(this);
     graphView   = new GraphView(this);
     vpaned.Pack1(gridView.MainWidget, true, false);
     vpaned.Pack2(graphView.MainWidget, true, false);
 }
예제 #9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="InitialWaterView" /> class.
 /// </summary>
 public XYPairsView(ViewBase owner)
     : base(owner)
 {
     vpaned = new VPaned();
     _mainWidget = vpaned;
     gridView = new GridView(this);
     graphView = new GraphView(this);
     vpaned.Pack1(gridView.MainWidget, true, false);
     vpaned.Pack2(graphView.MainWidget, true, false);
 }
예제 #10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="InitialWaterView" /> class.
 /// </summary>
 public XYPairsView(ViewBase owner) : base(owner)
 {
     vpaned     = new VPaned();
     mainWidget = vpaned;
     gridView   = new GridView(this);
     graphView  = new GraphView(this);
     vpaned.Pack1(gridView.MainWidget, true, false);
     vpaned.Pack2(graphView.MainWidget, true, false);
     gridView.NumericFormat = null;
     mainWidget.Destroyed  += _mainWidget_Destroyed;
 }
예제 #11
0
        /// <summary>Constructor</summary>
        public DualGridView(ViewBase owner) : base(owner)
        {
            Grid1 = new GridView(owner);
            Grid2 = new GridView(owner);

            VPaned panel = new VPaned();

            mainWidget = panel;
            panel.Pack1((Grid1 as GridView).MainWidget, true, true);
            panel.Pack2((Grid2 as GridView).MainWidget, true, true);
            mainWidget.Destroyed += _mainWidget_Destroyed;
        }
예제 #12
0
        /// <summary>Constructor</summary>
        public PropertyAndGridView(ViewBase owner) : base(owner)
        {
            PropertiesView = new PropertyView(owner);
            Grid2          = new GridView(owner);

            VPaned panel = new VPaned();

            mainWidget = panel;
            panel.Pack1((PropertiesView as ViewBase).MainWidget, true, false);
            panel.Pack2((Grid2 as ViewBase).MainWidget, true, false);
            mainWidget.Destroyed += _mainWidget_Destroyed;
        }
예제 #13
0
        public MainWindow(string title)
            : base(title)
        {
            // when this window is deleted, it'll run delete_event()
            DeleteEvent += delete_event;
            Shown += new EventHandler(window_Shown);

            // Add the button to the window and display everything
            MenuBar menuBar = new MenuBar();
            menuBar.Add(new MenuItem("File"));

            treeView = new TreeView();
            // Create a column for the artist name
            Gtk.TreeViewColumn nameColumn = new Gtk.TreeViewColumn();
            nameColumn.Title = "Name";

            // Create the text cell that will display the artist name
            Gtk.CellRendererText fileNameCell = new Gtk.CellRendererText();

            // Add the cell to the column
            nameColumn.PackStart(fileNameCell, true);

            // Add the columns to the TreeView
            treeView.AppendColumn(nameColumn);

            // Tell the Cell Renderers which items in the model to display
            nameColumn.AddAttribute(fileNameCell, "text", 0);

            listView = new TreeView();
            SetupListView();

            treeMapView = new TreeMapView();

            ScrolledWindow scrolledTreeView = new ScrolledWindow();
            scrolledTreeView.Add(treeView);
            ScrolledWindow scrolledListView = new ScrolledWindow();
            scrolledListView.Add(listView);

            HPaned hpaned = new HPaned();
            hpaned.Pack1(scrolledTreeView, true, true);
            hpaned.Pack2(scrolledListView, false, true);

            VPaned vpaned = new VPaned();
            vpaned.Pack1(hpaned, true, true);
            vpaned.Pack2(treeMapView, false, true);

            VBox vbox = new VBox(false, 1);
            vbox.PackStart(menuBar, false, true, 0);
            vbox.PackStart(vpaned, true, true, 0);

            Add(vbox);
        }
예제 #14
0
 public ProfileView(ViewBase owner) : base(owner)
 {
     Glade.XML gxml = new Glade.XML("ApsimNG.Resources.Glade.ProfileView.glade", "vpaned1");
     gxml.Autoconnect(this);
     _mainWidget  = vpaned1;
     PropertyGrid = new GridView(this);
     vbox1.PackStart(PropertyGrid.MainWidget, true, true, 0);
     //vpaned1.Pack1(PropertyGrid.MainWidget, true, true);
     ProfileGrid = new GridView(this);
     vpaned2.Pack1(ProfileGrid.MainWidget, true, true);
     Graph = new GraphView(this);
     vpaned2.Pack2(Graph.MainWidget, true, true);
 }
예제 #15
0
        public ExploreView(ICredentialsProvider credentialsProvider,
                           int stopAfter) : base(false, 1)
        {
            this.credentialsProvider = credentialsProvider;

            HPaned hPaned = new HPaned();

            Add(hPaned);

            {
                ScrolledWindowBase scrolledWindow1 = new ScrolledWindowBase();
                hPaned.Add1(scrolledWindow1);

                repositoryView = new RepositoryView(this, credentialsProvider);
                scrolledWindow1.Add(repositoryView);
            }

            viewChildren = new VPaned();
            {
                ScrolledWindowBase scrolledWindow2 = new ScrolledWindowBase();
                viewChildren.Pack1(scrolledWindow2, true, true);

                directoryView = new DirectoryView(this);
                scrolledWindow2.Add(directoryView);

                ScrolledWindowBase scrolledWindow3 = new ScrolledWindowBase();
                viewChildren.Pack2(scrolledWindow3, true, true);

                changesetView = new ChangesetView(this, stopAfter);
                scrolledWindow3.Add(changesetView);

                int x, y, width, height, depth;
                RootWindow.GetGeometry(out x, out y, out width, out height, out depth);

                hPaned.Add2(viewChildren);
                hPaned.Position = (width - 50) / 3;
            }

            // add status bar
            statusbar = new Statusbar();
            statusbar.HasResizeGrip = false;
            PackEnd(statusbar, false, false, 1);

            Assembly entry = Assembly.GetEntryAssembly();

            StatusMessage(String.Format("{0} version {1}", entry.GetName().Name,
                                        entry.GetName().Version.ToString()));

            ShowAll();
            repositoryView.Selection.Changed += OnPathSelectionChanged;
        }
예제 #16
0
        public ProfileView(ViewBase owner) : base(owner)
        {
            Builder builder = BuilderFromResource("ApsimNG.Resources.Glade.ProfileView.glade");

            vpaned1      = (VPaned)builder.GetObject("vpaned1");
            vpaned2      = (VPaned)builder.GetObject("vpaned2");
            vbox1        = (VBox)builder.GetObject("vbox1");
            _mainWidget  = vpaned1;
            PropertyGrid = new GridView(this);
            vbox1.PackStart(PropertyGrid.MainWidget, true, true, 0);
            //vpaned1.Pack1(PropertyGrid.MainWidget, true, true);
            ProfileGrid = new GridView(this);
            vpaned2.Pack1(ProfileGrid.MainWidget, true, true);
            Graph = new GraphView(this);
            vpaned2.Pack2(Graph.MainWidget, true, false);
            Graph.MainWidget.Realized += GraphWidget_Realized;
        }
예제 #17
0
        public ProfileView(ViewBase owner) : base(owner)
        {
            Builder builder = BuilderFromResource("ApsimNG.Resources.Glade.ProfileView.glade");

            vpaned1        = (VPaned)builder.GetObject("vpaned1");
            vpaned2        = (VPaned)builder.GetObject("vpaned2");
            vbox1          = (VBox)builder.GetObject("vbox1");
            mainWidget     = vpaned1;
            properitesView = new PropertyView(this);
            vbox1.PackStart(properitesView.MainWidget, true, true, 0);
            //vpaned1.Pack1(PropertyGrid.MainWidget, true, true);
            profileGrid = new GridView(this);
            profileGrid.NumericFormat = "N3";
            vpaned2.Pack1(profileGrid.MainWidget, true, true);
            graph = new GraphView(this);
            vpaned2.Pack2(graph.MainWidget, true, false);
            graph.MainWidget.Realized += GraphWidget_Realized;
            mainWidget.Destroyed      += _mainWidget_Destroyed;
        }
예제 #18
0
        /// <summary>Constructor</summary>
        public PropertyAndGridView(ViewBase owner) : base(owner)
        {
            if (Configuration.Settings.UseNewPropertyPresenter)
            {
                PropertiesView = new PropertyView(owner);
            }
            else
            {
                PropertiesView = new GridView(this);
            }
            Grid2 = new GridView(owner);

            VPaned panel = new VPaned();

            mainWidget = panel;
            panel.Pack1((PropertiesView as ViewBase).MainWidget, true, false);
            panel.Pack2((Grid2 as ViewBase).MainWidget, true, false);
            mainWidget.Destroyed += _mainWidget_Destroyed;
        }
예제 #19
0
        public NowPlayingPanelController(AudioPlayer audioPlayer, ITrackSelector trackSelector)
        {
            if (_settings.VPanedPosition == 0)
                _settings.VPanedPosition = 500;

            _nowPlayingTrackListViewController = new NowPlayingTrackListViewController(audioPlayer);
            _coverArtPanel = new CoverArtPanel(audioPlayer, trackSelector, _nowPlayingTrackListViewController);

            View = new VPaned();
            View.Pack1(_nowPlayingTrackListViewController.View, true, true);
            View.Pack2(_coverArtPanel, true, true);

            View.Position = _settings.VPanedPosition;
            View.PositionSet = true;

            View.AddNotification("position", (o, args) =>
                {
                    _settings.VPanedPosition = View.Position;
                });
        }
예제 #20
0
        /// <summary>
        /// Constructor. Initialises the widget and will show a world
        /// map with no markers until <see cref="ShowMap" /> is called.
        /// </summary>
        /// <param name="owner">Owner view.</param>
        public MapView(ViewBase owner) : base(owner)
        {
            image = new Gtk.Image();

            image.Halign = Align.Start;
            image.Valign = Align.Start;

            var container = new Gtk.EventBox();

            container.Add(image);

            VPaned box = new VPaned();

            PropertiesView = new PropertyView(this);
            box.Pack1(((ViewBase)PropertiesView).MainWidget, true, false);

            if (((ViewBase)PropertiesView).MainWidget is ScrolledWindow scroller)
            {
                scroller.VscrollbarPolicy = PolicyType.Never;
            }

            box.Pack2(container, true, true);

            container.AddEvents(
                (int)Gdk.EventMask.ButtonPressMask
                | (int)Gdk.EventMask.ButtonReleaseMask
                | (int)Gdk.EventMask.ScrollMask);
            container.ButtonPressEvent   += OnButtonPress;
            container.ButtonReleaseEvent += OnButtonRelease;

            image.Drawn += OnImageExposed;

            container.Destroyed   += OnMainWidgetDestroyed;
            container.ScrollEvent += OnMouseScroll;

            mainWidget = box;
            mainWidget.ShowAll();
        }
예제 #21
0
        public StatusView(string filepath, Repository vc)
            : base(Path.GetFileName(filepath) + " Status")
        {
            this.vc       = vc;
            this.filepath = filepath;
            changeSet     = vc.CreateChangeSet(filepath);

            main   = new VBox(false, 6);
            widget = main;

            commandbar = new Toolbar();
            commandbar.ToolbarStyle = Gtk.ToolbarStyle.BothHoriz;
            commandbar.IconSize     = Gtk.IconSize.Menu;
            main.PackStart(commandbar, false, false, 0);

            buttonCommit             = new Gtk.ToolButton(new Gtk.Image("vc-commit", Gtk.IconSize.Menu), GettextCatalog.GetString("Commit..."));
            buttonCommit.IsImportant = true;
            buttonCommit.Clicked    += new EventHandler(OnCommitClicked);
            commandbar.Insert(buttonCommit, -1);

            Gtk.ToolButton btnRefresh = new Gtk.ToolButton(new Gtk.Image(Gtk.Stock.Refresh, IconSize.Menu), GettextCatalog.GetString("Refresh"));
            btnRefresh.IsImportant = true;
            btnRefresh.Clicked    += new EventHandler(OnRefresh);
            commandbar.Insert(btnRefresh, -1);

            buttonRevert             = new Gtk.ToolButton(new Gtk.Image("vc-revert-command", Gtk.IconSize.Menu), GettextCatalog.GetString("Revert"));
            buttonRevert.IsImportant = true;
            buttonRevert.Clicked    += new EventHandler(OnRevert);
            commandbar.Insert(buttonRevert, -1);

            showRemoteStatus             = new Gtk.ToolButton(new Gtk.Image("vc-remote-status", Gtk.IconSize.Menu), GettextCatalog.GetString("Show Remote Status"));
            showRemoteStatus.IsImportant = true;
            showRemoteStatus.Clicked    += new EventHandler(OnShowRemoteStatusClicked);
            commandbar.Insert(showRemoteStatus, -1);

            Gtk.ToolButton btnCreatePatch = new Gtk.ToolButton(new Gtk.Image("vc-diff", Gtk.IconSize.Menu), GettextCatalog.GetString("Create Patch"));
            btnCreatePatch.IsImportant = true;
            btnCreatePatch.Clicked    += new EventHandler(OnCreatePatch);
            commandbar.Insert(btnCreatePatch, -1);

            commandbar.Insert(new Gtk.SeparatorToolItem(), -1);

            Gtk.ToolButton btnOpen = new Gtk.ToolButton(new Gtk.Image(Gtk.Stock.Open, IconSize.Menu), GettextCatalog.GetString("Open"));
            btnOpen.IsImportant = true;
            btnOpen.Clicked    += new EventHandler(OnOpen);
            commandbar.Insert(btnOpen, -1);

            commandbar.Insert(new Gtk.SeparatorToolItem(), -1);

            Gtk.ToolButton btnExpand = new Gtk.ToolButton(null, GettextCatalog.GetString("Expand All"));
            btnExpand.IsImportant = true;
            btnExpand.Clicked    += new EventHandler(OnExpandAll);
            commandbar.Insert(btnExpand, -1);

            Gtk.ToolButton btnCollapse = new Gtk.ToolButton(null, GettextCatalog.GetString("Collapse All"));
            btnCollapse.IsImportant = true;
            btnCollapse.Clicked    += new EventHandler(OnCollapseAll);
            commandbar.Insert(btnCollapse, -1);

            commandbar.Insert(new Gtk.SeparatorToolItem(), -1);

            Gtk.ToolButton btnSelectAll = new Gtk.ToolButton(null, GettextCatalog.GetString("Select All"));
            btnSelectAll.IsImportant = true;
            btnSelectAll.Clicked    += new EventHandler(OnSelectAll);
            commandbar.Insert(btnSelectAll, -1);

            Gtk.ToolButton btnSelectNone = new Gtk.ToolButton(null, GettextCatalog.GetString("Select None"));
            btnSelectNone.IsImportant = true;
            btnSelectNone.Clicked    += new EventHandler(OnSelectNone);
            commandbar.Insert(btnSelectNone, -1);

            status = new Label("");
            main.PackStart(status, false, false, 0);

            scroller                = new ScrolledWindow();
            scroller.ShadowType     = Gtk.ShadowType.In;
            filelist                = new FileTreeView();
            filelist.Selection.Mode = SelectionMode.Multiple;

            scroller.Add(filelist);
            scroller.HscrollbarPolicy   = PolicyType.Automatic;
            scroller.VscrollbarPolicy   = PolicyType.Automatic;
            filelist.RowActivated      += OnRowActivated;
            filelist.DiffLineActivated += OnDiffLineActivated;

            CellRendererToggle cellToggle = new CellRendererToggle();

            cellToggle.Toggled += new ToggledHandler(OnCommitToggledHandler);
            var crc = new CellRendererIcon();

            crc.StockId       = "vc-comment";
            colCommit         = new TreeViewColumn();
            colCommit.Spacing = 2;
            colCommit.Widget  = new Gtk.Image("vc-commit", Gtk.IconSize.Menu);
            colCommit.Widget.Show();
            colCommit.PackStart(cellToggle, false);
            colCommit.PackStart(crc, false);
            colCommit.AddAttribute(cellToggle, "active", ColCommit);
            colCommit.AddAttribute(cellToggle, "visible", ColShowToggle);
            colCommit.AddAttribute(crc, "visible", ColShowComment);

            CellRendererText crt     = new CellRendererText();
            var            crp       = new CellRendererPixbuf();
            TreeViewColumn colStatus = new TreeViewColumn();

            colStatus.Title = GettextCatalog.GetString("Status");
            colStatus.PackStart(crp, false);
            colStatus.PackStart(crt, true);
            colStatus.AddAttribute(crp, "pixbuf", ColIcon);
            colStatus.AddAttribute(crp, "visible", ColShowStatus);
            colStatus.AddAttribute(crt, "text", ColStatus);
            colStatus.AddAttribute(crt, "foreground", ColStatusColor);

            TreeViewColumn colFile = new TreeViewColumn();

            colFile.Title   = GettextCatalog.GetString("File");
            colFile.Spacing = 2;
            crp             = new CellRendererPixbuf();
            diffRenderer    = new CellRendererDiff();
            colFile.PackStart(crp, false);
            colFile.PackStart(diffRenderer, true);
            colFile.AddAttribute(crp, "pixbuf", ColIconFile);
            colFile.AddAttribute(crp, "visible", ColShowStatus);
            colFile.SetCellDataFunc(diffRenderer, new TreeCellDataFunc(SetDiffCellData));

            crt             = new CellRendererText();
            crp             = new CellRendererPixbuf();
            colRemote       = new TreeViewColumn();
            colRemote.Title = GettextCatalog.GetString("Remote Status");
            colRemote.PackStart(crp, false);
            colRemote.PackStart(crt, true);
            colRemote.AddAttribute(crp, "pixbuf", ColRemoteIcon);
            colRemote.AddAttribute(crt, "text", ColRemoteStatus);
            colRemote.AddAttribute(crt, "foreground", ColStatusColor);

            filelist.AppendColumn(colStatus);
            filelist.AppendColumn(colRemote);
            filelist.AppendColumn(colCommit);
            filelist.AppendColumn(colFile);

            colRemote.Visible = false;

            filestore               = new TreeStore(typeof(Gdk.Pixbuf), typeof(string), typeof(string[]), typeof(string), typeof(bool), typeof(bool), typeof(string), typeof(bool), typeof(bool), typeof(Gdk.Pixbuf), typeof(bool), typeof(Gdk.Pixbuf), typeof(string), typeof(bool));
            filelist.Model          = filestore;
            filelist.TestExpandRow += new Gtk.TestExpandRowHandler(OnTestExpandRow);

            commitBox = new VBox();

            HBox labBox = new HBox();

            labelCommit        = new Gtk.Label(GettextCatalog.GetString("Commit message:"));
            labelCommit.Xalign = 0;
            labBox.PackStart(new Gtk.Image("vc-comment", Gtk.IconSize.Menu), false, false, 0);
            labBox.PackStart(labelCommit, true, true, 3);

            commitBox.PackStart(labBox, false, false, 0);

            Gtk.ScrolledWindow frame = new Gtk.ScrolledWindow();
            frame.ShadowType           = ShadowType.In;
            commitText                 = new TextView();
            commitText.WrapMode        = WrapMode.WordChar;
            commitText.Buffer.Changed += OnCommitTextChanged;
            frame.Add(commitText);
            commitBox.PackStart(frame, true, true, 6);

            VPaned paned = new VPaned();

            paned.Pack1(scroller, true, true);
            paned.Pack2(commitBox, false, false);
            main.PackStart(paned, true, true, 0);

            main.ShowAll();
            status.Visible = false;

            filelist.Selection.Changed += new EventHandler(OnCursorChanged);
            VersionControlService.FileStatusChanged += OnFileStatusChanged;

            filelist.HeadersClickable = true;
            filestore.SetSortFunc(0, CompareNodes);
            colStatus.SortColumnId = 0;
            filestore.SetSortFunc(1, CompareNodes);
            colRemote.SortColumnId = 1;
            filestore.SetSortFunc(2, CompareNodes);
            colCommit.SortColumnId = 2;
            filestore.SetSortFunc(3, CompareNodes);
            colFile.SortColumnId = 3;

            filestore.SetSortColumnId(3, Gtk.SortType.Ascending);

            filelist.ShowContextMenu += OnPopupMenu;

            StartUpdate();
        }
예제 #22
0
		public StatusView (string filepath, Repository vc) 
			: base(Path.GetFileName(filepath) + " Status") 
		{
			this.vc = vc;
			this.filepath = filepath;
			changeSet = vc.CreateChangeSet (filepath);
			
			main = new VBox(false, 6);
			widget = main;
			
			commandbar = new Toolbar ();
			commandbar.ToolbarStyle = Gtk.ToolbarStyle.BothHoriz;
			commandbar.IconSize = Gtk.IconSize.Menu;
			main.PackStart (commandbar, false, false, 0);
			
			buttonCommit = new Gtk.ToolButton (new Gtk.Image ("vc-commit", Gtk.IconSize.Menu), GettextCatalog.GetString ("Commit..."));
			buttonCommit.IsImportant = true;
			buttonCommit.Clicked += new EventHandler (OnCommitClicked);
			commandbar.Insert (buttonCommit, -1);
			
			Gtk.ToolButton btnRefresh = new Gtk.ToolButton (new Gtk.Image (Gtk.Stock.Refresh, IconSize.Menu), GettextCatalog.GetString ("Refresh"));
			btnRefresh.IsImportant = true;
			btnRefresh.Clicked += new EventHandler (OnRefresh);
			commandbar.Insert (btnRefresh, -1);
			
			buttonRevert = new Gtk.ToolButton (new Gtk.Image ("vc-revert-command", Gtk.IconSize.Menu), GettextCatalog.GetString ("Revert"));
			buttonRevert.IsImportant = true;
			buttonRevert.Clicked += new EventHandler (OnRevert);
			commandbar.Insert (buttonRevert, -1);
			
			showRemoteStatus = new Gtk.ToolButton (new Gtk.Image ("vc-remote-status", Gtk.IconSize.Menu), GettextCatalog.GetString ("Show Remote Status"));
			showRemoteStatus.IsImportant = true;
			showRemoteStatus.Clicked += new EventHandler(OnShowRemoteStatusClicked);
			commandbar.Insert (showRemoteStatus, -1);
			
			Gtk.ToolButton btnCreatePatch = new Gtk.ToolButton (new Gtk.Image ("vc-diff", Gtk.IconSize.Menu), GettextCatalog.GetString ("Create Patch"));
			btnCreatePatch.IsImportant = true;
			btnCreatePatch.Clicked += new EventHandler (OnCreatePatch);
			commandbar.Insert (btnCreatePatch, -1);
			
			commandbar.Insert (new Gtk.SeparatorToolItem (), -1);
			
			Gtk.ToolButton btnOpen = new Gtk.ToolButton (new Gtk.Image (Gtk.Stock.Open, IconSize.Menu), GettextCatalog.GetString ("Open"));
			btnOpen.IsImportant = true;
			btnOpen.Clicked += new EventHandler (OnOpen);
			commandbar.Insert (btnOpen, -1);
			
			commandbar.Insert (new Gtk.SeparatorToolItem (), -1);
			
			Gtk.ToolButton btnExpand = new Gtk.ToolButton (null, GettextCatalog.GetString ("Expand All"));
			btnExpand.IsImportant = true;
			btnExpand.Clicked += new EventHandler (OnExpandAll);
			commandbar.Insert (btnExpand, -1);
			
			Gtk.ToolButton btnCollapse = new Gtk.ToolButton (null, GettextCatalog.GetString ("Collapse All"));
			btnCollapse.IsImportant = true;
			btnCollapse.Clicked += new EventHandler (OnCollapseAll);
			commandbar.Insert (btnCollapse, -1);
			
			commandbar.Insert (new Gtk.SeparatorToolItem (), -1);
			
			Gtk.ToolButton btnSelectAll = new Gtk.ToolButton (null, GettextCatalog.GetString ("Select All"));
			btnSelectAll.IsImportant = true;
			btnSelectAll.Clicked += new EventHandler (OnSelectAll);
			commandbar.Insert (btnSelectAll, -1);
			
			Gtk.ToolButton btnSelectNone = new Gtk.ToolButton (null, GettextCatalog.GetString ("Select None"));
			btnSelectNone.IsImportant = true;
			btnSelectNone.Clicked += new EventHandler (OnSelectNone);
			commandbar.Insert (btnSelectNone, -1);
			
			status = new Label("");
			main.PackStart(status, false, false, 0);
			
			scroller = new ScrolledWindow();
			scroller.ShadowType = Gtk.ShadowType.In;
			filelist = new FileTreeView();
			filelist.Selection.Mode = Gtk.SelectionMode.Multiple;
			
			scroller.Add(filelist);
			scroller.HscrollbarPolicy = PolicyType.Automatic;
			scroller.VscrollbarPolicy = PolicyType.Automatic;
			filelist.RowActivated += OnRowActivated;
			filelist.DiffLineActivated += OnDiffLineActivated;
			
			CellRendererToggle cellToggle = new CellRendererToggle();
			cellToggle.Toggled += new ToggledHandler(OnCommitToggledHandler);
			var crc = new CellRendererIcon ();
			crc.StockId = "vc-comment";
			colCommit = new TreeViewColumn ();
			colCommit.Spacing = 2;
			colCommit.Widget = new Gtk.Image ("vc-commit", Gtk.IconSize.Menu);
			colCommit.Widget.Show ();
			colCommit.PackStart (cellToggle, false);
			colCommit.PackStart (crc, false);
			colCommit.AddAttribute (cellToggle, "active", ColCommit);
			colCommit.AddAttribute (cellToggle, "visible", ColShowToggle);
			colCommit.AddAttribute (crc, "visible", ColShowComment);
			
			CellRendererText crt = new CellRendererText();
			var crp = new CellRendererPixbuf ();
			TreeViewColumn colStatus = new TreeViewColumn ();
			colStatus.Title = GettextCatalog.GetString ("Status");
			colStatus.PackStart (crp, false);
			colStatus.PackStart (crt, true);
			colStatus.AddAttribute (crp, "pixbuf", ColIcon);
			colStatus.AddAttribute (crp, "visible", ColShowStatus);
			colStatus.AddAttribute (crt, "text", ColStatus);
			colStatus.AddAttribute (crt, "foreground", ColStatusColor);
			
			TreeViewColumn colFile = new TreeViewColumn ();
			colFile.Title = GettextCatalog.GetString ("File");
			colFile.Spacing = 2;
			crp = new CellRendererPixbuf ();
			diffRenderer = new CellRendererDiff ();
			colFile.PackStart (crp, false);
			colFile.PackStart (diffRenderer, true);
			colFile.AddAttribute (crp, "pixbuf", ColIconFile);
			colFile.AddAttribute (crp, "visible", ColShowStatus);
			colFile.SetCellDataFunc (diffRenderer, new TreeCellDataFunc (SetDiffCellData));
			
			crt = new CellRendererText();
			crp = new CellRendererPixbuf ();
			colRemote = new TreeViewColumn ();
			colRemote.Title = GettextCatalog.GetString ("Remote Status");
			colRemote.PackStart (crp, false);
			colRemote.PackStart (crt, true);
			colRemote.AddAttribute (crp, "pixbuf", ColRemoteIcon);
			colRemote.AddAttribute (crt, "text", ColRemoteStatus);
			colRemote.AddAttribute (crt, "foreground", ColStatusColor);
			
			filelist.AppendColumn(colStatus);
			filelist.AppendColumn(colRemote);
			filelist.AppendColumn(colCommit);
			filelist.AppendColumn(colFile);
			
			colRemote.Visible = false;

			filestore = new TreeStore (typeof (Gdk.Pixbuf), typeof (string), typeof (string[]), typeof (string), typeof(bool), typeof(bool), typeof(string), typeof(bool), typeof (bool), typeof(Gdk.Pixbuf), typeof(bool), typeof (Gdk.Pixbuf), typeof(string), typeof(bool), typeof(bool));
			filelist.Model = filestore;
			filelist.TestExpandRow += new Gtk.TestExpandRowHandler (OnTestExpandRow);
			
			commitBox = new VBox ();
			
			HBox labBox = new HBox ();
			labelCommit = new Gtk.Label (GettextCatalog.GetString ("Commit message:"));
			labelCommit.Xalign = 0;
			labBox.PackStart (new Gtk.Image ("vc-comment", Gtk.IconSize.Menu), false, false, 0);
			labBox.PackStart (labelCommit, true, true, 3);
			
			commitBox.PackStart (labBox, false, false, 0);
			
			Gtk.ScrolledWindow frame = new Gtk.ScrolledWindow ();
			frame.ShadowType = ShadowType.In;
			commitText = new TextView ();
			commitText.WrapMode = WrapMode.WordChar;
			commitText.Buffer.Changed += OnCommitTextChanged;
			frame.Add (commitText);
			commitBox.PackStart (frame, true, true, 6);
			
			VPaned paned = new VPaned ();
			paned.Pack1 (scroller, true, true);
			paned.Pack2 (commitBox, false, false);
			main.PackStart (paned, true, true, 0);
			
			main.ShowAll();
			status.Visible = false;
			
			filelist.Selection.Changed += new EventHandler(OnCursorChanged);
			VersionControlService.FileStatusChanged += OnFileStatusChanged;
			
			filelist.HeadersClickable = true;
			filestore.SetSortFunc (0, CompareNodes);
			colStatus.SortColumnId = 0;
			filestore.SetSortFunc (1, CompareNodes);
			colRemote.SortColumnId = 1;
			filestore.SetSortFunc (2, CompareNodes);
			colCommit.SortColumnId = 2;
			filestore.SetSortFunc (3, CompareNodes);
			colFile.SortColumnId = 3;
			
			filestore.SetSortColumnId (3, Gtk.SortType.Ascending);
			
			filelist.DoPopupMenu = DoPopupMenu;
			
			StartUpdate();
		}
예제 #23
0
        public SqlQueryView()
        {
            stoppedQueries = new List <object> ();
            MonoDevelop.SourceEditor.Extension.TemplateExtensionNodeLoader.Init();
            this.UntitledName = string.Concat(AddinCatalog.GetString("Untitled Sql Script"), ".sql");

            vbox             = new VBox(false, 6);
            vbox.BorderWidth = 6;

            Toolbar toolbar = new Toolbar();

            toolbar.ToolbarStyle = ToolbarStyle.BothHoriz;

            buttonExecute = new ToolButton(ImageService.GetImage("md-db-execute", IconSize.SmallToolbar),
                                           AddinCatalog.GetString("_Execute"));
            buttonExecute.Label         = AddinCatalog.GetString("Execute");
            buttonExecute.Sensitive     = false;
            buttonExecute.TooltipMarkup = AddinCatalog.GetString("Execute Query");
            buttonExecute.IsImportant   = true;
            buttonExecute.Clicked      += new EventHandler(ExecuteClicked);

            buttonStop             = new ToolButton("gtk-stop");
            buttonStop.TooltipText = AddinCatalog.GetString("Stop Query Execution");
            buttonStop.Sensitive   = false;
            buttonStop.Clicked    += new EventHandler(StopClicked);

            buttonClear = new ToolButton(ImageService.GetImage("gtk-clear", IconSize.Button),
                                         AddinCatalog.GetString("Clear Results"));
            buttonClear.TooltipText = AddinCatalog.GetString("Clear Results");
            buttonClear.Clicked    += new EventHandler(ClearClicked);

            comboConnections          = new DatabaseConnectionContextComboBox();
            selectedConnection        = comboConnections.DatabaseConnection;
            comboConnections.Changed += new EventHandler(ConnectionChanged);
            ToolItem comboItem = new ToolItem();

            comboItem.Child = comboConnections;

            toolbar.Add(buttonExecute);
            toolbar.Add(buttonStop);
            toolbar.Add(buttonClear);
            toolbar.Add(new SeparatorToolItem());
            toolbar.Add(comboItem);

            pane = new VPaned();

            // Sql History Window
            ScrolledWindow windowHistory = new ScrolledWindow();

            history          = new SqlEditorWidget();
            history.Editable = false;
            windowHistory.AddWithViewport(history);

            // Status of the Last Query
            ScrolledWindow windowStatus = new ScrolledWindow();

            status = new TextView();
            windowStatus.Add(status);

            notebook = new Notebook();
            notebook.AppendPage(windowStatus, new Label(AddinCatalog.GetString("Status")));
            notebook.AppendPage(windowHistory, new Label(AddinCatalog.GetString("Query History")));

            pane.Pack2(notebook, true, true);
            vbox.PackStart(toolbar, false, true, 0);
            vbox.PackStart(pane, true, true, 0);
            this.Document.TextReplaced += SqlChanged;
            vbox.ShowAll();
            Document.DocumentUpdated += delegate(object sender, EventArgs args) {
                // Default mime type or a provider defined.
                if (selectedConnection == null)
                {
                    Document.MimeType = "text/x-sql";
                }
                else
                {
                    Document.MimeType = GetMimeType();
                }
            };
            Document.Text = string.Empty;
            notebook.Hide();
        }
예제 #24
0
		public SqlQueryView ()
		{
			stoppedQueries = new List<object> ();
			
			vbox = new VBox (false, 6);
			vbox.BorderWidth = 6;

			sqlEditor = new SqlEditorWidget ();
			sqlEditor.TextChanged += new EventHandler (SqlChanged);
			
			Toolbar toolbar = new Toolbar ();
			toolbar.ToolbarStyle = ToolbarStyle.BothHoriz;
			
			buttonExecute = new ToolButton (
				Services.Resources.GetImage ("md-db-execute", IconSize.SmallToolbar),
				GettextCatalog.GetString ("Execute")
			);
			buttonStop = new ToolButton ("gtk-stop");
			buttonClear = new ToolButton (Services.Resources.GetImage ("gtk-clear", IconSize.Button), GettextCatalog.GetString ("Clear Results"));
			buttonStop.Sensitive = false;
			buttonExecute.Sensitive = false;
			
			buttonExecute.Clicked += new EventHandler (ExecuteClicked);
			buttonStop.Clicked += new EventHandler (StopClicked);
			buttonClear.Clicked += new EventHandler (ClearClicked);
			
			comboConnections = new DatabaseConnectionContextComboBox ();
			selectedConnection = comboConnections.DatabaseConnection;
			comboConnections.Changed += new EventHandler (ConnectionChanged);

			buttonExecute.IsImportant = true;
			
			ToolItem comboItem = new ToolItem ();
			comboItem.Child = comboConnections;
			
			toolbar.Add (buttonExecute);
			toolbar.Add (buttonStop);
			toolbar.Add (buttonClear);
			toolbar.Add (new SeparatorToolItem ());
			toolbar.Add (comboItem);
			
			pane = new VPaned ();

			ScrolledWindow windowStatus = new ScrolledWindow ();
			status = new TextView ();
			windowStatus.Add (status);
			
			notebook = new Notebook ();
			notebook.AppendPage (windowStatus, new Label (GettextCatalog.GetString ("Status")));
			
			pane.Pack1 (sqlEditor, true, true);
			pane.Pack2 (notebook, true, true);
			
			vbox.PackStart (toolbar, false, true, 0);
			vbox.PackStart (pane, true, true, 0);
			
			vbox.ShowAll ();
			notebook.Hide ();
		}
예제 #25
0
        public FaceSidebarWidget()
        {
            instance = this;

            mainVBox = new VBox();
            //mainVBox.Spacing = 6;
            //faceVBox = new VBox();
            faceVPane = new VPaned();

            pleaseSelectPictureLabel = new Label ();
            pleaseSelectPictureLabel.Markup = SelectImageMarkup;
            //headerLabel =  new Label (Catalog.GetString ("Not Implemented Yet"));
            mainVBox.PackStart(pleaseSelectPictureLabel,false,false,0);

            knownFaceExpander = new Expander("In this photo:");

            //faceVBox.PackStart(knownFaceExpander,true,true,0);
            //faceVPane.Add(knownFaceExpander);
            knownFaceScrolledWindow = new ScrolledWindow();
            knownFaceExpander.Add(knownFaceScrolledWindow);
            faceVPane.Pack1(knownFaceExpander,true,true);
            //knownFaceExpander.HeightRequest = 30;
            //			faceHandleBox = new HandleBox();
            //			faceHandleBox.HandlePosition = PositionType.Top;
            //			faceVBox.PackStart(faceHandleBox,false,false,0);

            unknownFaceExpander = new Expander("Who's also in this photo");
            //faceVBox.PackStart(unknownFaceExpander,true,true,0);
            //faceVPane.Add(unknownFaceExpander);

            unknownFaceScrolledWindow = new ScrolledWindow();
            unknownFaceExpander.Add(unknownFaceScrolledWindow);
            faceVPane.Pack2(unknownFaceExpander,true,true);
            //unknownFaceExpander.HeightRequest = 30;
            mainVBox.PackStart(faceVPane,true,true,0);

            detectFaceButton = new Button(Catalog.GetString("Re-Detect Face From This Picture"));
            mainVBox.PackEnd(detectFaceButton,false,false,0);
            detectFaceButton.Clicked += DetectFaceButtonClicked;

            addFaceButton = new Button(manualAddFaceString);
            mainVBox.PackEnd(addFaceButton,false,false,0);
            addFaceButton.Clicked += AddFaceButtonClicked;

            knownFaceScrolledWindow.Visible = false;
            unknownFaceScrolledWindow.Visible = false;

            knownFaceExpander.ResizeMode = ResizeMode.Parent;
            unknownFaceExpander.ResizeMode = ResizeMode.Parent;
            Log.Debug("HeightR");

            ShadowType = ShadowType.None;
            BorderWidth = 0;
            //AddWithViewport(pleaseSelectPictureLabel);
            AddWithViewport (mainVBox);
            //mainVBox.Visible = false;
            ShowAll();
        }
예제 #26
0
        internal PropertyGrid(EditorManager editorManager)
            : base(false, 0)
        {
            this.editorManager = editorManager;

            tips = new Tooltips();

            #region Toolbar
            toolbar = new Toolbar();
            toolbar.ToolbarStyle = ToolbarStyle.Icons;
            toolbar.IconSize     = IconSize.SmallToolbar;
            base.PackStart(toolbar, false, false, 0);

            catButton            = new RadioToolButton(new GLib.SList(IntPtr.Zero));
            catButton.IconWidget = new Image(new Gdk.Pixbuf(null, "AspNetEdit.UI.PropertyGrid.SortByCat.png"));
            catButton.SetTooltip(tips, "Sort in categories", null);
            catButton.Toggled += new EventHandler(toolbarClick);
            toolbar.Insert(catButton, 0);

            alphButton = new RadioToolButton(catButton, Stock.SortAscending);
            alphButton.SetTooltip(tips, "Sort alphabetically", null);
            alphButton.Clicked += new EventHandler(toolbarClick);
            toolbar.Insert(alphButton, 1);

            catButton.Active = true;

            SeparatorToolItem sep = new SeparatorToolItem();
            toolbar.Insert(sep, 2);

            #endregion

            vpaned = new VPaned();

            descFrame        = new Frame();
            descFrame.Shadow = ShadowType.In;

            desc = new VBox(false, 0);
            descFrame.Add(desc);

            descTitle = new Label();
            descTitle.SetAlignment(0, 0);
            descTitle.SetPadding(5, 5);
            descTitle.UseMarkup = true;
            desc.PackStart(descTitle, false, false, 0);

            textScroll = new ScrolledWindow();
            textScroll.HscrollbarPolicy = PolicyType.Never;
            textScroll.VscrollbarPolicy = PolicyType.Automatic;

            desc.PackEnd(textScroll, true, true, 0);

            //TODO: Use label, but wrapping seems dodgy.
            descText               = new TextView();
            descText.WrapMode      = WrapMode.Word;
            descText.WidthRequest  = 1;
            descText.HeightRequest = 100;
            descText.Editable      = false;
            descText.LeftMargin    = 5;
            descText.RightMargin   = 5;
            textScroll.Add(descText);

            scrolledWindow = new ScrolledWindow();
            scrolledWindow.HscrollbarPolicy = PolicyType.Automatic;
            scrolledWindow.VscrollbarPolicy = PolicyType.Automatic;

            vpaned.Pack1(scrolledWindow, true, true);
            vpaned.Pack2(descFrame, false, true);

            AddPropertyTab(new DefaultPropertyTab());
            AddPropertyTab(new EventPropertyTab());

            base.PackEnd(vpaned);
            Populate();
        }
예제 #27
0
        public static Widget show_chat_form()
        {
            //新建窗体,标题是Hello World
            var win = new Gtk.Window("聊天");

            win.SetDefaultSize(800, 600);
            //win.SetSizeRequest(800, 600);

            //窗体关闭后退出应用
            //win.DeleteEvent += (s, e) =>
            //{
            //    Gtk.Application.Quit();
            //};

            win.WindowPosition = WindowPosition.Center;
            //win.Resizable = false;
            win.BorderWidth = 10;

            var paned1 = new VPaned();

            win.Add(paned1);
            var paned2 = new HPaned();

            paned1.SetSizeRequest(200, -1);
            paned2.SetSizeRequest(200, -1);
            paned1.Add(paned2);
            var button1 = new Button("按钮一");

            paned1.Pack1(button1, true, false);
            var button2 = new Button("按钮二");

            paned2.Pack1(button2, true, false);
            var paned3 = new VPaned();

            paned3.SetSizeRequest(200, -1);
            paned2.Pack2(paned3, true, false);
            //var button3 = new Button("按钮三");
            RecvChatWidget = new TextView();
            var recvScrollView = new ScrolledWindow();

            recvScrollView.Add(RecvChatWidget);
            //RecvChatWidget.SizeAllocated += new SizeAllocatedHandler(ScrollToBottom);
            paned3.Pack1(recvScrollView, true, false);
            //var button4 = new Button("按钮四");
            SendChatWidget = new TextView();
            var sendScrollView = new ScrolledWindow();

            sendScrollView.Add(SendChatWidget);
            var vbox       = new VBox(false, 0);
            var hbox       = new VBox(true, 0);
            var sendMsgBtn = new Button("发送消息");

            sendMsgBtn.Clicked += (s, e) =>
            {
                TextIter start, end;
                RecvChatWidget.Buffer.GetBounds(out start, out end);
                RecvChatWidget.Buffer.Insert(ref end, SendChatWidget.Buffer.Text);
                RecvChatWidget.Buffer.Insert(ref end, "\n");
                RecvChatWidget.ScrollToIter(RecvChatWidget.Buffer.EndIter, 0.0, false, 0.0, 0.0);
            };
            hbox.PackStart(sendMsgBtn, false, false, 0);
            vbox.PackStart(hbox, false, false, 0);
            vbox.PackEnd(sendScrollView, true, true, 0);
            paned3.Pack2(vbox, true, false);

            win.ShowAll();

            return(paned1);
        }
예제 #28
0
        public ConfigForm() : base(WindowType.Toplevel)
        {
            // Setup GUI
            WindowPosition = WindowPosition.Center;
            DefaultSize    = new Gdk.Size(500, 350);

            _headerBar = new HeaderBar();
            _headerBar.ShowCloseButton = true;
            _headerBar.Title           = "SwitchCam";

            var btnClickMe = new Gtk.Button();

            btnClickMe.AlwaysShowImage = true;
            btnClickMe.Image           = Image.NewFromIconName("document-new-symbolic", IconSize.Button);
            _headerBar.PackStart(btnClickMe);

            Titlebar = _headerBar;

            var vpanned1 = new VPaned();

            vpanned1.Position = 300;

            var hpanned = new HPaned();

            hpanned.Position = 100;

            _treeView = new TreeView();
            _treeView.HeadersVisible = false;
            hpanned.Pack1(_treeView, false, true);

            _notebook = new Notebook();

            var scroll1 = new ScrolledWindow();
            var vpanned = new VPaned();

            vpanned.Position   = 300;
            _boxContent        = new Box(Orientation.Vertical, 0);
            _boxContent.Margin = 8;
            vpanned.Pack1(_boxContent, false, false);
            scroll1.Child = vpanned;
            _notebook.AppendPage(scroll1, new Label {
                Text = "Data", Expand = true
            });

            hpanned.Pack2(_notebook, false, true);

            vpanned1.Pack1(hpanned, false, true);

            var box = new Box(Orientation.Horizontal, 0);

            box.Margin = 8;
            vpanned1.Pack2(box, false, true);

            var grid = new Grid
            {
                RowSpacing    = 2,
                ColumnSpacing = 2
            };

            box.PackStart(grid, false, false, 0);

            var btn = new Gtk.Button("Take Picture");

            btn.Clicked += TakePicture;

            grid.Attach(btn, 0, 0, 1, 1);

            Child = vpanned1;

            // Fill up data
            FillUpTreeView();

            // Connect events
            _treeView.Selection.Changed += Selection_Changed;
            Destroyed += OnDestroy;

            try
            {
                ConfigureButton();
            }
            catch (Exception e)
            {
                MMALLog.Logger.Debug($"Something went wrong while configuring the button. {e.Message} {e.StackTrace}");
            }
        }
예제 #29
0
        ///<summary>
        ///	InitWindow
        /// Sets up the widgets and events in the chat window
        ///</summary>
        void InitWindow()
        {
            hasBeenShown    = false;
            everShown       = false;
            shiftKeyPressed = false;
            notifyUser      = false;

            // Update the window title
            Title = string.Format("Chat with {0}", peerPerson.DisplayName);
            Icon  = Utilities.GetIcon("banter-22", 22);

            this.DefaultSize = new Gdk.Size(400, 700);

            hpaned          = new HPaned();
            hpaned.CanFocus = true;
            hpaned.Position = 300;
            hpaned.Show();

            this.Add(hpaned);

            leftPaneVBox           = new VBox();
            leftPaneVBox.NoShowAll = true;
            leftPaneVBox.Visible   = false;
            hpaned.Add1(leftPaneVBox);

            rightPaneVBox             = new VBox();
            rightPaneVBox.BorderWidth = 8;
            rightPaneVBox.Show();
            hpaned.Add2(rightPaneVBox);

            personControlVBox = new VBox(false, 4);
            personControlVBox.Show();
            rightPaneVBox.PackStart(personControlVBox, false, false, 0);

            PersonCard card = new PersonCard(peerPerson);

            card.Size = PersonCardSize.Medium;
            // Not sure why but we need to call ShowAll on the PersonCard for it to display
            card.ShowAll();
            card.ShowTextChatButton = false;
            personControlVBox.PackStart(card, true, true, 0);

            HBox hbox = new HBox(false, 0);

            hbox.Show();
            personControlVBox.PackStart(hbox, false, false, 0);

            //showPersonDetailsButton = new Button ();
            //showPersonDetailsButton.CanFocus = true;
            //showPersonDetailsButton.Label = Catalog.GetString ("Show Contact _Details");
            //showPersonDetailsButton.UseUnderline = true;
            //showPersonDetailsButton.Image = new Image (Stock.GoBack, IconSize.Menu);
            //showPersonDetailsButton.Show ();
            //hbox.PackStart (showPersonDetailsButton);

            videoVBox = new VBox(false, 0);
            if (this.chatType == ChatType.Video)
            {
                ShowVideoControl(true);
            }
            else
            {
                videoVBox.Visible = false;
            }

            rightPaneVBox.PackStart(videoVBox, false, true, 0);

            audioVBox = new VBox(false, 0);

            if (this.chatType == ChatType.Audio)
            {
                ShowAudioControl(true);
            }
            else
            {
                audioVBox.Visible = false;
            }

            rightPaneVBox.PackStart(audioVBox, false, false, 0);

            messagesVPaned          = new VPaned();
            messagesVPaned.CanFocus = true;
            // This is lame, fix the way this is all calculated
            if (videoView != null)
            {
                messagesVPaned.Position = 100;
            }
            else
            {
                messagesVPaned.Position = 700;
            }
            messagesVPaned.Show();
            rightPaneVBox.PackStart(messagesVPaned, true, true, 0);

            Gtk.ScrolledWindow sw = new ScrolledWindow();
            sw.VscrollbarPolicy = PolicyType.Automatic;
            sw.HscrollbarPolicy = PolicyType.Never;
            //scrolledWindow.ShadowType = ShadowType.None;
            sw.BorderWidth = 0;
            sw.CanFocus    = true;
            sw.Show();

            messagesView = new MessagesView();
            messagesView.Show();
            sw.Add(messagesView);
            messagesVPaned.Pack1(sw, true, true);

            typingVBox = new VBox(false, 0);
            typingVBox.Show();
            messagesVPaned.Pack2(typingVBox, false, false);

            typingToolbar              = new Toolbar();
            typingToolbar.ShowArrow    = false;
            typingToolbar.ToolbarStyle = ToolbarStyle.Icons;
            typingToolbar.IconSize     = IconSize.SmallToolbar;
            typingToolbar.Show();
            typingVBox.PackStart(typingToolbar, false, false, 0);

            typingScrolledWindow = new ScrolledWindow();
            typingScrolledWindow.VscrollbarPolicy = PolicyType.Automatic;
            typingScrolledWindow.HscrollbarPolicy = PolicyType.Automatic;
            typingScrolledWindow.ShadowType       = ShadowType.EtchedIn;
            typingScrolledWindow.CanFocus         = true;
            typingScrolledWindow.Show();
            typingVBox.PackStart(typingScrolledWindow, true, true, 0);

            typingTextView                  = new TextView();
            typingTextView.CanFocus         = true;
            typingTextView.WrapMode         = WrapMode.Word;
            typingTextView.LeftMargin       = 4;
            typingTextView.RightMargin      = 4;
            typingTextView.KeyPressEvent   += OnTypingTextViewKeyPressEvent;
            typingTextView.KeyReleaseEvent += OnTypingTextViewKeyReleaseEvent;
            typingTextView.Show();
            typingScrolledWindow.Add(typingTextView);
            spell_check        = new SpellCheck(typingTextView, "en-us");
            Shown             += OnWindowShown;
            DeleteEvent       += WindowDeleted;
            this.FocusInEvent += FocusInEventHandler;
        }
예제 #30
0
        public SqlQueryView()
        {
            stoppedQueries = new List <object> ();

            vbox             = new VBox(false, 6);
            vbox.BorderWidth = 6;

            sqlEditor              = new SqlEditorWidget();
            sqlEditor.TextChanged += new EventHandler(SqlChanged);

            Toolbar toolbar = new Toolbar();

            toolbar.ToolbarStyle = ToolbarStyle.BothHoriz;

            buttonExecute = new ToolButton(
                Services.Resources.GetImage("md-db-execute", IconSize.SmallToolbar),
                GettextCatalog.GetString("Execute")
                );
            buttonStop              = new ToolButton("gtk-stop");
            buttonClear             = new ToolButton(Services.Resources.GetImage("gtk-clear", IconSize.Button), GettextCatalog.GetString("Clear Results"));
            buttonStop.Sensitive    = false;
            buttonExecute.Sensitive = false;

            buttonExecute.Clicked += new EventHandler(ExecuteClicked);
            buttonStop.Clicked    += new EventHandler(StopClicked);
            buttonClear.Clicked   += new EventHandler(ClearClicked);

            comboConnections          = new DatabaseConnectionContextComboBox();
            selectedConnection        = comboConnections.DatabaseConnection;
            comboConnections.Changed += new EventHandler(ConnectionChanged);

            buttonExecute.IsImportant = true;

            ToolItem comboItem = new ToolItem();

            comboItem.Child = comboConnections;

            toolbar.Add(buttonExecute);
            toolbar.Add(buttonStop);
            toolbar.Add(buttonClear);
            toolbar.Add(new SeparatorToolItem());
            toolbar.Add(comboItem);

            pane = new VPaned();

            ScrolledWindow windowStatus = new ScrolledWindow();

            status = new TextView();
            windowStatus.Add(status);

            notebook = new Notebook();
            notebook.AppendPage(windowStatus, new Label(GettextCatalog.GetString("Status")));

            pane.Pack1(sqlEditor, true, true);
            pane.Pack2(notebook, true, true);

            vbox.PackStart(toolbar, false, true, 0);
            vbox.PackStart(pane, true, true, 0);

            vbox.ShowAll();
            notebook.Hide();
        }
예제 #31
0
        public override void Initialize(NodeBuilder[] builders, TreePadOption[] options, string menuPath)
        {
            base.Initialize(builders, options, menuPath);

            testChangedHandler            = (EventHandler)DispatchService.GuiDispatch(new EventHandler(OnDetailsTestChanged));
            testService.TestSuiteChanged += (EventHandler)DispatchService.GuiDispatch(new EventHandler(OnTestSuiteChanged));
            paned = new VPaned();

            VBox            vbox       = new VBox();
            DockItemToolbar topToolbar = Window.GetToolbar(PositionType.Top);

            var hbox = new HBox {
                Spacing = 6
            };

            hbox.PackStart(new ImageView(ImageService.GetIcon("nunit-run", IconSize.Menu)), false, false, 0);
            hbox.PackStart(new Label(GettextCatalog.GetString("Run All")), false, false, 0);
            buttonRunAll             = new Button(hbox);
            buttonRunAll.Clicked    += new EventHandler(OnRunAllClicked);
            buttonRunAll.Sensitive   = true;
            buttonRunAll.TooltipText = GettextCatalog.GetString("Run all tests");
            topToolbar.Add(buttonRunAll);

            buttonStop             = new Button(new Gtk.Image(Ide.Gui.Stock.Stop, IconSize.Menu));
            buttonStop.Clicked    += new EventHandler(OnStopClicked);
            buttonStop.Sensitive   = false;
            buttonStop.TooltipText = GettextCatalog.GetString("Cancel running test");
            topToolbar.Add(buttonStop);
            topToolbar.ShowAll();

            vbox.PackEnd(base.Control, true, true, 0);
            vbox.FocusChain = new Gtk.Widget [] { base.Control };

            paned.Pack1(vbox, true, true);

            detailsPad = new VBox();

            EventBox eb     = new EventBox();
            HBox     header = new HBox();

            eb.Add(header);

            detailLabel         = new HeaderLabel();
            detailLabel.Padding = 6;

            Button hb = new Button(new Gtk.Image("gtk-close", IconSize.SmallToolbar));

            hb.Relief   = ReliefStyle.None;
            hb.Clicked += new EventHandler(OnCloseDetails);
            header.PackEnd(hb, false, false, 0);

            hb          = new Button(new Gtk.Image("gtk-go-back", IconSize.SmallToolbar));
            hb.Relief   = ReliefStyle.None;
            hb.Clicked += new EventHandler(OnGoBackTest);
            header.PackEnd(hb, false, false, 0);

            header.Add(detailLabel);
            Gdk.Color hcol = eb.Style.Background(StateType.Normal);
            hcol.Red   = (ushort)(((double)hcol.Red) * 0.9);
            hcol.Green = (ushort)(((double)hcol.Green) * 0.9);
            hcol.Blue  = (ushort)(((double)hcol.Blue) * 0.9);
            //	eb.ModifyBg (StateType.Normal, hcol);

            detailsPad.PackStart(eb, false, false, 0);

            VPaned panedDetails = new VPaned();

            panedDetails.BorderWidth = 3;
            VBox boxPaned1 = new VBox();

            chart = new TestChart();
            chart.ButtonPressEvent += OnChartButtonPress;
            chart.SelectionChanged += new EventHandler(OnChartDateChanged);
            chart.HeightRequest     = 50;

            Toolbar toolbar = new Toolbar();

            toolbar.IconSize     = IconSize.SmallToolbar;
            toolbar.ToolbarStyle = ToolbarStyle.Icons;
            toolbar.ShowArrow    = false;
            ToolButton but = new ToolButton("gtk-zoom-in");

            but.Clicked += new EventHandler(OnZoomIn);
            toolbar.Insert(but, -1);

            but          = new ToolButton("gtk-zoom-out");
            but.Clicked += new EventHandler(OnZoomOut);
            toolbar.Insert(but, -1);

            but          = new ToolButton("gtk-go-back");
            but.Clicked += new EventHandler(OnChartBack);
            toolbar.Insert(but, -1);

            but          = new ToolButton("gtk-go-forward");
            but.Clicked += new EventHandler(OnChartForward);
            toolbar.Insert(but, -1);

            but          = new ToolButton("gtk-goto-last");
            but.Clicked += new EventHandler(OnChartLast);
            toolbar.Insert(but, -1);

            boxPaned1.PackStart(toolbar, false, false, 0);
            boxPaned1.PackStart(chart, true, true, 0);

            panedDetails.Pack1(boxPaned1, false, false);

            // Detailed test information --------

            infoBook = new ButtonNotebook();
            infoBook.PageLoadRequired += new EventHandler(OnPageLoadRequired);

            // Info - Group summary

            Frame          tf = new Frame();
            ScrolledWindow sw = new ScrolledWindow();

            detailsTree = new TreeView();

            detailsTree.HeadersVisible = true;
            detailsTree.RulesHint      = true;
            detailsStore = new ListStore(typeof(object), typeof(string), typeof(string), typeof(string), typeof(string));

            CellRendererText trtest = new CellRendererText();
            CellRendererText tr;

            TreeViewColumn col3 = new TreeViewColumn();

            col3.Expand = false;
//			col3.Alignment = 0.5f;
            col3.Widget = new ImageView(TestStatusIcon.Success);
            col3.Widget.Show();
            tr = new CellRendererText();
//			tr.Xalign = 0.5f;
            col3.PackStart(tr, false);
            col3.AddAttribute(tr, "markup", 2);
            detailsTree.AppendColumn(col3);

            TreeViewColumn col4 = new TreeViewColumn();

            col4.Expand = false;
//			col4.Alignment = 0.5f;
            col4.Widget = new ImageView(TestStatusIcon.Failure);
            col4.Widget.Show();
            tr = new CellRendererText();
//			tr.Xalign = 0.5f;
            col4.PackStart(tr, false);
            col4.AddAttribute(tr, "markup", 3);
            detailsTree.AppendColumn(col4);

            TreeViewColumn col5 = new TreeViewColumn();

            col5.Expand = false;
//			col5.Alignment = 0.5f;
            col5.Widget = new ImageView(TestStatusIcon.NotRun);
            col5.Widget.Show();
            tr = new CellRendererText();
//			tr.Xalign = 0.5f;
            col5.PackStart(tr, false);
            col5.AddAttribute(tr, "markup", 4);
            detailsTree.AppendColumn(col5);

            TreeViewColumn col1 = new TreeViewColumn();

//			col1.Resizable = true;
//			col1.Expand = true;
            col1.Title = "Test";
            col1.PackStart(trtest, true);
            col1.AddAttribute(trtest, "markup", 1);
            detailsTree.AppendColumn(col1);

            detailsTree.Model = detailsStore;

            sw.Add(detailsTree);
            tf.Add(sw);
            tf.ShowAll();

            TestSummaryPage = infoBook.AddPage(GettextCatalog.GetString("Summary"), tf);

            // Info - Regressions list

            tf = new Frame();
            sw = new ScrolledWindow();
            tf.Add(sw);
            regressionTree = new TreeView();
            regressionTree.HeadersVisible = false;
            regressionTree.RulesHint      = true;
            regressionStore = new ListStore(typeof(object), typeof(string), typeof(Xwt.Drawing.Image));

            CellRendererText trtest2 = new CellRendererText();
            var pr = new CellRendererImage();

            TreeViewColumn col = new TreeViewColumn();

            col.PackStart(pr, false);
            col.AddAttribute(pr, "image", 2);
            col.PackStart(trtest2, false);
            col.AddAttribute(trtest2, "markup", 1);
            regressionTree.AppendColumn(col);
            regressionTree.Model = regressionStore;
            sw.Add(regressionTree);
            tf.ShowAll();

            TestRegressionsPage = infoBook.AddPage(GettextCatalog.GetString("Regressions"), tf);

            // Info - Failed tests list

            tf = new Frame();
            sw = new ScrolledWindow();
            tf.Add(sw);
            failedTree = new TreeView();
            failedTree.HeadersVisible = false;
            failedTree.RulesHint      = true;
            failedStore = new ListStore(typeof(object), typeof(string), typeof(Xwt.Drawing.Image));

            trtest2 = new CellRendererText();
            pr      = new CellRendererImage();

            col = new TreeViewColumn();
            col.PackStart(pr, false);
            col.AddAttribute(pr, "image", 2);
            col.PackStart(trtest2, false);
            col.AddAttribute(trtest2, "markup", 1);
            failedTree.AppendColumn(col);
            failedTree.Model = failedStore;
            sw.Add(failedTree);
            tf.ShowAll();

            TestFailuresPage = infoBook.AddPage(GettextCatalog.GetString("Failed tests"), tf);

            // Info - results

            tf = new Frame();
            sw = new ScrolledWindow();
            tf.Add(sw);
            resultView          = new TextView();
            resultView.Editable = false;
            sw.Add(resultView);
            tf.ShowAll();
            TestResultPage = infoBook.AddPage(GettextCatalog.GetString("Result"), tf);

            // Info - Output

            tf = new Frame();
            sw = new ScrolledWindow();
            tf.Add(sw);
            outputView          = new TextView();
            outputView.Editable = false;
            sw.Add(outputView);
            tf.ShowAll();
            TestOutputPage = infoBook.AddPage(GettextCatalog.GetString("Output"), tf);

            panedDetails.Pack2(infoBook, true, true);
            detailsPad.PackStart(panedDetails, true, true, 0);
            paned.Pack2(detailsPad, true, true);

            paned.ShowAll();

            infoBook.HidePage(TestResultPage);
            infoBook.HidePage(TestOutputPage);
            infoBook.HidePage(TestSummaryPage);
            infoBook.HidePage(TestRegressionsPage);
            infoBook.HidePage(TestFailuresPage);

            detailsPad.Sensitive = false;
            detailsPad.Hide();

            detailsTree.RowActivated    += new Gtk.RowActivatedHandler(OnTestActivated);
            regressionTree.RowActivated += new Gtk.RowActivatedHandler(OnRegressionTestActivated);
            failedTree.RowActivated     += new Gtk.RowActivatedHandler(OnFailedTestActivated);

            foreach (UnitTest t in testService.RootTests)
            {
                TreeView.AddChild(t);
            }
        }
예제 #32
0
        public ExploreView(ICredentialsProvider credentialsProvider,
											 int stopAfter)
            : base(false, 1)
        {
            this.credentialsProvider = credentialsProvider;

                HPaned hPaned = new HPaned();
                Add(hPaned);

                {
                    ScrolledWindowBase scrolledWindow1 = new ScrolledWindowBase();
                    hPaned.Add1(scrolledWindow1);

                    repositoryView = new RepositoryView(this, credentialsProvider);
                    scrolledWindow1.Add(repositoryView);
                }

                viewChildren = new VPaned();
                {
                    ScrolledWindowBase scrolledWindow2 = new ScrolledWindowBase();
                    viewChildren.Pack1(scrolledWindow2, true, true);

                    directoryView = new DirectoryView(this);
                    scrolledWindow2.Add(directoryView);

                    ScrolledWindowBase scrolledWindow3 = new ScrolledWindowBase();
                    viewChildren.Pack2(scrolledWindow3, true, true);

                    changesetView = new ChangesetView(this, stopAfter);
                    scrolledWindow3.Add(changesetView);

                    int x, y, width, height, depth;
                    RootWindow.GetGeometry (out x, out y, out width, out height, out depth);

                    hPaned.Add2(viewChildren);
                    hPaned.Position = (width - 50) / 3;
                }

                // add status bar
                statusbar = new Statusbar ();
                statusbar.HasResizeGrip = false;
                PackEnd(statusbar, false, false, 1);

                Assembly entry = Assembly.GetEntryAssembly();
                StatusMessage(String.Format("{0} version {1}", entry.GetName().Name,
                                                                        entry.GetName().Version.ToString()));

                ShowAll();
                repositoryView.Selection.Changed += OnPathSelectionChanged;
        }
		public SqlQueryView ()
		{
			stoppedQueries = new List<object> ();
			MonoDevelop.SourceEditor.Extension.TemplateExtensionNodeLoader.Init ();
			this.UntitledName = string.Concat (AddinCatalog.GetString ("Untitled Sql Script"), ".sql");
			
			vbox = new VBox (false, 6);
			vbox.BorderWidth = 6;
			
			Toolbar toolbar = new Toolbar ();
			toolbar.ToolbarStyle = ToolbarStyle.BothHoriz;
			
			buttonExecute = new ToolButton (ImageService.GetImage ("md-db-execute", IconSize.SmallToolbar),
			                                AddinCatalog.GetString ("_Execute"));
			buttonExecute.Label = AddinCatalog.GetString ("Execute");
			buttonExecute.Sensitive = false;
			buttonExecute.TooltipMarkup = AddinCatalog.GetString ("Execute Query");
			buttonExecute.IsImportant = true;
			buttonExecute.Clicked += new EventHandler (ExecuteClicked);

			buttonStop = new ToolButton ("gtk-stop");
			buttonStop.TooltipText = AddinCatalog.GetString ("Stop Query Execution");
			buttonStop.Sensitive = false;
			buttonStop.Clicked += new EventHandler (StopClicked);
			
			buttonClear = new ToolButton (ImageService.GetImage ("gtk-clear", IconSize.Button), 
			                              AddinCatalog.GetString ("Clear Results"));
			buttonClear.TooltipText = AddinCatalog.GetString ("Clear Results");
			buttonClear.Clicked += new EventHandler (ClearClicked);
			
			comboConnections = new DatabaseConnectionContextComboBox ();
			selectedConnection = comboConnections.DatabaseConnection;
			comboConnections.Changed += new EventHandler (ConnectionChanged);
			ToolItem comboItem = new ToolItem ();
			comboItem.Child = comboConnections;
			
			toolbar.Add (buttonExecute);
			toolbar.Add (buttonStop);
			toolbar.Add (buttonClear);
			toolbar.Add (new SeparatorToolItem ());
			toolbar.Add (comboItem);
			
			pane = new VPaned ();

			// Sql History Window
			ScrolledWindow windowHistory = new ScrolledWindow ();
			history = new SqlEditorWidget ();
			history.Editable = false;
			windowHistory.AddWithViewport (history);
			
			// Status of the Last Query
			ScrolledWindow windowStatus = new ScrolledWindow ();
			status = new TextView ();
			windowStatus.Add (status);
			
			notebook = new Notebook ();
			notebook.AppendPage (windowStatus, new Label (AddinCatalog.GetString ("Status")));
			notebook.AppendPage (windowHistory, new Label (AddinCatalog.GetString ("Query History")));
			
			pane.Pack2 (notebook, true, true);
			vbox.PackStart (toolbar, false, true, 0);
			vbox.PackStart (pane, true, true, 0);
			this.Document.TextReplaced += SqlChanged;
			vbox.ShowAll ();
			Document.DocumentUpdated += delegate (object sender, EventArgs args) {
				// Default mime type or a provider defined.
				if (selectedConnection == null)
					Document.MimeType = "text/x-sql";
				else 
					Document.MimeType = GetMimeType ();
				
			};
			notebook.Hide ();
		}
예제 #34
0
        /// <summary>
        /// Initializes all GUI components.
        /// </summary>
        /// <history>
        /// [Curtis_Beard]      11/03/2006  Created
        /// </history>
        private void InitializeComponent()
        {
            this.SetDefaultSize (Core.GeneralSettings.WindowWidth, Core.GeneralSettings.WindowHeight);
             if (Core.GeneralSettings.WindowLeft == -1 && Core.GeneralSettings.WindowTop == -1)
            this.SetPosition(WindowPosition.Center);
             else
            this.Move(Core.GeneralSettings.WindowLeft, Core.GeneralSettings.WindowTop);

             this.DeleteEvent += new DeleteEventHandler(OnWindowDelete);
             this.Title = Constants.ProductName;
             this.Icon = Images.GetPixbuf("AstroGrep_Icon.ico");

             MainTooltips = new Tooltips();

             VBox vbox = new VBox();
             vbox.BorderWidth = 0;

             Frame leftFrame = new Frame();
             leftFrame.Shadow = ShadowType.In;
             leftFrame.WidthRequest = 200;

             VBox searchBox = new VBox();
             VBox searchOptionsBox = new VBox();
             searchBox.BorderWidth = 3;
             searchOptionsBox.BorderWidth = 3;
             lblSearchStart = new Label("Search Path");
             lblSearchStart.SetAlignment(0,0);

             btnBrowse = new Button();
             btnBrowse.SetSizeRequest(32, 20);
             Gtk.Image img = new Image();
             img.Pixbuf = Images.GetPixbuf("folder-open.png");
             VBox browseBox = new VBox();
             browseBox.PackStart(img, false, false, 0);
             MainTooltips.SetTip(btnBrowse, "Select the folder to start the search", "");
             btnBrowse.Clicked += new EventHandler(btnBrowse_Clicked);
             btnBrowse.Add(browseBox);

             cboSearchStart = ComboBoxEntry.NewText();
             cboSearchFilter = ComboBoxEntry.NewText();
             cboSearchText = ComboBoxEntry.NewText();

             LoadComboBoxEntry(cboSearchStart, Core.GeneralSettings.SearchStarts, true);
             LoadComboBoxEntry(cboSearchFilter, Core.GeneralSettings.SearchFilters, false);
             LoadComboBoxEntry(cboSearchText, Core.GeneralSettings.SearchTexts, false);

             cboSearchStart.Changed += new EventHandler(cboSearchStart_Changed);
             lblSearchFilter = new Label("File Types");
             lblSearchFilter.SetAlignment(0,0);
             lblSearchText = new Label("Search Text");
             lblSearchText.SetAlignment(0,0);

             // search path
             VBox startVBox = new VBox();
             startVBox.BorderWidth = 0;
             cboSearchStart.WidthRequest = 100;
             SetActiveComboBoxEntry(cboSearchStart);

             HBox startHBox = new HBox();
             startHBox.BorderWidth = 0;
             startHBox.PackStart(cboSearchStart, true, true, 0);
             startHBox.PackEnd(btnBrowse, false, false, 0);

             startVBox.PackStart(lblSearchStart, false, false, 0);
             startVBox.PackStart(startHBox, true, false, 0);
             searchBox.PackStart(startVBox, true, false, 0);

             // search filter
             VBox filterVBox = new VBox();
             cboSearchFilter.Active = 0;
             filterVBox.BorderWidth = 0;
             filterVBox.PackStart(lblSearchFilter, false, false, 0);
             filterVBox.PackStart(cboSearchFilter, true, false, 0);
             searchBox.PackStart(filterVBox, true, false, 0);

             // search text
             VBox textVBox = new VBox();
             cboSearchText.Active = 0;
             textVBox.BorderWidth = 0;
             textVBox.PackStart(lblSearchText, false, false, 0);
             textVBox.PackStart(cboSearchText, true, false, 0);
             searchBox.PackStart(textVBox, true, false, 0);

             // Search/Cancel buttons
             searchBox.PackStart(CreateButtons(), false, false, 0);

             // Search Options
             chkRegularExpressions = new CheckButton("Regular Expressions");
             chkCaseSensitive = new CheckButton("Case Sensitive");
             chkWholeWord = new CheckButton("Whole Word");
             chkRecurse = new CheckButton("Recurse");
             chkFileNamesOnly = new CheckButton("Show File Names Only");
             chkFileNamesOnly.Clicked += new EventHandler(chkFileNamesOnly_Clicked);
             chkNegation = new CheckButton("Negation");
             chkNegation.Clicked += new EventHandler(chkNegation_Clicked);
             chkLineNumbers = new CheckButton("Line Numbers");
             cboContextLines = ComboBox.NewText();
             cboContextLines.WidthRequest = 100;
             cboContextLines.WrapWidth = 3;
             for (int i = 0; i <= Constants.MAX_CONTEXT_LINES; i++)
            cboContextLines.AppendText(i.ToString());
             lblContextLines = new Label("Context Lines");
             HBox cxtBox = new HBox();
             cxtBox.BorderWidth = 0;
             cxtBox.PackStart(cboContextLines, false, false, 3);
             cxtBox.PackStart(lblContextLines, false, false, 3);

             searchOptionsBox.PackStart(chkRegularExpressions, true, false, 0);
             searchOptionsBox.PackStart(chkCaseSensitive, true, false, 0);
             searchOptionsBox.PackStart(chkWholeWord, true, false, 0);
             searchOptionsBox.PackStart(chkRecurse, true, false, 0);
             searchOptionsBox.PackStart(chkFileNamesOnly, true, false, 0);
             searchOptionsBox.PackStart(chkNegation, true, false, 0);
             searchOptionsBox.PackStart(chkLineNumbers, true, false, 0);
             searchOptionsBox.PackStart(cxtBox, true, false, 0);
             searchBox.PackEnd(searchOptionsBox, true, true, 0);

             leftFrame.Add(searchBox);

             panelLeft = new HPaned();
             panelLeft.BorderWidth = 0;
             panelRight = new VPaned();
             panelRight.BorderWidth = 0;

             // File List
             Gtk.Frame treeFrame = new Gtk.Frame();
             treeFrame.Shadow = ShadowType.In;
             Gtk.ScrolledWindow treeWin = new Gtk.ScrolledWindow();
             tvFiles = new Gtk.TreeView ();
             SetColumnsText();

             tvFiles.Model = new ListStore(typeof (string), typeof (string), typeof (string), typeof (string), typeof (int));
             (tvFiles.Model as ListStore).DefaultSortFunc = new TreeIterCompareFunc(DefaultTreeIterCompareFunc);
             tvFiles.Selection.Changed += new EventHandler(Tree_OnSelectionChanged);
             tvFiles.RowActivated += new RowActivatedHandler(tvFiles_RowActivated);

             tvFiles.RulesHint = true;
             tvFiles.HeadersClickable = true;
             tvFiles.HeadersVisible = true;
             tvFiles.Selection.Mode = SelectionMode.Multiple;

             SetSortingFunctions();

             treeWin.Add(tvFiles);
             treeFrame.BorderWidth = 0;
             treeFrame.Add(treeWin);

             // txtHits
             Gtk.Frame ScrolledWindowFrm = new Gtk.Frame();
             ScrolledWindowFrm.Shadow = ShadowType.In;
             Gtk.ScrolledWindow TxtViewWin = new Gtk.ScrolledWindow();
             txtViewer = new Gtk.TextView();
             txtViewer.Buffer.Text = "";
             txtViewer.Editable = false;
             TxtViewWin.Add(txtViewer);
             ScrolledWindowFrm.BorderWidth = 0;
             ScrolledWindowFrm.Add(TxtViewWin);

             // Add file list and txtHits to right panel
             panelRight.Pack1(treeFrame, true, true);
             panelRight.Pack2(ScrolledWindowFrm, true, true);

            // TLW

            //Notebook notebook = new Notebook();
            //    Table table = new Table(3, 6);

            // Create a new notebook, place the position of the tabs
              //  table.attach(notebook, 0, 6, 0, 1);

             // Status Bar
             sbStatus = new Statusbar();

             #region Menu bar

             agMenuAccel = new AccelGroup();
             this.AddAccelGroup(agMenuAccel);

             mbMain = new Gtk.MenuBar();

             // File menu
             mnuFile = new Menu();
             MenuItem mnuFileItem = new MenuItem("_File");
             mnuFileItem.Submenu = mnuFile;
             mnuFile.AccelGroup = agMenuAccel;
             mnuFile.Shown += new EventHandler(mnuFile_Shown);

             // Edit menu
             mnuEdit = new Menu();
             MenuItem mnuEditItem = new MenuItem("_Edit");
             mnuEditItem.Submenu = mnuEdit;
             mnuEdit.AccelGroup = agMenuAccel;
             mnuEdit.Shown += new EventHandler(mnuEdit_Shown);

             // Tools menu
             mnuTools = new Menu();
             MenuItem mnuToolsItem = new MenuItem("_Tools");
             mnuToolsItem.Submenu = mnuTools;
             mnuTools.AccelGroup = agMenuAccel;

             // Help menu
             mnuHelp = new Menu();
             MenuItem mnuHelpItem = new MenuItem("_Help");
             mnuHelpItem.Submenu = mnuHelp;
             mnuHelp.AccelGroup = agMenuAccel;

             // File Save menu item
             SaveMenuItem = new ImageMenuItem(Stock.Save, agMenuAccel);
             SaveMenuItem.Activated += new EventHandler(SaveMenuItem_Activated);
             mnuFile.Append(SaveMenuItem);

             // File Print menu item
             PrintMenuItem = new ImageMenuItem(Stock.Print, agMenuAccel);
             PrintMenuItem.Activated += new EventHandler(PrintMenuItem_Activated);
             mnuFile.Append(PrintMenuItem);

             // File Separator menu item
             SeparatorMenuItem Separator1MenuItem = new SeparatorMenuItem();
             mnuFile.Append(Separator1MenuItem);

             // File Exit menu item
             ExitMenuItem = new ImageMenuItem(Stock.Quit, agMenuAccel);
             ExitMenuItem.Activated += new EventHandler(ExitMenuItem_Activated);
             mnuFile.Append(ExitMenuItem);

             // Edit Select All menu item
             SelectAllMenuItem = new ImageMenuItem("_Select All Files", agMenuAccel);
             SelectAllMenuItem.Activated += new EventHandler(SelectAllMenuItem_Activated);
             mnuEdit.Append(SelectAllMenuItem);

             // Edit Open Selected menu item
             OpenSelectedMenuItem = new ImageMenuItem("_Open Selected Files", agMenuAccel);
             OpenSelectedMenuItem.Activated += new EventHandler(OpenSelectedMenuItem_Activated);
             mnuEdit.Append(OpenSelectedMenuItem);

             // Create preferences for every other os except windows
             if (!Common.IsWindows)
             {
            Separator1MenuItem = new SeparatorMenuItem();
            mnuEdit.Append(Separator1MenuItem);

            // Preferences
            Gtk.ImageMenuItem OptionsMenuItem = new ImageMenuItem(Stock.Preferences, agMenuAccel);
            OptionsMenuItem.Activated += new EventHandler(OptionsMenuItem_Activated);
            mnuEdit.Append(OptionsMenuItem);
             }

             // Clear MRU List
             Gtk.ImageMenuItem ClearMRUsMenuItem = new ImageMenuItem("_Clear Most Recently Used Lists", agMenuAccel);
             ClearMRUsMenuItem.Activated += new EventHandler(ClearMRUsMenuItem_Activated);
             mnuTools.Append(ClearMRUsMenuItem);

             Separator1MenuItem = new SeparatorMenuItem();
             mnuTools.Append(Separator1MenuItem);

             // Save Search Options
             Gtk.ImageMenuItem SaveOptionsMenuItem = new ImageMenuItem("_Save Search Options", agMenuAccel);
             SaveOptionsMenuItem.Activated += new EventHandler(SaveOptionsMenuItem_Activated);
             mnuTools.Append(SaveOptionsMenuItem);

             // Create Options menu for windows
             if (Common.IsWindows)
             {
            // Options menu item
            Gtk.ImageMenuItem OptionsMenuItem = new ImageMenuItem("_Options...", agMenuAccel);
            OptionsMenuItem.Activated += new EventHandler(OptionsMenuItem_Activated);
            OptionsMenuItem.Image = new Gtk.Image(Stock.Preferences, IconSize.Menu);
            mnuTools.Append(OptionsMenuItem);
             }

             // Help About menu item
             MenuItem AboutMenuItem = new ImageMenuItem(Stock.About, agMenuAccel);
             AboutMenuItem.Activated += new EventHandler(AboutMenuItem_Activated);
             mnuHelp.Append(AboutMenuItem);

             // Add the menus to the menubar
             mbMain.Append(mnuFileItem);
             mbMain.Append(mnuEditItem);
             mbMain.Append(mnuToolsItem);
             mbMain.Append(mnuHelpItem);

             // Add the menubar to the Menu panel
             vbox.PackStart(mbMain, false, false, 0);

             #endregion

             // add items to container
             panelLeft.Pack1(leftFrame, true, false);

             // TLW
             //panelLeft.Pack2(tabControl, true, false);
             panelLeft.Pack2(panelRight, true, false);

             // set starting position of splitter
             panelLeft.Position = Core.GeneralSettings.WindowSearchPanelWidth;
             panelRight.Position = Core.GeneralSettings.WindowFilePanelHeight;

             vbox.PackStart(panelLeft, true, true, 0);
             vbox.PackEnd(sbStatus, false, true, 3);

             this.Add (vbox);

             this.ShowAll ();
        }
예제 #35
0
		public override void Initialize (NodeBuilder[] builders, TreePadOption[] options, string menuPath)
		{
			base.Initialize (builders, options, menuPath);
			
			testChangedHandler = (EventHandler) DispatchService.GuiDispatch (new EventHandler (OnDetailsTestChanged));
			testService.TestSuiteChanged += (EventHandler) DispatchService.GuiDispatch (new EventHandler (OnTestSuiteChanged));
			paned = new VPaned ();
			
			VBox vbox = new VBox ();
			DockItemToolbar topToolbar = Window.GetToolbar (PositionType.Top);
			
			buttonRunAll = new Button (new Gtk.Image (Gtk.Stock.GoUp, IconSize.Menu));
			buttonRunAll.Clicked += new EventHandler (OnRunAllClicked);
			buttonRunAll.Sensitive = true;
			buttonRunAll.TooltipText = GettextCatalog.GetString ("Run all tests");
			topToolbar.Add (buttonRunAll);
			
			buttonRun = new Button (new Gtk.Image (Gtk.Stock.Execute, IconSize.Menu));
			buttonRun.Clicked += new EventHandler (OnRunClicked);
			buttonRun.Sensitive = true;
			buttonRun.TooltipText = GettextCatalog.GetString ("Run test");
			topToolbar.Add (buttonRun);
			
			buttonStop = new Button (new Gtk.Image (Gtk.Stock.Stop, IconSize.Menu));
			buttonStop.Clicked += new EventHandler (OnStopClicked);
			buttonStop.Sensitive = false;
			buttonStop.TooltipText = GettextCatalog.GetString ("Cancel running test");
			topToolbar.Add (buttonStop);
			topToolbar.ShowAll ();
			
			vbox.PackEnd (base.Control, true, true, 0);
			vbox.FocusChain = new Gtk.Widget [] { base.Control };
			
			paned.Pack1 (vbox, true, true);
			
			detailsPad = new VBox ();
			
			EventBox eb = new EventBox ();
			HBox header = new HBox ();
			eb.Add (header);

			detailLabel = new HeaderLabel ();
			detailLabel.Padding = 6;
			
			Button hb = new Button (new Gtk.Image ("gtk-close", IconSize.SmallToolbar));
			hb.Relief = ReliefStyle.None;
			hb.Clicked += new EventHandler (OnCloseDetails);
			header.PackEnd (hb, false, false, 0);
			
			hb = new Button (new Gtk.Image ("gtk-go-back", IconSize.SmallToolbar));
			hb.Relief = ReliefStyle.None;
			hb.Clicked += new EventHandler (OnGoBackTest);
			header.PackEnd (hb, false, false, 0);
			
			header.Add (detailLabel);
			Gdk.Color hcol = eb.Style.Background (StateType.Normal);
			hcol.Red = (ushort) (((double)hcol.Red) * 0.9);
			hcol.Green = (ushort) (((double)hcol.Green) * 0.9);
			hcol.Blue = (ushort) (((double)hcol.Blue) * 0.9);
		//	eb.ModifyBg (StateType.Normal, hcol);
			
			detailsPad.PackStart (eb, false, false, 0);
			
			VPaned panedDetails = new VPaned ();
			panedDetails.BorderWidth = 3;
			VBox boxPaned1 = new VBox ();
			
			chart = new TestChart ();
			chart.ButtonPressEvent += OnChartButtonPress;
			chart.SelectionChanged += new EventHandler (OnChartDateChanged);
			chart.HeightRequest = 50;
			
			Toolbar toolbar = new Toolbar ();
			toolbar.IconSize = IconSize.SmallToolbar;
			toolbar.ToolbarStyle = ToolbarStyle.Icons;
			toolbar.ShowArrow = false;
			ToolButton but = new ToolButton ("gtk-zoom-in");
			but.Clicked += new EventHandler (OnZoomIn);
			toolbar.Insert (but, -1);
			
			but = new ToolButton ("gtk-zoom-out");
			but.Clicked += new EventHandler (OnZoomOut);
			toolbar.Insert (but, -1);
			
			but = new ToolButton ("gtk-go-back");
			but.Clicked += new EventHandler (OnChartBack);
			toolbar.Insert (but, -1);
			
			but = new ToolButton ("gtk-go-forward");
			but.Clicked += new EventHandler (OnChartForward);
			toolbar.Insert (but, -1);
			
			but = new ToolButton ("gtk-goto-last");
			but.Clicked += new EventHandler (OnChartLast);
			toolbar.Insert (but, -1);
			
			boxPaned1.PackStart (toolbar, false, false, 0);
			boxPaned1.PackStart (chart, true, true, 0);
			
			panedDetails.Pack1 (boxPaned1, false, false);
			
			// Detailed test information --------
			
			infoBook = new ButtonNotebook ();
			infoBook.PageLoadRequired += new EventHandler (OnPageLoadRequired);
			
			// Info - Group summary
			
			Frame tf = new Frame ();
			ScrolledWindow sw = new ScrolledWindow ();
			detailsTree = new TreeView ();
			
			detailsTree.HeadersVisible = true;
			detailsTree.RulesHint = true;
			detailsStore = new ListStore (typeof(object), typeof(string), typeof (string), typeof (string), typeof (string));
			
			CellRendererText trtest = new CellRendererText ();
			CellRendererText tr;
			
			TreeViewColumn col3 = new TreeViewColumn ();
			col3.Expand = false;
//			col3.Alignment = 0.5f;
			col3.Widget = new Gtk.Image (CircleImage.Success);
			col3.Widget.Show ();
			tr = new CellRendererText ();
//			tr.Xalign = 0.5f;
			col3.PackStart (tr, false);
			col3.AddAttribute (tr, "markup", 2);
			detailsTree.AppendColumn (col3);
			
			TreeViewColumn col4 = new TreeViewColumn ();
			col4.Expand = false;
//			col4.Alignment = 0.5f;
			col4.Widget = new Gtk.Image (CircleImage.Failure);
			col4.Widget.Show ();
			tr = new CellRendererText ();
//			tr.Xalign = 0.5f;
			col4.PackStart (tr, false);
			col4.AddAttribute (tr, "markup", 3);
			detailsTree.AppendColumn (col4);
			
			TreeViewColumn col5 = new TreeViewColumn ();
			col5.Expand = false;
//			col5.Alignment = 0.5f;
			col5.Widget = new Gtk.Image (CircleImage.NotRun);
			col5.Widget.Show ();
			tr = new CellRendererText ();
//			tr.Xalign = 0.5f;
			col5.PackStart (tr, false);
			col5.AddAttribute (tr, "markup", 4);
			detailsTree.AppendColumn (col5);
			
			TreeViewColumn col1 = new TreeViewColumn ();
//			col1.Resizable = true;
//			col1.Expand = true;
			col1.Title = "Test";
			col1.PackStart (trtest, true);
			col1.AddAttribute (trtest, "markup", 1);
			detailsTree.AppendColumn (col1);
			
			detailsTree.Model = detailsStore;
			
			sw.Add (detailsTree);
			tf.Add (sw);
			tf.ShowAll ();
			
			TestSummaryPage = infoBook.AddPage (GettextCatalog.GetString ("Summary"), tf);
			
			// Info - Regressions list
			
			tf = new Frame ();
			sw = new ScrolledWindow ();
			tf.Add (sw);
			regressionTree = new TreeView ();
			regressionTree.HeadersVisible = false;
			regressionTree.RulesHint = true;
			regressionStore = new ListStore (typeof(object), typeof(string), typeof (Pixbuf));
			
			CellRendererText trtest2 = new CellRendererText ();
			var pr = new CellRendererPixbuf ();
			
			TreeViewColumn col = new TreeViewColumn ();
			col.PackStart (pr, false);
			col.AddAttribute (pr, "pixbuf", 2);
			col.PackStart (trtest2, false);
			col.AddAttribute (trtest2, "markup", 1);
			regressionTree.AppendColumn (col);
			regressionTree.Model = regressionStore;
			sw.Add (regressionTree);
			tf.ShowAll ();
			
			TestRegressionsPage = infoBook.AddPage (GettextCatalog.GetString ("Regressions"), tf);
			
			// Info - Failed tests list
			
			tf = new Frame ();
			sw = new ScrolledWindow ();
			tf.Add (sw);
			failedTree = new TreeView ();
			failedTree.HeadersVisible = false;
			failedTree.RulesHint = true;
			failedStore = new ListStore (typeof(object), typeof(string), typeof (Pixbuf));
			
			trtest2 = new CellRendererText ();
			pr = new CellRendererPixbuf ();
			
			col = new TreeViewColumn ();
			col.PackStart (pr, false);
			col.AddAttribute (pr, "pixbuf", 2);
			col.PackStart (trtest2, false);
			col.AddAttribute (trtest2, "markup", 1);
			failedTree.AppendColumn (col);
			failedTree.Model = failedStore;
			sw.Add (failedTree);
			tf.ShowAll ();
			
			TestFailuresPage = infoBook.AddPage (GettextCatalog.GetString ("Failed tests"), tf);
			
			// Info - results
			
			tf = new Frame ();
			sw = new ScrolledWindow ();
			tf.Add (sw);
			resultView = new TextView ();
			resultView.Editable = false;
			sw.Add (resultView);
			tf.ShowAll ();
			TestResultPage = infoBook.AddPage (GettextCatalog.GetString ("Result"), tf);
			
			// Info - Output
			
			tf = new Frame ();
			sw = new ScrolledWindow ();
			tf.Add (sw);
			outputView = new TextView ();
			outputView.Editable = false;
			sw.Add (outputView);
			tf.ShowAll ();
			TestOutputPage = infoBook.AddPage (GettextCatalog.GetString ("Output"), tf);
			
			panedDetails.Pack2 (infoBook, true, true);
			detailsPad.PackStart (panedDetails, true, true, 0);
			paned.Pack2 (detailsPad, true, true);
			
			paned.ShowAll ();
			
			infoBook.HidePage (TestResultPage);
			infoBook.HidePage (TestOutputPage);
			infoBook.HidePage (TestSummaryPage);
			infoBook.HidePage (TestRegressionsPage);
			infoBook.HidePage (TestFailuresPage);
			
			detailsPad.Sensitive = false;
			detailsPad.Hide ();
			
			detailsTree.RowActivated += new Gtk.RowActivatedHandler (OnTestActivated);
			regressionTree.RowActivated += new Gtk.RowActivatedHandler (OnRegressionTestActivated);
			failedTree.RowActivated += new Gtk.RowActivatedHandler (OnFailedTestActivated);
			
			foreach (UnitTest t in testService.RootTests)
				TreeView.AddChild (t);
		}
예제 #36
0
        internal PropertyGrid(EditorManager editorManager)
            : base(false, 0)
        {
            this.editorManager = editorManager;

            tips = new Tooltips ();

            #region Toolbar
            toolbar = new Toolbar ();
            toolbar.ToolbarStyle = ToolbarStyle.Icons;
            toolbar.IconSize = IconSize.SmallToolbar;
            base.PackStart (toolbar, false, false, 0);

            catButton = new RadioToolButton (new GLib.SList (IntPtr.Zero));
            catButton.IconWidget = new Image (new Gdk.Pixbuf (null, "AspNetEdit.UI.PropertyGrid.SortByCat.png"));
            catButton.SetTooltip (tips, "Sort in categories", null);
            catButton.Toggled += new EventHandler (toolbarClick);
            toolbar.Insert (catButton, 0);

            alphButton = new RadioToolButton (catButton, Stock.SortAscending);
            alphButton.SetTooltip (tips, "Sort alphabetically", null);
            alphButton.Clicked += new EventHandler (toolbarClick);
            toolbar.Insert (alphButton, 1);

            catButton.Active = true;

            SeparatorToolItem sep = new SeparatorToolItem();
            toolbar.Insert (sep, 2);

            #endregion

            vpaned = new VPaned ();

            descFrame = new Frame ();
            descFrame.Shadow = ShadowType.In;

            desc = new VBox (false, 0);
            descFrame.Add (desc);

            descTitle = new Label ();
            descTitle.SetAlignment(0, 0);
            descTitle.SetPadding (5, 5);
            descTitle.UseMarkup = true;
            desc.PackStart (descTitle, false, false, 0);

            textScroll = new ScrolledWindow ();
            textScroll.HscrollbarPolicy = PolicyType.Never;
            textScroll.VscrollbarPolicy = PolicyType.Automatic;

            desc.PackEnd (textScroll, true, true, 0);

            //TODO: Use label, but wrapping seems dodgy.
            descText = new TextView ();
            descText.WrapMode = WrapMode.Word;
            descText.WidthRequest = 1;
            descText.HeightRequest = 100;
            descText.Editable = false;
            descText.LeftMargin = 5;
            descText.RightMargin = 5;
            textScroll.Add (descText);

            scrolledWindow = new ScrolledWindow ();
            scrolledWindow.HscrollbarPolicy = PolicyType.Automatic;
            scrolledWindow.VscrollbarPolicy = PolicyType.Automatic;

            vpaned.Pack1 (scrolledWindow, true, true);
            vpaned.Pack2 (descFrame, false, true);

            AddPropertyTab (new DefaultPropertyTab ());
            AddPropertyTab (new EventPropertyTab ());

            base.PackEnd (vpaned);
            Populate ();
        }