示例#1
0
 public void Focus(FileBuffer fileBuffer)
 {
     for (int i = 0; i < NPages; i++)
         if (GetNthFileBuffer(i) == fileBuffer)
         {
             Page = i;
             break;
         }
 }
示例#2
0
 public bool Close(FileBuffer fileBuffer)
 {
     var e = new FileBufferCancelEventArgs(fileBuffer);
     OnFileBufferClosing(e);
     if (e.Cancel)
         return false;
     RemoveFileBuffer(fileBuffer);
     OnFileBufferClosed(new FileBufferEventArgs(fileBuffer));
     if (CurrentFileBuffer == null)
         OnCurrentFileBufferChanged(EventArgs.Empty);
     return true;
 }
示例#3
0
        public FileCloseableIconTitle(FileBuffer fileBuffer)
            : base(false, 0)
        {
            this.fileBuffer = fileBuffer;

            fileIconTitle = new FileIconTitle(fileBuffer) { Visible = true };

            imageClose = new Gtk.Image(Gtk.Stock.Close, Gtk.IconSize.Menu) { Visible = true };

            buttonClose = new Gtk.Button(imageClose) { Visible = true, Relief = Gtk.ReliefStyle.None };
            buttonClose.Clicked += ButtonClose_Clicked;

            PackStart(fileIconTitle, false, true, 0);
            PackStart(buttonClose, false, true, 0);
        }
示例#4
0
 public FileBuffer New(bool focus)
 {
     var result = new FileBuffer(new Gtk.TextTagTable());
     AddFileBuffer(result);
     if (focus)
         Page = NPages - 1;
     return result;
 }
示例#5
0
 public FileBufferEventArgs(FileBuffer fileBuffer)
 {
     this.fileBuffer = fileBuffer;
 }
示例#6
0
 public FileBufferCancelEventArgs(FileBuffer fileBuffer)
     : base(false)
 {
     this.fileBuffer = fileBuffer;
 }
示例#7
0
 private void RemoveFileBuffer(FileBuffer fileBuffer)
 {
     for (int i = 0; i < NPages; i++)
         if (GetNthFileBuffer(i) == fileBuffer)
         {
             RemoveFileBuffer(i);
             break;
         }
 }
示例#8
0
        private void AddFileBuffer(FileBuffer fileBuffer)
        {
            fileBuffer.Changed += FileBuffer_Changed;
            fileBuffer.ModifiedChanged += FileBuffer_ModifiedChanged;
            fileBuffer.TitleChanged += FileBuffer_TitleChanged;
            fileBuffer.SelectionChanged += OpenFile_SelectionChanged;

            var textView = new Gtk.TextView(fileBuffer) { Visible = true, WrapMode = Gtk.WrapMode.WordChar };

            var scrolledWindow = new Gtk.ScrolledWindow { Visible = true };
            scrolledWindow.Add(textView);

            var fileCloseableIconTitle = new FileCloseableIconTitle(fileBuffer) { Visible = true };
            fileCloseableIconTitle.CloseClicked += FileCloseableIconTitle_CloseClicked;

            var fileIconTitleMenuLabel = new FileIconTitle(fileBuffer) { Visible = true };

            AppendPageMenu(scrolledWindow, fileCloseableIconTitle, fileIconTitleMenuLabel);

            OnFileBufferAdded(new FileBufferEventArgs(fileBuffer));
        }