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);
 }
        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);
            }
        }
		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);
		}
        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();
        }
 public AtomicUndo(SourceEditorBuffer b)
 {
     this.b = b;
     b.BeginUserAction();
 }
 public NoUndo(SourceEditorBuffer b)
 {
     this.b = b;
     b.BeginNotUndoableAction();
 }
		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;
			}
		}
		public AtomicUndo (SourceEditorBuffer b)
		{
			this.b = b;
			b.BeginUserAction ();
		}
		public NoUndo (SourceEditorBuffer b)
		{
			this.b = b;
			b.BeginNotUndoableAction ();
		}
 public new void Dispose()
 {
     Buffer.Dispose ();
     Buffer = null;
     Remove (View);
     View.Dispose ();
     View = null;
     DisplayBinding = null;
     base.Dispose ();
 }
		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();
		}