public void Focus(FileBuffer fileBuffer) { for (int i = 0; i < NPages; i++) if (GetNthFileBuffer(i) == fileBuffer) { Page = i; break; } }
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; }
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); }
public FileBuffer New(bool focus) { var result = new FileBuffer(new Gtk.TextTagTable()); AddFileBuffer(result); if (focus) Page = NPages - 1; return result; }
public FileBufferEventArgs(FileBuffer fileBuffer) { this.fileBuffer = fileBuffer; }
public FileBufferCancelEventArgs(FileBuffer fileBuffer) : base(false) { this.fileBuffer = fileBuffer; }
private void RemoveFileBuffer(FileBuffer fileBuffer) { for (int i = 0; i < NPages; i++) if (GetNthFileBuffer(i) == fileBuffer) { RemoveFileBuffer(i); break; } }
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)); }