Example #1
0
        /// <summary>
        /// Populate the view given the specified text.
        /// </summary>
        /// <param name="contents"></param>
        /// <param name="editingEnabled"></param>
        /// <returns></returns>
        private void PopulateView(string contents)
        {
            if (browser == null)
            {
                if (ProcessUtilities.CurrentOS.IsWindows)
                {
                    browser = CreateIEBrowser(vbox2);

                    /// UGH! Once the browser control gets keyboard focus, it doesn't relinquish it to
                    /// other controls. It's actually a COM object, I guess, and running
                    /// with a different message loop, and probably in a different thread.
                    ///
                    /// Well, this hack works, more or less.
                    if (vbox2.Toplevel is Window)
                    {
                        (vbox2.Toplevel as Window).SetFocus += MainWindow_SetFocus;
                    }
                    frame1.Unrealized += Frame1_Unrealized;
                    if (this is MapView) // If we're only displaying a map, remove the unneeded scrollbar
                    {
                        (browser as TWWebBrowserIE).wb.ScrollBarsEnabled = false;
                    }
                }
                else if (ProcessUtilities.CurrentOS.IsMac)
                {
                    browser = CreateSafariBrowser(vbox2);
                }
                else
                {
                    browser = CreateWebKitBrowser(vbox2);
                }
            }
            browser.LoadHTML(contents);
            //browser.Navigate("http://blend-bp.nexus.csiro.au/wiki/index.php");
        }
Example #2
0
 public void ShowFor(IBrowserWidget browser)
 {
     this.browser           = browser;
     window1.TransientFor   = this.browser.HoldingWidget.Toplevel as Window;
     window1.Parent         = this.browser.HoldingWidget.Toplevel;
     window1.WindowPosition = WindowPosition.CenterOnParent;
     window1.Show();
     txtLookFor.GrabFocus();
 }
Example #3
0
        /// <summary>
        /// Populate the view given the specified text.
        /// </summary>
        /// <param name="contents"></param>
        /// <param name="editingEnabled"></param>
        /// <returns></returns>
        private void PopulateView(string contents, bool isURI = false)
        {
            if (browser == null)
            {
                if (ProcessUtilities.CurrentOS.IsWindows)
                {
                    browser = CreateIEBrowser(vbox2);

                    /// UGH! Once the browser control gets keyboard focus, it doesn't relinquish it to
                    /// other controls. It's actually a COM object, I guess, and running
                    /// with a different message loop, and probably in a different thread.
                    ///
                    /// Well, this hack works, more or less.
                    if (vbox2.Toplevel is Window)
                    {
                        (vbox2.Toplevel as Window).SetFocus += MainWindow_SetFocus;
                    }
                    frame1.Unrealized += Frame1_Unrealized;
                    if (this is MapView) // If we're only displaying a map, remove the unneeded scrollbar
                    {
                        (browser as TWWebBrowserIE).Browser.ScrollBarsEnabled = false;
                    }
                }
                else if (ProcessUtilities.CurrentOS.IsMac)
                {
                    browser = CreateSafariBrowser(vbox2);
                }
                else
                {
                    browser = CreateWebKitBrowser(vbox2);
                }
            }
            if (isURI)
            {
                browser.Navigate(contents);
            }
            else
            {
                browser.LoadHTML(contents);
            }

            if (browser is TWWebBrowserIE && (browser as TWWebBrowserIE).Browser != null)
            {
                TWWebBrowserIE ieBrowser = browser as TWWebBrowserIE;
                keyPressObject = ieBrowser.Browser.Document.ActiveElement;
                if (keyPressObject != null)
                {
                    (keyPressObject as HtmlElement).KeyPress += OnKeyPress;
                }
                ieBrowser.BackgroundColour = Utility.Colour.FromGtk(MainWidget.Style.Background(StateType.Normal));
                ieBrowser.ForegroundColour = Utility.Colour.FromGtk(MainWidget.Style.Foreground(StateType.Normal));
            }
            //browser.Navigate("http://blend-bp.nexus.csiro.au/wiki/index.php");
        }
Example #4
0
 /// <summary>
 /// Populate the view given the specified text.
 /// </summary>
 /// <param name="contents"></param>
 /// <param name="editingEnabled"></param>
 /// <returns></returns>
 private bool PopulateView(string contents, bool editingEnabled)
 {
     if (browser == null)
     {
         if (Environment.OSVersion.Platform.ToString().StartsWith("Win"))
         {
             browser = new TWWebBrowserIE(vbox2);
         }
         else
         {
             browser = new TWWebBrowserWK(vbox2);
         }
     }
     browser.LoadHTML(contents);
     //browser.Navigate("http://blend-bp.nexus.csiro.au/wiki/index.php");
     return(editingEnabled);
 }
Example #5
0
        /// <summary>
        /// Populate the view given the specified text.
        /// </summary>
        /// <param name="contents"></param>
        /// <param name="editingEnabled"></param>
        /// <returns></returns>
        private void PopulateView(string contents)
        {
            if (browser == null)
            {
                if (ProcessUtilities.CurrentOS.IsWindows)
                {
                    browser = CreateIEBrowser(vbox2);

                    /// UGH! Once the browser control gets keyboard focus, it doesn't relinquish it to
                    /// other controls. It's actually a COM object, I guess, and running
                    /// with a different message loop, and probably in a different thread.
                    ///
                    /// Well, this hack works, more or less.
                    if (vbox2.Toplevel is Window)
                        (vbox2.Toplevel as Window).SetFocus += MainWindow_SetFocus;
                    frame1.Unrealized += Frame1_Unrealized;
                    if (this is MapView) // If we're only displaying a map, remove the unneeded scrollbar
                       (browser as TWWebBrowserIE).wb.ScrollBarsEnabled = false;
                }
                else if (ProcessUtilities.CurrentOS.IsMac)
                {
                    browser = CreateSafariBrowser(vbox2);
                }
                else
                {
                    browser = CreateWebKitBrowser(vbox2);
                }
            }
            browser.LoadHTML(contents);
            //browser.Navigate("http://blend-bp.nexus.csiro.au/wiki/index.php");
        }
Example #6
0
        /// <summary>
        /// Populate the view given the specified text.
        /// </summary>
        /// <param name="contents"></param>
        /// <param name="editingEnabled"></param>
        /// <returns></returns>
        private void PopulateView(string contents)
        {
            if (browser == null)
            {
                if (Environment.OSVersion.Platform.ToString().StartsWith("Win"))
                {
                    browser = new TWWebBrowserIE(vbox2);

                    /// UGH! Once the browser control gets keyboard focus, it doesn't relinquish it to
                    /// other controls. It's actually a COM object, I guess, and running
                    /// with a different message loop, and probably in a different thread.
                    ///
                    /// Well, this hack works, more or less.
                    if (vbox2.Toplevel is Window)
                        (vbox2.Toplevel as Window).SetFocus += MainWindow_SetFocus;
                    frame1.Unrealized += Frame1_Unrealized;
                    (browser as TWWebBrowserIE).wb.DocumentTitleChanged += IE_TitleChanged;
                    if (this is MapView) // If we're only displaying a map, remove the unneeded scrollbar
                        (browser as TWWebBrowserIE).wb.ScrollBarsEnabled = false;
                }
                else
                {
                    browser = new TWWebBrowserWK(vbox2);
                    (browser as TWWebBrowserWK).wb.TitleChanged += WK_TitleChanged;
                }
            }
            browser.LoadHTML(contents);
            //browser.Navigate("http://blend-bp.nexus.csiro.au/wiki/index.php");
        }