private void TabCaption_ClosedTab(object sender, EventArgs e) { TabCaption caption = (TabCaption)sender; Tab tab = FindTab(caption); DisposeTab(tab); }
public static Tab CreateTab(String url) { Browser browser = BrowserFactory.Create(BrowserType); BrowserView browserView = new WinFormsBrowserView(browser); browser.DialogHandler = new WinFormsDefaultDialogHandler((Control)browserView); browser.DownloadHandler = new WinFormsDefaultDownloadHandler((Control)browserView); browser.ContextMenuHandler = new WinFormsDefaultContextMenuHandler((Control)browserView, true); browser.Preferences.FireKeyboardEventsEnabled = false; browser.Preferences.FireMouseEventsEnabled = false; TabContent tabContent = new TabContent(browserView); TabCaption tabCaption = new TabCaption(); tabCaption.SetTitle("about:blank"); tabContent.PropertyChangeEvent += delegate(string propertyName, object oldValue, object newValue) { tabCaption.SetTitle(newValue.ToString()); }; browserView.Browser.LoadURL(url); return(new Tab(tabCaption, tabContent)); }
public void RemoveTab(Tab tab) { TabCaption tabCaption = tab.Caption; captions.RemoveTab(tabCaption); tabs.Remove(tab); UpdateWidthForHeaders(); }
private void TabCaption_SelectedTab(object sender, EventArgs e) { TabCaption caption = (TabCaption)sender; Tab tab = FindTab(caption); if (caption.IsSelected()) { SelectTab(tab); } }
public void RemoveSelectedTab() { TabCaption selectedTab = captions.GetSelectedTab(); Tab tab = FindTab(selectedTab); if (tab != null) { DisposeTab(tab); } }
private Tab FindTab(TabCaption item) { foreach (Tab tab in tabs) { if (tab.Caption.Equals(item)) { return(tab); } } return(null); }
public void AddTab(Tab tab) { TabCaption caption = tab.Caption; caption.ClosedTab += TabCaption_ClosedTab; caption.SelectedTab += TabCaption_SelectedTab; TabContent content = tab.Content; captions.AddTab(caption); tabs.Add(tab); UpdateWidthForHeaders(); }
public void SelectTab(Tab tab) { TabCaption tabCaption = tab.Caption; TabCaption selectedTab = captions.GetSelectedTab(); if (selectedTab != null && !selectedTab.Equals(tabCaption)) { selectedTab.SetSelected(false); } captions.SetSelectedTab(tabCaption); if (!tabCaption.IsSelected()) { TabContent content = tab.Content; contentContainer.Controls.Remove(content); } else { TabContent content = tab.Content; contentContainer.Controls.Clear(); contentContainer.Controls.Add(content); content.Focus(); } }
public void SetSelectedTab(TabCaption selectedTab) { this.selectedTab = selectedTab; this.selectedTab.SetSelected(true); }
public void RemoveTab(TabCaption item) { tabsPane.Controls.Remove(item); }
public void AddTab(TabCaption item) { tabsPane.Controls.Add(item); }
public Tab(TabCaption caption, TabContent content) { this.Caption = caption; this.Content = content; }