void f_brow_Init() { brow_Domain = brow_URL.Split('/')[2]; browser = new WebView(brow_URL, new BrowserSettings()); browser.Dock = DockStyle.Fill; browser.RequestHandler = this; browser.ConsoleMessage += f_brow_onBrowserConsoleMessage; browser.LoadCompleted += f_brow_onLoadCompleted; browser.MenuHandler = new CustomMenuHandler(); brow_Transparent = new ControlTransparent() { Location = new Point(0, 0), Size = new Size(999, 999) }; Panel toolbar = new Panel() { Dock = DockStyle.Top, Height = TOOLBAR_HEIGHT, BackColor = SystemColors.Control, Padding = new Padding(3, 3, 0, 3) }; brow_ShortCutBar = new Panel() { Dock = DockStyle.Top, Height = SHORTCUTBAR_HEIGHT, BackColor = SystemColors.Control, Padding = new Padding(0) }; brow_UrlTextBox = new TextBoxWaterMark() { WaterMark = "HTTP://...", Dock = DockStyle.Fill, Height = 20, Font = font_Title, BorderStyle = BorderStyle.None, BackColor = SystemColors.Control }; brow_UrlTextBox.KeyDown += (se, ev) => { if (ev.KeyCode == Keys.Enter) { f_brow_Go(brow_UrlTextBox.Text.Trim()); } }; brow_UrlTextBox.MouseDoubleClick += (se, ev) => { brow_UrlTextBox.Text = string.Empty; }; var btn_ToggleTab = new Button() { Text = tab_IconToggle, Width = 19, Height = 20, Dock = DockStyle.Right }; btn_ToggleTab.MouseClick += (se, ev) => { f_tab_Toggle(); }; toolbar.Controls.AddRange(new Control[] { brow_UrlTextBox, new Label() { Dock = DockStyle.Right, Width = 100 }, btn_ToggleTab }); this.Controls.AddRange(new Control[] { brow_Transparent, browser, brow_ShortCutBar, toolbar, }); }
void f_tab_LinkInit() { Panel barSearch = new Panel() { Height = 23, Dock = DockStyle.Top, //BackColor = Color.Gray, Padding = new Padding(9, 1, 0, 0), }; tab_LinkSearchTextBox = new TextBoxWaterMark() { WaterMark = "Search Link", Dock = DockStyle.Right, Height = 19, BorderStyle = BorderStyle.None, WaterMarkForeColor = Color.Gray, WaterMarkActiveForeColor = Color.DarkGray, }; barSearch.Controls.AddRange(new Control[] { tab_LinkSearchTextBox }); tab_LinkTreeView = new TreeView() { Dock = DockStyle.Fill, Font = font_Title, BorderStyle = BorderStyle.None, }; Panel barFooter = new Panel() { Height = 24, Dock = DockStyle.Bottom, BackColor = Color.Gray, }; tab_Link.Controls.AddRange(new Control[] { tab_LinkTreeView, barSearch, barFooter, new Label() { Dock = DockStyle.Left, Width = 1, BackColor = Color.LightGray } }); }
void f_brow_Init() { brow_Domain = brow_URL.Split('/')[2]; browser = new GeckoWebBrowser(); browser.Dock = DockStyle.Fill; browser.NavigationError += (s, e) => { Debug.WriteLine("StartDebugServer error: 0x" + e.ErrorCode.ToString("X")); browser.Dispose(); }; browser.DocumentCompleted += (s, e) => { Debug.WriteLine("StartDebugServer completed"); browser.Dispose(); }; brow_Transparent = new ControlTransparent() { Location = new Point(0, 0), Size = new Size(999, 999) }; Panel toolbar = new Panel() { Dock = DockStyle.Top, Height = TOOLBAR_HEIGHT, BackColor = SystemColors.Control, Padding = new Padding(3, 3, 0, 3) }; brow_ShortCutBar = new Panel() { Dock = DockStyle.Top, Height = SHORTCUTBAR_HEIGHT, BackColor = SystemColors.Control, Padding = new Padding(0) }; brow_UrlTextBox = new TextBoxWaterMark() { WaterMark = "HTTP://...", Dock = DockStyle.Fill, Height = 20, Font = font_Title, BorderStyle = BorderStyle.None, BackColor = SystemColors.Control }; brow_UrlTextBox.KeyDown += (se, ev) => { if (ev.KeyCode == Keys.Enter) { f_brow_Go(brow_UrlTextBox.Text.Trim()); } }; brow_UrlTextBox.MouseDoubleClick += (se, ev) => { brow_UrlTextBox.Text = string.Empty; }; var btn_ToggleTab = new Button() { Text = tab_IconToggle, Width = 19, Height = 20, Dock = DockStyle.Right }; btn_ToggleTab.MouseClick += (se, ev) => { f_tab_Toggle(); }; toolbar.Controls.AddRange(new Control[] { brow_UrlTextBox, new Label() { Dock = DockStyle.Right, Width = 100 }, btn_ToggleTab }); this.Controls.AddRange(new Control[] { brow_Transparent, browser, brow_ShortCutBar, toolbar, }); }