コード例 #1
0
        private void SetupScrollbarRange()
        {
            if (layout.AreaGroup.Areas.Count <= 0)
            {
                return;
            }

            long bpr   = ((Area)layout.AreaGroup.Areas[0]).BytesPerRow;
            long nrows = ((dataView.Buffer.Size + 1) / bpr);     // +1 because of append cursor position

            if (nrows < vscroll.Adjustment.PageSize)
            {
                vscroll.Value = 0;
                // set adjustment manually instead of using SetRange
                // because gtk+ complains if low==high in SetRange()
                vscroll.Adjustment.Lower = 0;
                vscroll.Adjustment.Upper = nrows;
                vscroll.Hide();
            }
            else if ((dataView.Buffer.Size + 1) % bpr == 0)
            {
                vscroll.SetRange(0, nrows);
                vscroll.Show();
            }
            else
            {
                vscroll.SetRange(0, nrows + 1);
                vscroll.Show();
            }
        }
コード例 #2
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();
                    }
            };
        }
コード例 #3
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 ();
		}
コード例 #4
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();
        }