Ejemplo n.º 1
0
        public windowTerminalVTE(clsHost host)
            : base(String.Format("{0} - {1}:{2}",host.Name,host.RemoteHost,host.RemoteSSHPort))
        {
            SSH = new clsSSHTerminal(host);

            Host = host;
            HBox hbox = new HBox ();
            term = new Terminal ();
            term.CursorBlinks = true;
            term.MouseAutohide = false;
            term.ScrollOnKeystroke = true;
            term.DeleteBinding = TerminalEraseBinding.Auto;
            term.BackspaceBinding = TerminalEraseBinding.Auto;
            term.FontFromString = host.TerminalFont;
            term.Emulation = "xterm";
            term.Encoding = "UTF-8";

            term.SetSize(host.TerminalCols,host.TerminalRows);

            VScrollbar vscroll = new VScrollbar (term.Adjustment);
            hbox.PackStart (term);
            hbox.PackStart (vscroll);

            this.CanFocus = true;

            this.Add (hbox);
            ShowAll ();

            SSH.TerminalData += (string text) =>
            {
                Gtk.Application.Invoke (delegate {
                    term.Feed(text);
                });
            };
        }
		public DropDownBoxListWindow (IListDataProvider provider) : base(Gtk.WindowType.Popup)
		{
			this.DataProvider = provider;
			this.TransientFor = MonoDevelop.Ide.IdeApp.Workbench.RootWindow;
			this.TypeHint = Gdk.WindowTypeHint.Menu;
			this.BorderWidth = 1;
			this.Events |= Gdk.EventMask.KeyPressMask;
			hBox = new HBox ();
			list = new ListWidget (this);
			list.SelectItem += delegate {
				var sel = list.Selection;
				if (sel >= 0 && sel < DataProvider.IconCount) {
					DataProvider.ActivateItem (sel);
					Destroy ();
				}
			};
			
			list.ScrollEvent += HandleListScrollEvent;
			list.SizeAllocated += delegate {
				QueueResize ();
			};
			list.PageChanged += HandleListPageChanged;
			hBox.PackStart (list, true, true, 0);
			
			vScrollbar = new VScrollbar (null);
			vScrollbar.ValueChanged += delegate {
				list.ForcePage ((int)vScrollbar.Value);
			};
			
			hBox.PackStart (vScrollbar, false, false, 0);
			Add (hBox);
			ShowAll ();
		}
Ejemplo n.º 3
0
        public BlameWidget(VersionControlDocumentInfo info)
        {
            this.info = info;

            vAdjustment          = new Adjustment(0, 0, 0, 0, 0, 0);
            vAdjustment.Changed += HandleAdjustmentChanged;

            vScrollBar = new VScrollbar(vAdjustment);
            AddChild(vScrollBar);

            hAdjustment          = new Adjustment(0, 0, 0, 0, 0, 0);
            hAdjustment.Changed += HandleAdjustmentChanged;

            hScrollBar = new HScrollbar(hAdjustment);
            AddChild(hScrollBar);

            editor = new TextEditor(info.Document.TextEditorData.Document, info.Document.TextEditorData.Options);
            AddChild(editor);
            editor.SetScrollAdjustments(hAdjustment, vAdjustment);

            overview = new BlameRenderer(this);
            AddChild(overview);

            this.DoubleBuffered          = true;
            editor.ExposeEvent          += HandleEditorExposeEvent;
            editor.EditorOptionsChanged += delegate {
                overview.OptionsChanged();
            };
        }
Ejemplo n.º 4
0
        public BlameWidget(VersionControlDocumentInfo info)
        {
            GtkWorkarounds.FixContainerLeak(this);

            this.info = info;
            var sourceEditor = info.Document.GetContent <MonoDevelop.SourceEditor.SourceEditorView> ();

            vAdjustment = new Adjustment(
                sourceEditor.TextEditor.VAdjustment.Value,
                sourceEditor.TextEditor.VAdjustment.Lower,
                sourceEditor.TextEditor.VAdjustment.Upper,
                sourceEditor.TextEditor.VAdjustment.StepIncrement,
                sourceEditor.TextEditor.VAdjustment.PageIncrement,
                sourceEditor.TextEditor.VAdjustment.PageSize);
            vAdjustment.Changed += HandleAdjustmentChanged;

            vScrollBar = new VScrollbar(vAdjustment);
            AddChild(vScrollBar);

            hAdjustment = new Adjustment(
                sourceEditor.TextEditor.HAdjustment.Value,
                sourceEditor.TextEditor.HAdjustment.Lower,
                sourceEditor.TextEditor.HAdjustment.Upper,
                sourceEditor.TextEditor.HAdjustment.StepIncrement,
                sourceEditor.TextEditor.HAdjustment.PageIncrement,
                sourceEditor.TextEditor.HAdjustment.PageSize);
            hAdjustment.Changed += HandleAdjustmentChanged;

            hScrollBar = new HScrollbar(hAdjustment);
            AddChild(hScrollBar);

            var doc = new TextDocument(sourceEditor.TextEditor.Document.Text)
            {
                IsReadOnly = true,
                MimeType   = sourceEditor.TextEditor.Document.MimeType,
            };

            editor = new MonoTextEditor(doc, sourceEditor.TextEditor.Options);
            AddChild(editor);
            editor.SetScrollAdjustments(hAdjustment, vAdjustment);

            overview = new BlameRenderer(this);
            AddChild(overview);

            this.DoubleBuffered          = true;
            editor.Painted              += HandleEditorExposeEvent;
            editor.EditorOptionsChanged += delegate {
                overview.OptionsChanged();
            };
            editor.Caret.PositionChanged += ComparisonWidget.CaretPositionChanged;
            editor.FocusInEvent          += ComparisonWidget.EditorFocusIn;
            editor.Document.Folded       += delegate {
                QueueDraw();
            };
            editor.Document.FoldTreeUpdated += delegate {
                QueueDraw();
            };
            editor.DoPopupMenu = ShowPopup;
            Show();
        }
Ejemplo n.º 5
0
        public TerminalPad()
        {
            //FIXME look up most of these in GConf
            term = new Terminal ();
            term.ScrollOnKeystroke = true;
            term.CursorBlinks = true;
            term.MouseAutohide = true;
            term.FontFromString = "monospace 10";
            term.Encoding = "UTF-8";
            term.BackspaceBinding = TerminalEraseBinding.Auto;
            term.DeleteBinding = TerminalEraseBinding.Auto;
            term.Emulation = "xterm";

            Gdk.Color fgcolor = new Gdk.Color (0, 0, 0);
            Gdk.Color bgcolor = new Gdk.Color (0xff, 0xff, 0xff);
            Gdk.Colormap colormap = Gdk.Colormap.System;
            colormap.AllocColor (ref fgcolor, true, true);
            colormap.AllocColor (ref bgcolor, true, true);
            term.SetColors (fgcolor, bgcolor, fgcolor, 16);

            //FIXME: whats a good default here
            //term.SetSize (80, 5);

            // seems to want an array of "variable=value"
                    string[] envv = new string [Environment.GetEnvironmentVariables ().Count];
                    int i = 0;
            foreach (DictionaryEntry e in Environment.GetEnvironmentVariables ())
            {
                if (e.Key == "" || e.Value == "")
                    continue;
                envv[i] = String.Format ("{0}={1}", e.Key, e.Value);
                i ++;
            }

            term.ForkCommand (Environment.GetEnvironmentVariable ("SHELL"), Environment.GetCommandLineArgs (), envv, Environment.GetEnvironmentVariable ("HOME"), false, true, true);

            term.ChildExited += new EventHandler (OnChildExited);

            VScrollbar vscroll = new VScrollbar (term.Adjustment);

            HBox hbox = new HBox ();
            hbox.PackStart (term, true, true, 0);
            hbox.PackStart (vscroll, false, true, 0);

            frame.ShadowType = Gtk.ShadowType.In;
            ScrolledWindow sw = new ScrolledWindow ();
            sw.Add (hbox);
            frame.Add (sw);

            Control.ShowAll ();

            /*			Runtime.TaskService.CompilerOutputChanged += (EventHandler) Runtime.DispatchService.GuiDispatch (new EventHandler (SetOutput));
            projectService.StartBuild += (EventHandler) Runtime.DispatchService.GuiDispatch (new EventHandler (SelectMessageView));
            projectService.CombineClosed += (CombineEventHandler) Runtime.DispatchService.GuiDispatch (new CombineEventHandler (OnCombineClosed));
            projectService.CombineOpened += (CombineEventHandler) Runtime.DispatchService.GuiDispatch (new CombineEventHandler (OnCombineOpen));
            */
        }
Ejemplo n.º 6
0
    private Gtk.Widget CreateObjectList()
    {
        Gtk.HBox hbox = new Gtk.HBox(false, 0);

        Gtk.Adjustment vadjustment = new Gtk.Adjustment(0, 0, 100, 1, 10, 10);
        Gtk.VScrollbar scrollbar   = new Gtk.VScrollbar(vadjustment);

        hbox.PackStart(new ObjectListWidget(this, vadjustment), true, true, 0);
        hbox.PackEnd(scrollbar, false, true, 0);
        return(hbox);
    }
Ejemplo n.º 7
0
        public BlameWidget(VersionControlDocumentInfo info)
        {
            GtkWorkarounds.FixContainerLeak(this);

            this.info = info;
            var textView = info.Controller.GetContent <ITextView> ();

            vAdjustment          = new Adjustment(0, 0, 0, 0, 0, 0);
            vAdjustment.Changed += HandleAdjustmentChanged;

            vScrollBar = new VScrollbar(vAdjustment);
            AddChild(vScrollBar);

            hAdjustment          = new Adjustment(0, 0, 0, 0, 0, 0);
            hAdjustment.Changed += HandleAdjustmentChanged;

            hScrollBar = new HScrollbar(hAdjustment);
            AddChild(hScrollBar);

            var doc = new TextDocument(textView.TextSnapshot.GetText())
            {
                IsReadOnly = true,
                MimeType   = IdeServices.DesktopService.GetMimeTypeForContentType(textView.TextBuffer.ContentType)
            };
            var options = new CustomEditorOptions(DefaultSourceEditorOptions.Instance);

            options.TabsToSpaces = false;

            editor = new MonoTextEditor(doc, new SourceEditor.StyledSourceEditorOptions(options));

            AddChild(editor);
            editor.SetScrollAdjustments(hAdjustment, vAdjustment);

            overview = new BlameRenderer(this);
            AddChild(overview);

            this.DoubleBuffered          = true;
            editor.Painted              += HandleEditorExposeEvent;
            editor.EditorOptionsChanged += delegate {
                overview.OptionsChanged();
            };
            editor.Caret.PositionChanged += ComparisonWidget.CaretPositionChanged;
            editor.FocusInEvent          += ComparisonWidget.EditorFocusIn;
            editor.Document.Folded       += delegate {
                QueueDraw();
            };
            editor.Document.FoldTreeUpdated += delegate {
                QueueDraw();
            };
            editor.DoPopupMenu = ShowPopup;
            Show();
        }
Ejemplo n.º 8
0
        public windowVTETerminal(String Name, int Columns, int Rows, String FontString)
        {
            HBox hbox = new HBox ();
            term = new Terminal ();
            term.CursorBlinks = true;
            term.MouseAutohide = false;
            term.ScrollOnKeystroke = true;
            term.DeleteBinding = TerminalEraseBinding.Auto;
            term.BackspaceBinding = TerminalEraseBinding.Auto;
            term.FontFromString = FontString;
            term.Emulation = "xterm";
            term.Encoding = "UTF-8";

            term.SetSize(Columns,Rows);

            VScrollbar vscroll = new VScrollbar (term.Adjustment);
            hbox.PackStart (term);
            hbox.PackStart (vscroll);

            //			Gdk.Color white = new Gdk.Color ();
            //			Gdk.Color.Parse ("white", ref white);
            //
            //			Gdk.Color black = new Gdk.Color ();
            //			Gdk.Color.Parse ("black", ref black);
            //			term.SetColors (black, white, new Gdk.Color[]{}, 16);

            term.ButtonPressEvent += (o, args) =>
            {
                Write(args.Event.Button.ToString());
            };

            this.CanFocus = true;

            term.Show ();
            hbox.Show ();
            vscroll.Show ();
            this.Add (hbox);
            ShowAll ();

            KeyPress += (Gdk.Key key) =>
            {
                if (LocalEcho) Write(key.ToString());

                if (shellStream!=null && shellStream.CanWrite)
                    {
                         shellStream.WriteByte((byte)key);
                         shellStream.Flush();
                    }
            };
        }
        public SmartScrolledWindow()
        {
            vAdjustment          = new Adjustment(0, 0, 0, 0, 0, 0);
            vAdjustment.Changed += HandleAdjustmentChanged;

            vScrollBar        = new VScrollbar(vAdjustment);
            vScrollBar.Parent = this;
            vScrollBar.Show();

            hAdjustment          = new Adjustment(0, 0, 0, 0, 0, 0);
            hAdjustment.Changed += HandleAdjustmentChanged;

            hScrollBar        = new HScrollbar(hAdjustment);
            hScrollBar.Parent = this;
            hScrollBar.Show();
        }
Ejemplo n.º 10
0
		public SmartScrolledWindow ()
		{
			vAdjustment = new Adjustment (0, 0, 0, 0, 0, 0);
			vAdjustment.Changed += HandleAdjustmentChanged;
			
			vScrollBar = new VScrollbar (vAdjustment);
			vScrollBar.Parent = this;
			vScrollBar.Show ();
			
			hAdjustment = new Adjustment (0, 0, 0, 0, 0, 0);
			hAdjustment.Changed += HandleAdjustmentChanged;
			
			hScrollBar = new HScrollbar (hAdjustment);
			hScrollBar.Parent = this;
			hScrollBar.Show ();
		}
    public ScrollBarRenderView(RenderView renderview)
        : base(2, 2, false)
    {
        this.renderview = renderview;
        Attach(renderview, 0, 1, 0, 1,
               AttachOptions.Expand | AttachOptions.Fill,
               AttachOptions.Expand | AttachOptions.Fill, 0, 0);

        Adjustment hadjustment = new Adjustment(0, -10, 10, 1, 2, 2);
        HScrollbar hscroll = new HScrollbar(hadjustment);
        Attach(hscroll, 0, 1, 1, 2,
                 AttachOptions.Expand | AttachOptions.Fill, 0, 0, 0);

        Adjustment vadjustment = new Adjustment(0, -10, 10, 1, 2, 2);
        VScrollbar vscroll = new VScrollbar(vadjustment);
        Attach(vscroll, 1, 2, 0, 1,
                 0, AttachOptions.Expand | AttachOptions.Fill, 0, 0);

        renderview.SetAdjustments(hadjustment, vadjustment);
    }
Ejemplo n.º 12
0
        public BlameWidget(VersionControlDocumentInfo info)
        {
            this.info = info;
            var sourceEditor = info.Document.GetContent <MonoDevelop.SourceEditor.SourceEditorView> ();

            vAdjustment          = new Adjustment(0, 0, 0, 0, 0, 0);
            vAdjustment.Changed += HandleAdjustmentChanged;

            vScrollBar = new VScrollbar(vAdjustment);
            AddChild(vScrollBar);

            hAdjustment          = new Adjustment(0, 0, 0, 0, 0, 0);
            hAdjustment.Changed += HandleAdjustmentChanged;

            hScrollBar = new HScrollbar(hAdjustment);
            AddChild(hScrollBar);

            editor = new TextEditor(sourceEditor.TextEditor.Document, sourceEditor.TextEditor.Options);
            AddChild(editor);
            editor.SetScrollAdjustments(hAdjustment, vAdjustment);

            overview = new BlameRenderer(this);
            AddChild(overview);

            this.DoubleBuffered          = true;
            editor.Painted              += HandleEditorExposeEvent;
            editor.EditorOptionsChanged += delegate {
                overview.OptionsChanged();
            };
            editor.Caret.PositionChanged += ComparisonWidget.CaretPositionChanged;
            editor.FocusInEvent          += ComparisonWidget.EditorFocusIn;
            editor.Document.Folded       += delegate {
                QueueDraw();
            };
            editor.Document.FoldTreeUpdated += delegate {
                QueueDraw();
            };
            editor.ButtonPressEvent += OnPopupMenu;
            Show();
        }
Ejemplo n.º 13
0
    private Gtk.Widget CreateTileList()
    {
        Gtk.VBox box = new Gtk.VBox();
        box.Homogeneous = false;

        Gtk.Adjustment vadjustment = new Gtk.Adjustment(0, 0, 100, 1, 10, 10);

        tileList = new TileListWidget(this, selection, vadjustment);
        TilegroupSelector selector = new TilegroupSelector(this, tileList);

        Gtk.HBox hbox = new Gtk.HBox(false, 0);

        Gtk.VScrollbar scrollbar = new Gtk.VScrollbar(vadjustment);

        hbox.PackStart(tileList, true, true, 0);
        hbox.PackEnd(scrollbar, false, true, 0);

        box.PackStart(selector, false, true, 0);
        box.PackStart(hbox, true, true, 0);

        return(box);
    }
Ejemplo n.º 14
0
	public static int Main (string[] args) {
//		Window topwin;
		IconList icon_list;
		IImageCollection collection;
		IIconListAdapter adapter;

		if (args.Length == 0) {
			Console.WriteLine ("Usage: GtkMphoto /path/to/files");
			return 0;
		}

		Application.Init ();

		Window topwin = new Window ("GtkMphoto");
		topwin.DefaultSize = new Size (600, 400);
		topwin.DeleteEvent += new DeleteEventHandler (Window_Delete);

		icon_list = new IconList ();
		Scrollbar vsb = new VScrollbar (icon_list.Adjustment);
		Box box = new HBox (false, 0);
		box.PackStart (icon_list, true, true, 0);
		box.PackStart (vsb, false, true, 0);

		box.ShowAll ();
		topwin.Add (box);

		IImageRepository repo = new DirImageRepository (args);

		string[] collIds = repo.GetCollectionIDs();
		string firstcid = collIds [0];
		collection = repo.GetCollection (firstcid);

		icon_list.Adapter = new CollectionIconListAdapter (collection);

		topwin.Show ();
		Application.Run ();
		return 0;
	}
        public RConsolePad()
            : base("R Console")
        {
            Frame frame = new Frame();
            ScrolledWindow scrolledWindow = new ScrolledWindow();
            HBox hbox = new HBox ();
            terminal = new Terminal();
            VScrollbar vscrollbar = new VScrollbar(terminal.Adjustment);
            hbox.PackStart(terminal, true, true, 0);
            hbox.PackStart(vscrollbar, false, true, 0);

            //scrolledWindow.AddWithViewport(hbox);
            frame.ShadowType = Gtk.ShadowType.In;
            scrolledWindow.Add(hbox);
            frame.Add(scrolledWindow);

            widget = frame;
            DefaultPlacement = "bottom";

            string[] environment = new string[Environment.GetEnvironmentVariables().Count];
            int index = 0;
            foreach (DictionaryEntry e in Environment.GetEnvironmentVariables ())
            {
                environment[index++] = String.Format ("{0}={1}", e.Key, e.Value);
            }
            terminal.ForkCommand(
                "R",
                new string[] {"--no-save"},
                environment,
                Environment.CurrentDirectory,
                false,
                false,
                false
            );

            frame.ShowAll();
            instance = this;
        }
Ejemplo n.º 16
0
        ///<summary>Create a DataViewDisplay</summary>
        public DataViewDisplay(DataView dv)
        {
            dataView = dv;

            // load the default layout from the data directory
            layout = new Layout(FileResourcePath.GetDataPath("bless-default.layout"));

            // initialize scrollbar
            Gtk.Adjustment
                adj = new Gtk.Adjustment(0.0, 0.0, 1.0, 1.0, 10.0, 0.0);
            vscroll = new Gtk.VScrollbar(adj);

            adj.ValueChanged += OnScrolled;

            // initialize drawing area
            drawingArea                 = new Gtk.DrawingArea();
            drawingArea.Realized       += OnRealized;
            drawingArea.ExposeEvent    += OnExposed;
            drawingArea.ConfigureEvent += OnConfigured;
            drawingArea.ModifyBg(StateType.Normal, new Gdk.Color(0xff, 0xff, 0xff));

            // add events that we want to handle
            drawingArea.AddEvents((int)Gdk.EventMask.ButtonPressMask);
            drawingArea.AddEvents((int)Gdk.EventMask.ButtonReleaseMask);
            drawingArea.AddEvents((int)Gdk.EventMask.PointerMotionMask);
            drawingArea.AddEvents((int)Gdk.EventMask.PointerMotionHintMask);
            drawingArea.AddEvents((int)Gdk.EventMask.KeyPressMask);
            drawingArea.AddEvents((int)Gdk.EventMask.KeyReleaseMask);

            drawingArea.CanFocus = true;     // needed to catch key events

            hbox = new Gtk.HBox();

            hbox.PackStart(drawingArea, true, true, 0);
            hbox.PackStart(vscroll, false, false, 0);

            this.PackStart(hbox);
        }
		public DropDownBoxListWindow (IListDataProvider provider) : base(Gtk.WindowType.Popup)
		{
			this.DataProvider = provider;
			this.TransientFor = MonoDevelop.Ide.IdeApp.Workbench.RootWindow;
			this.TypeHint = Gdk.WindowTypeHint.Menu;
			this.BorderWidth = 1;
			
			hBox = new HBox ();
			list = new ListWidget (this);
			list.SelectItem += delegate {
				DataProvider.ActivateItem (list.Selection);
				Destroy ();
			};
			
			list.ScrollEvent += delegate(object o, ScrollEventArgs args) {
				if (args.Event.Direction == Gdk.ScrollDirection.Up) {
					vScrollbar.Value--;
				} else if (args.Event.Direction == Gdk.ScrollDirection.Down) {
					vScrollbar.Value++;
				}
			};
			list.SizeAllocated += delegate {
				QueueResize ();
			};
			list.PageChanged += HandleListPageChanged;
			hBox.PackStart (list, true, true, 0);
			
			vScrollbar = new VScrollbar (null);
			vScrollbar.ValueChanged += delegate {
				list.ForcePage ((int)vScrollbar.Value);
			};
			
			hBox.PackStart (vScrollbar, false, false, 0);
			Add (hBox);
			ShowAll ();
		}
Ejemplo n.º 18
0
    T(string[] args)
    {
        Application.Init();
        window = new Gtk.Window("Test for vte widget");
        window.SetDefaultSize(600, 450);
        window.DeleteEvent += new DeleteEventHandler (OnAppDelete);

        HBox hbox = new HBox ();
        Terminal term = new Terminal ();
        term.EncodingChanged += new EventHandler (OnEncodingChanged);
        term.CursorBlinks = true;
        term.MouseAutohide = true;
        term.ScrollOnKeystroke = true;
        term.DeleteBinding = TerminalEraseBinding.Auto;
        term.BackspaceBinding = TerminalEraseBinding.Auto;
        term.Encoding = "UTF-8";
        term.FontFromString = "Monospace 12";
        term.TextDeleted += new EventHandler (OnTextDeleted);
        term.ChildExited += new EventHandler (OnChildExited);

        VScrollbar vscroll = new VScrollbar (term.Adjustment);
        hbox.PackStart (term);
        hbox.PackStart (vscroll);

        Gdk.Color white = new Gdk.Color ();
        Gdk.Color.Parse ("white", ref white);
        // FIXME: following line is broken
        //term.ColorBackground = white;

        Gdk.Color black = new Gdk.Color ();
        Gdk.Color.Parse ("black", ref black);
        // FIXME: following line is broken
        //term.ColorForeground = black;

        // Create a palette with 0 colors. this could be replaced with
        // a palette of colors with a size of 0, 8, 16, or 24.
        Gdk.Color[] palette = new Gdk.Color[0];

        term.SetColors (black, white, palette, palette.Length);

        //Console.WriteLine (term.UsingXft);
        //Console.WriteLine (term.Encoding);
        //Console.WriteLine (term.StatusLine);

        string[] argv = Environment.GetCommandLineArgs ();
        // seems to want an array of "variable=value"
        string[] envv = new string [Environment.GetEnvironmentVariables ().Count];
        int i = 0;
        foreach (DictionaryEntry e in Environment.GetEnvironmentVariables ())
        {
            if (e.Key == "" || e.Value == "")
                continue;
            string tmp = String.Format ("{0}={1}", e.Key, e.Value);
            envv[i] = tmp;
            i ++;
        }

        int pid = term.ForkCommand (Environment.GetEnvironmentVariable ("SHELL"), argv, envv, Environment.CurrentDirectory, false, true, true);
        Console.WriteLine ("Child pid: {0}", pid);

        window.Add(hbox);
        window.ShowAll();
        Application.Run();
    }
Ejemplo n.º 19
0
	void CreateWidget () {
		//
		// Create the widget
		//
		Frame frame1 = new Frame ();
		VBox vbox1 = new VBox (false, 0);
		frame1.Add (vbox1);

		// title
		HBox hbox1 = new HBox (false, 3);
		hbox1.BorderWidth = 3;
		Image icon = new Image (Stock.Index, IconSize.Menu);
		Label look_for_label = new Label ("Look for:");
		look_for_label.Justify = Justification.Left;
		look_for_label.Xalign = 0;
		hbox1.PackEnd (look_for_label, true, true, 0);
		hbox1.PackEnd (icon, false, true, 0);
		hbox1.ShowAll ();
		vbox1.PackStart (hbox1, false, true, 0);

		// entry
		vbox1.PackStart (new HSeparator (), false, true, 0);
		browser.index_entry = new Entry ();
		browser.index_entry.Activated += browser.OnIndexEntryActivated;
		browser.index_entry.Changed += browser.OnIndexEntryChanged;
		browser.index_entry.FocusInEvent += browser.OnIndexEntryFocused;
		browser.index_entry.KeyPressEvent += browser.OnIndexEntryKeyPress;
		vbox1.PackStart (browser.index_entry, false, true, 0);
		vbox1.PackStart (new HSeparator (), false, true, 0);

		//search results
		browser.search_box = new VBox ();
		vbox1.PackStart (browser.search_box, true, true, 0);
		vbox1.ShowAll ();

		
		//
		// Setup the widget
		//
		index_list = new BigList (index_reader);
		//index_list.SetSizeRequest (100, 400);

		index_list.ItemSelected += new ItemSelected (OnIndexSelected);
		index_list.ItemActivated += new ItemActivated (OnIndexActivated);
		HBox box = new HBox (false, 0);
		box.PackStart (index_list, true, true, 0);
		Scrollbar scroll = new VScrollbar (index_list.Adjustment);
		box.PackEnd (scroll, false, false, 0);
		
		browser.search_box.PackStart (box, true, true, 0);
		box.ShowAll ();

		//
		// Setup the matches.
		//
		browser.matches = new Frame ();
		match_model = new MatchModel (this);
		browser.matches.Hide ();
		match_list = new BigList (match_model);
		match_list.ItemSelected += new ItemSelected (OnMatchSelected);
		match_list.ItemActivated += new ItemActivated (OnMatchActivated);
		HBox box2 = new HBox (false, 0);
		box2.PackStart (match_list, true, true, 0);
		Scrollbar scroll2 = new VScrollbar (match_list.Adjustment);
		box2.PackEnd (scroll2, false, false, 0);
		box2.ShowAll ();
		
		browser.matches.Add (box2);
		index_list.SetSizeRequest (100, 200);

		browser.index_vbox.PackStart (frame1);
		browser.index_vbox.PackEnd (browser.matches);
	}
Ejemplo n.º 20
0
        public ComparisonWidget(VersionControlDocumentInfo info)
        {
            vAdjustment          = new Adjustment(0, 0, 0, 0, 0, 0);
            vAdjustment.Changed += HandleAdjustmentChanged;

            vScrollBar = new VScrollbar(vAdjustment);
            AddChild(vScrollBar);
            vScrollBar.Hide();

            hAdjustment          = new Adjustment(0, 0, 0, 0, 0, 0);
            hAdjustment.Changed += HandleAdjustmentChanged;

            leftHScrollBar = new HScrollbar(hAdjustment);
            AddChild(leftHScrollBar);

            rightHScrollBar = new HScrollbar(hAdjustment);
            AddChild(rightHScrollBar);

            originalComboBox      = new DropDownBox();
            originalComboBox.Text = "Local";
            AddChild(originalComboBox);

            originalEditor = new TextEditor();
            AddChild(originalEditor);
            originalEditor.SetScrollAdjustments(hAdjustment, vAdjustment);

            diffComboBox      = new DropDownBox();
            diffComboBox.Text = "Base";
            AddChild(diffComboBox);

            diffEditor = new TextEditor();

            AddChild(diffEditor);
            diffEditor.Document.ReadOnly = true;
            diffEditor.SetScrollAdjustments(hAdjustment, vAdjustment);
            this.vAdjustment.ValueChanged += delegate {
                middleArea.QueueDraw();
            };

            overview = new OverviewRenderer(this);
            AddChild(overview);

            middleArea = new MiddleArea(this);
            AddChild(middleArea);

            prev = new Button();
            prev.Add(new Arrow(ArrowType.Up, ShadowType.None));
            AddChild(prev);
            prev.ShowAll();
            prev.Clicked += delegate {
                if (this.Diff == null)
                {
                    return;
                }
                originalEditor.GrabFocus();

                int line = originalEditor.Caret.Line;
                int max = -1, searched = -1;
                foreach (Diff.Hunk hunk in this.Diff)
                {
                    if (hunk.Same)
                    {
                        continue;
                    }
                    max = System.Math.Max(hunk.Left.Start, max);
                    if (hunk.Left.Start < line)
                    {
                        searched = System.Math.Max(hunk.Left.Start, searched);
                    }
                }
                if (max >= 0)
                {
                    originalEditor.Caret.Line = searched < 0 ? max : searched;
                    originalEditor.CenterToCaret();
                }
            };

            next             = new Button();
            next.BorderWidth = 0;
            next.Add(new Arrow(ArrowType.Down, ShadowType.None));
            next.Clicked += delegate {
                if (this.Diff == null)
                {
                    return;
                }
                originalEditor.GrabFocus();

                int line = originalEditor.Caret.Line;
                int min = Int32.MaxValue, searched = Int32.MaxValue;
                foreach (Diff.Hunk hunk in this.Diff)
                {
                    if (hunk.Same)
                    {
                        continue;
                    }
                    min = System.Math.Min(hunk.Left.Start, min);
                    if (hunk.Left.Start > line)
                    {
                        searched = System.Math.Min(hunk.Left.Start, searched);
                    }
                }
                if (min < Int32.MaxValue)
                {
                    originalEditor.Caret.Line = searched == Int32.MaxValue ? min : searched;
                    originalEditor.CenterToCaret();
                }
            };
            AddChild(next);
            next.ShowAll();

            this.DoubleBuffered         = true;
            originalEditor.ExposeEvent += HandleLeftEditorExposeEvent;
            diffEditor.ExposeEvent     += HandleRightEditorExposeEvent;
        }
Ejemplo n.º 21
0
		public ComparisonWidget (VersionControlDocumentInfo info)
		{
			this.info = info;
			vAdjustment = new Adjustment (0, 0, 0, 0, 0, 0);
			vAdjustment.Changed += HandleAdjustmentChanged;
			leftVAdjustment = new Adjustment (0, 0, 0, 0, 0, 0);
			Connect (leftVAdjustment, vAdjustment);
			
			rightVAdjustment =  new Adjustment (0, 0, 0, 0, 0, 0);
			Connect (rightVAdjustment, vAdjustment);
			
			vScrollBar = new VScrollbar (vAdjustment);
			AddChild (vScrollBar);
			vScrollBar.Hide ();
			
			hAdjustment = new Adjustment (0, 0, 0, 0, 0, 0);
			hAdjustment.Changed += HandleAdjustmentChanged;
			leftHAdjustment = new Adjustment (0, 0, 0, 0, 0, 0);
			Connect (leftHAdjustment, hAdjustment);
			
			rightHAdjustment =  new Adjustment (0, 0, 0, 0, 0, 0);
			Connect (rightHAdjustment, hAdjustment);
			
			leftHScrollBar = new HScrollbar (hAdjustment);
			AddChild (leftHScrollBar);
			
			rightHScrollBar = new HScrollbar (hAdjustment);
			AddChild (rightHScrollBar);
			
			originalEditor = new TextEditor ();
			originalEditor.Caret.PositionChanged += CaretPositionChanged;
			originalEditor.FocusInEvent += EditorFocusIn;
			AddChild (originalEditor);
			originalEditor.SetScrollAdjustments (leftHAdjustment, leftVAdjustment);
			
			originalComboBox = new DropDownBox ();
			originalComboBox.WindowRequestFunc = CreateComboBoxSelector;
			originalComboBox.Text = "Local";
			originalComboBox.Tag = originalEditor;
			AddChild (originalComboBox);
			
			diffEditor = new TextEditor ();
			diffEditor.Caret.PositionChanged += CaretPositionChanged;
			diffEditor.FocusInEvent += EditorFocusIn;
			
			AddChild (diffEditor);
			diffEditor.Document.ReadOnly = true;
			diffEditor.SetScrollAdjustments (leftHAdjustment, leftVAdjustment);
			this.vAdjustment.ValueChanged += delegate {
				middleArea.QueueDraw ();
			};
			
			diffComboBox = new DropDownBox ();
			diffComboBox.WindowRequestFunc = CreateComboBoxSelector;
			diffComboBox.Text = "Base";
			diffComboBox.Tag = diffEditor;
			AddChild (diffComboBox);
			
			
			overview = new OverviewRenderer (this);
			AddChild (overview);
			
			middleArea = new MiddleArea (this);
			AddChild (middleArea);
			
			prev = new Button ();
			prev.Add (new Arrow (ArrowType.Up, ShadowType.None));
			AddChild (prev);
			prev.ShowAll ();
			prev.Clicked += delegate {
				if (this.Diff == null)
					return;
				originalEditor.GrabFocus ();
				
				int line = originalEditor.Caret.Line;
				int max  = -1, searched = -1;
				foreach (Diff.Hunk hunk in this.Diff) {
					if (hunk.Same)
						continue;
					max = System.Math.Max (hunk.Right.Start, max);
					if (hunk.Right.Start < line)
						searched = System.Math.Max (hunk.Right.Start, searched);
				}
				if (max >= 0) {
					originalEditor.Caret.Line = searched < 0 ? max : searched;
					originalEditor.CenterToCaret ();
				}
			};
			
			next = new Button ();
			next.BorderWidth = 0;
			next.Add (new Arrow (ArrowType.Down, ShadowType.None));
			next.Clicked += delegate {
				if (this.Diff == null)
					return;
				originalEditor.GrabFocus ();
				
				int line = originalEditor.Caret.Line;
				int min  = Int32.MaxValue, searched = Int32.MaxValue;
				foreach (Diff.Hunk hunk in this.Diff) {
					if (hunk.Same)
						continue;
					min = System.Math.Min (hunk.Right.Start, min);
					if (hunk.Right.Start > line)
						searched = System.Math.Min (hunk.Right.Start, searched);
				}
				if (min < Int32.MaxValue) {
					originalEditor.Caret.Line = searched == Int32.MaxValue ? min : searched;
					originalEditor.CenterToCaret ();
				}
			};
			AddChild (next);
			next.ShowAll ();
			
			this.DoubleBuffered = true;
			originalEditor.ExposeEvent += HandleLeftEditorExposeEvent;
			diffEditor.ExposeEvent += HandleRightEditorExposeEvent;
			info.Document.Editor.Document.TextReplaced += HandleInfoDocumentTextEditorDataDocumentTextReplaced;
		}
Ejemplo n.º 22
0
 public MainWindow()
     : base("MainWindow")
 {
     // create the table and pack into the window
     Table table = new Table(2, 3, false);
     Add(table);
     // Initialze DGraphics
     GTKHelper.InitGraphics();
     // create DViewerControl and attach to table
     GTKViewerControl dvc = new GTKViewerControl();
     table.Attach(dvc, 0, 1, 0, 1, AttachOptions.Fill | AttachOptions.Expand,
                  AttachOptions.Fill | AttachOptions.Expand, 0, 0);
     // create the scrollbars and pack into the table
     VScrollbar vsb = new VScrollbar(null);
     table.Attach(vsb, 1, 2, 0, 1, AttachOptions.Fill|AttachOptions.Shrink,
                  AttachOptions.Fill|AttachOptions.Shrink, 0, 0);
     HScrollbar hsb = new HScrollbar(null);
     table.Attach(hsb, 0, 1, 1, 2, AttachOptions.Fill|AttachOptions.Shrink,
                  AttachOptions.Fill|AttachOptions.Shrink, 0, 0);
     // tell the scrollbars to use the DViewerControl widget's adjustments
     vsb.Adjustment = dvc.Vadjustment;
     hsb.Adjustment = dvc.Hadjustment;
     // create debuging label
     l = new Label("debug");
     table.Attach(l, 0, 1, 2, 3, AttachOptions.Fill|AttachOptions.Shrink,
                  AttachOptions.Fill|AttachOptions.Shrink, 0, 0);
     // create DViewer and DEngine
     dv = new GTKViewer(dvc);
     dv.EditFigures = true;
     #if DEBUG
     dv.DebugMessage += new DebugMessageHandler(DebugMessage);
     #endif
     de = new DEngine(null);
     de.AddViewer(dv);
     de.HsmState = DHsmState.Select;
     #if DEBUG
     de.DebugMessage += new DebugMessageHandler(DebugMessage);
     #endif
     de.ContextClick += new ClickHandler(de_ContextClick);
     // add figures
     de.UndoRedo.Start("add initial figures");
     de.AddFigure(new EllipseFigure(new DRect(20, 30, 100, 100), 0));
     RectFigure rf = new RectFigure(new DRect(10, 20, 100, 100), 0);
     rf.Alpha = 0.7;
     rf.Fill = new DColor(80, 80, 80);
     de.AddFigure(rf);
     TextFigure tf = new TextFigure(new DPoint(150, 30), "hello", 0);
     tf.FontName = "Arial";
     tf.Underline = true;
     tf.Strikethrough = true;
     tf.Italics = true;
     de.AddFigure(tf);
     // compositing figure
     Figure f = new CompositedExampleFigure();
     f.Rect = new DRect(20, 150, 50, 50);
     de.AddFigure(f);
     // clock (IEditable) figure
     f = new ClockFigure();
     f.Rect = new DRect(200, 200, 100, 100);
     de.AddFigure(f);
     // triangle figure
     f = new TriangleFigure();
     f.Rect = new DRect(200, 100, 100, 100);
     ((TriangleFigure)f).StrokeWidth = 10;
     de.AddFigure(f);
     // line figure
     f = new LineFigure2(new DPoint(100, 100), new DPoint(200, 200));
     ((LineFigure2)f).StrokeStyle = DStrokeStyle.DashDot;
     ((LineFigure2)f).StrokeWidth = 5;
     de.AddFigure(f);
     de.UndoRedo.Commit();
     de.UndoRedo.ClearHistory();
     // resize window
     Resize(400, 300);
 }
Ejemplo n.º 23
0
		public BlameWidget (VersionControlDocumentInfo info)
		{
			GtkWorkarounds.FixContainerLeak (this);
			
			this.info = info;
			var sourceEditor = info.Document.GetContent<MonoDevelop.SourceEditor.SourceEditorView> ();
			
			vAdjustment = new Adjustment (0, 0, 0, 0, 0, 0);
			vAdjustment.Changed += HandleAdjustmentChanged;
			
			vScrollBar = new VScrollbar (vAdjustment);
			AddChild (vScrollBar);
			
			hAdjustment = new Adjustment (0, 0, 0, 0, 0, 0);
			hAdjustment.Changed += HandleAdjustmentChanged;

			hScrollBar = new HScrollbar (hAdjustment);
			AddChild (hScrollBar);
			
			editor = new TextEditor (sourceEditor.TextEditor.Document, sourceEditor.TextEditor.Options);
			AddChild (editor);
			editor.SetScrollAdjustments (hAdjustment, vAdjustment);
			
			overview = new BlameRenderer (this);
			AddChild (overview);
			
			this.DoubleBuffered = true;
			editor.Painted += HandleEditorExposeEvent;
			editor.EditorOptionsChanged += delegate {
				overview.OptionsChanged ();
			};
			editor.Caret.PositionChanged += ComparisonWidget.CaretPositionChanged;
			editor.FocusInEvent += ComparisonWidget.EditorFocusIn;
			editor.Document.Folded += delegate {
				QueueDraw ();
			};
			editor.Document.FoldTreeUpdated += delegate {
				QueueDraw ();
			};
			editor.DoPopupMenu = ShowPopup;
			Show ();
		}
Ejemplo n.º 24
0
    private Gtk.Widget CreateObjectList()
    {
        Gtk.HBox hbox = new Gtk.HBox(false, 0);

        Gtk.Adjustment vadjustment = new Gtk.Adjustment(0, 0, 100, 1, 10, 10);
        Gtk.VScrollbar scrollbar = new Gtk.VScrollbar(vadjustment);

        hbox.PackStart(new ObjectListWidget(this, vadjustment), true, true, 0);
        hbox.PackEnd(scrollbar, false, true, 0);
        return hbox;
    }
Ejemplo n.º 25
0
    private Gtk.Widget CreateTileList()
    {
        Gtk.VBox box = new Gtk.VBox();
        box.Homogeneous = false;

        Gtk.Adjustment vadjustment = new Gtk.Adjustment(0, 0, 100, 1, 10, 10);

        tileList = new TileListWidget(this, selection, vadjustment);
        TilegroupSelector selector = new TilegroupSelector(this, tileList);

        Gtk.HBox hbox = new Gtk.HBox(false, 0);

        Gtk.VScrollbar scrollbar = new Gtk.VScrollbar(vadjustment);

        hbox.PackStart(tileList, true, true, 0);
        hbox.PackEnd(scrollbar, false, true, 0);

        box.PackStart(selector, false, true, 0);
        box.PackStart(hbox, true, true, 0);

        return box;
    }
Ejemplo n.º 26
0
        public ListWindow()
            : base(Gtk.WindowType.Popup)
        {
            HBox box = new HBox ();

            list = new ListWidget (this);
            list.SelectionChanged += new EventHandler (OnSelectionChanged);
            list.ScrollEvent += new ScrollEventHandler (OnScrolled);
            box.PackStart (list, true, true, 0);
            this.BorderWidth = 1;

            scrollbar = new VScrollbar (null);
            scrollbar.ValueChanged += new EventHandler (OnScrollChanged);
            box.PackStart (scrollbar, false, false, 0);

            Add (box);
            this.TypeHint = WindowTypeHint.Menu;
        }
Ejemplo n.º 27
0
	//
	// glade signal handlers
	//

	// custom widget creation callback
	public Gtk.Widget GladeCustomWidgetHandler (Glade.XML xml, string func_name, string name, string s1, string s2, int i1, int i2)
	{
		Console.WriteLine ("customWidgetHandler: widget for " + name);

		if (name == "browser_icon_list") {
			icon_list = new IconList ();
			Scrollbar scroll = new VScrollbar (icon_list.Adjustment);
			Box box = new HBox (false, 0);

			box.PackStart (icon_list, true, true, 0);
			box.PackStart (scroll, false, true, 0);

			box.ShowAll ();
			return box;
		}

#if HAVE_LIBEOG
		if (name == "eog_image_view") {
			image_ui = new EogUiImage ();
			Console.WriteLine ("Handle: " + image_ui.Handle);
			image_ui.Show ();
			return image_ui;
		}
#else
		if (name == "eog_image_view") {
			Gtk.Widget w = new Gtk.Label ("EOG support not enabled; Viewer is disabled.");
			w.Show ();
			return w;
		}
#endif

		if (name == "collections_tree_view") {
			collections_tree_view = new CollectionsTreeView ();
			collections_tree_view.Show ();
			return collections_tree_view;
		}

		if (name == "imageinfo_tree_view") {
			imageinfo_tree_view = new ImageInfoTreeView ();
			imageinfo_tree_view.Show ();
			return imageinfo_tree_view;
		}

		if (name == "keywords_widget") {
			keywords_widget = new KeywordsWidget ();
			keywords_widget.Show ();
			return keywords_widget;
		}

		Console.WriteLine ("Returning nil");
		return null;
	}
Ejemplo n.º 28
0
		public BlameWidget (VersionControlDocumentInfo info)
		{
			this.info = info;
			
			vAdjustment = new Adjustment (0, 0, 0, 0, 0, 0);
			vAdjustment.Changed += HandleAdjustmentChanged;
			
			vScrollBar = new VScrollbar (vAdjustment);
			AddChild (vScrollBar);
			
			hAdjustment = new Adjustment (0, 0, 0, 0, 0, 0);
			hAdjustment.Changed += HandleAdjustmentChanged;
			
			hScrollBar = new HScrollbar (hAdjustment);
			AddChild (hScrollBar);
			
			editor = new TextEditor (info.Document.TextEditorData.Document, info.Document.TextEditorData.Options);
			AddChild (editor);
			editor.SetScrollAdjustments (hAdjustment, vAdjustment);
			
			overview = new BlameRenderer (this);
			AddChild (overview);
			
			this.DoubleBuffered = true;
			editor.ExposeEvent += HandleEditorExposeEvent;
			editor.EditorOptionsChanged += delegate {
				overview.OptionsChanged ();
			};
		}
Ejemplo n.º 29
0
		void SetupMode ()
		{
			if (adj == null || textEditor == null)
				return;
			if (vScrollBar != null) {
				vScrollBar.Destroy ();
				vScrollBar = null;
			}
			
			if (mapMode != null) {
				mapMode.Destroy ();
				mapMode = null;
			}
			switch (ScrollBarMode) {
			case ScrollBarMode.Normal:
				vScrollBar = new VScrollbar (adj);
				PackStart (vScrollBar, true, true, 0);
				break;
			case ScrollBarMode.Overview:
				mapMode = new QuickTaskOverviewMode (this);
				PackStart (mapMode, true, true, 0);
				break;
			case ScrollBarMode.Minimap:
				mapMode = new QuickTaskMiniMapMode (this);
				PackStart (mapMode, true, true, 0);
				break;
			default:
				throw new ArgumentOutOfRangeException ();
			}
			ShowAll ();
		}
Ejemplo n.º 30
0
		public BlameWidget (VersionControlDocumentInfo info)
		{
			this.info = info;
			
			vAdjustment = new Adjustment (0, 0, 0, 0, 0, 0);
			vAdjustment.Changed += HandleAdjustmentChanged;
			
			vScrollBar = new VScrollbar (vAdjustment);
			AddChild (vScrollBar);
			
			hAdjustment = new Adjustment (0, 0, 0, 0, 0, 0);
			hAdjustment.Changed += HandleAdjustmentChanged;
			
			hScrollBar = new HScrollbar (hAdjustment);
			AddChild (hScrollBar);
			
			editor = new TextEditor (info.Document.Editor.Document, info.Document.Editor.Options);
			AddChild (editor);
			editor.SetScrollAdjustments (hAdjustment, vAdjustment);
			
			overview = new BlameRenderer (this);
			AddChild (overview);
			
			this.DoubleBuffered = true;
			editor.Painted += HandleEditorExposeEvent;
			editor.EditorOptionsChanged += delegate {
				overview.OptionsChanged ();
			};
			editor.Caret.PositionChanged += ComparisonWidget.CaretPositionChanged;
			editor.FocusInEvent += ComparisonWidget.EditorFocusIn;
			editor.Document.Folded += delegate {
				QueueDraw ();
			};
			editor.Document.FoldTreeUpdated += delegate {
				QueueDraw ();
			};
			editor.ButtonPressEvent += OnPopupMenu;
			Show ();
		}
		protected override void OnStyleSet (Style previous_style)
		{
			base.OnStyleSet (previous_style);
			if (Core.Platform.IsWindows) {
				using (var scrollstyle = Rc.GetStyleByPaths (Settings, null, null, VScrollbar.GType)) {
					var scrl = new VScrollbar (null);
					scrl.Style = scrollstyle;
					win81Slider = scrollstyle.Background (StateType.Normal).ToCairoColor ();
					win81SliderPrelight = scrollstyle.Background (StateType.Prelight).ToCairoColor ();
					win81ScrollbarWidth = (int)scrl.StyleGetProperty ("slider-width");
					scrl.Destroy ();
				}
			}
		}