コード例 #1
0
 public SourceEditorView(SourceEditorBuffer buf, SourceEditor parent)
 {
     this.ParentEditor = parent;
     this.TabsWidth = 4;
     Buffer = this.buf = buf;
     AutoIndent = true;
     SmartHomeEnd = true;
     ShowLineNumbers = true;
     ShowLineMarkers = true;
     buf.PlaceCursor (buf.StartIter);
     GrabFocus ();
     buf.MarkSet += new MarkSetHandler (BufferMarkSet);
     buf.Changed += new EventHandler (BufferChanged);
 }
コード例 #2
0
        public static SourceEditorBuffer CreateTextBufferFromFile(string filename)
        {
            SourceEditorBuffer buff = new SourceEditorBuffer();

            buff.LoadFile(filename);
            // don't return a buffer that couldn't load the file
            if (buff.Text == null)
            {
                return(null);
            }
            else
            {
                return(buff);
            }
        }
コード例 #3
0
		public SourceEditor (SourceEditorDisplayBindingWrapper bind)
		{
			ShadowType = Gtk.ShadowType.In;
			DisplayBinding = bind;
			Buffer = new SourceEditorBuffer ();	
			View = new SourceEditorView (Buffer, this);
			Buffer.View = View;
			this.VscrollbarPolicy = PolicyType.Automatic;
			this.HscrollbarPolicy = PolicyType.Automatic;
			
			AddMarker ("SourceEditorBookmark", dragIconPixbuf);
			AddMarker ("ExecutionMark", executionMarkerPixbuf);
			AddMarker ("BreakpointMark", breakPointPixbuf);
			
			Add (View);
		}
コード例 #4
0
        public SourceEditor(SourceEditorDisplayBindingWrapper bind)
        {
            ShadowType            = Gtk.ShadowType.In;
            DisplayBinding        = bind;
            Buffer                = new SourceEditorBuffer();
            View                  = new SourceEditorView(Buffer, this);
            Buffer.View           = View;
            this.VscrollbarPolicy = PolicyType.Automatic;
            this.HscrollbarPolicy = PolicyType.Automatic;

            AddMarker("SourceEditorBookmark", dragIconPixbuf);
            AddMarker("ExecutionMark", executionMarkerPixbuf);
            AddMarker("BreakpointMark", breakPointPixbuf);

            Add(View);
        }
コード例 #5
0
        public SourceEditorView(SourceEditorBuffer buf, SourceEditor parent)
        {
            this.ParentEditor = parent;
            this.TabWidth     = 4;
            Buffer            = this.buf = buf;
            AutoIndent        = false;
            SmartHomeEnd      = SourceSmartHomeEndType.Always;
            ShowLineNumbers   = true;
            //FIXME GTKSV2
            //ShowLineMarkers = true;
            controlsDrawer = new DrawControlCharacterImp(this);
            buf.PlaceCursor(buf.StartIter);
            GrabFocus();
            buf.MarkSet += new MarkSetHandler(BufferMarkSet);
            buf.Changed += new EventHandler(BufferChanged);
            LoadEditActions();
            this.Events = this.Events | EventMask.PointerMotionMask | EventMask.LeaveNotifyMask | EventMask.ExposureMask;

            InitAutoCorrectionValues();
        }
コード例 #6
0
 public AtomicUndo(SourceEditorBuffer b)
 {
     this.b = b;
     b.BeginUserAction();
 }
コード例 #7
0
 public NoUndo(SourceEditorBuffer b)
 {
     this.b = b;
     b.BeginNotUndoableAction();
 }
コード例 #8
0
		public static SourceEditorBuffer CreateTextBufferFromFile (string filename)
		{
			SourceEditorBuffer buff = new SourceEditorBuffer ();
			buff.LoadFile (filename);
			// don't return a buffer that couldn't load the file
			if (buff.Text == null) {
				return null;
			} else {
				return buff;
			}
		}
コード例 #9
0
		public AtomicUndo (SourceEditorBuffer b)
		{
			this.b = b;
			b.BeginUserAction ();
		}
コード例 #10
0
		public NoUndo (SourceEditorBuffer b)
		{
			this.b = b;
			b.BeginNotUndoableAction ();
		}
コード例 #11
0
 public new void Dispose()
 {
     Buffer.Dispose ();
     Buffer = null;
     Remove (View);
     View.Dispose ();
     View = null;
     DisplayBinding = null;
     base.Dispose ();
 }
コード例 #12
0
		public SourceEditorView (SourceEditorBuffer buf, SourceEditor parent)
		{
			this.ParentEditor = parent;
			this.TabWidth = 4;
			Buffer = this.buf = buf;
			AutoIndent = false;
			SmartHomeEnd = SourceSmartHomeEndType.Always;
			ShowLineNumbers = true;
			//FIXME GTKSV2
			//ShowLineMarkers = true;
			controlsDrawer = new DrawControlCharacterImp (this);
			buf.PlaceCursor (buf.StartIter);
			GrabFocus ();
			buf.MarkSet += new MarkSetHandler (BufferMarkSet);
			buf.Changed += new EventHandler (BufferChanged);
			LoadEditActions ();
			this.Events = this.Events | EventMask.PointerMotionMask | EventMask.LeaveNotifyMask | EventMask.ExposureMask;
			
			InitAutoCorrectionValues();
		}