Announcement

Collapse
No announcement yet.

PluriBASIC - New control for Android compilations (WebView)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • PluriBASIC - New control for Android compilations (WebView)

    There is a new control called WEBVIEW for Android compilations. In it, you can open websites in the form of a control in the dialogs. It can be used for example like this:

    Code:
    [FONT="Courier New"][B]
    [COLOR="Blue"]CONTROL[/COLOR] [COLOR="Blue"]ADD[/COLOR] [COLOR="Blue"]WEBVIEW[/COLOR][COLOR="Black"],[/COLOR] [COLOR="Black"]hDlg[/COLOR][COLOR="Black"],[/COLOR] [COLOR="Red"]%ID_FORUMS[/COLOR][COLOR="Black"],[/COLOR] [COLOR="DarkGreen"]"https://www.powerbasic.com/"[/COLOR][COLOR="Black"],[/COLOR] [COLOR="Black"]0[/COLOR][COLOR="Black"],[/COLOR] [COLOR="Black"]0[/COLOR][COLOR="Black"],[/COLOR] [COLOR="Black"]360[/COLOR][COLOR="Black"],[/COLOR] [COLOR="Black"]300[/COLOR][COLOR="Black"],[/COLOR] [COLOR="Red"]%WS_JAVASCRIPT[/COLOR][/B][/FONT]
    The %WS_JAVASCRIPT allows the control to execute the javascript code in the invoked URL. Normally popup windows are disabled but the %WS_ALLOWPOPUPS allows the website to open dialogs via javascript code.

    The URL can be changed with CONTROL SET TEXT, If the text is an URL (starts with "http") the control will try to load the welsite, otherwise the text will be set to the control as HTML code directly.

    As a security meassure, CONTROL GET TEXT will not retrieve the HTML code in the control unless it is loaded manually. For URL loaded websites, this statement will only return the URL of the website loaded.

    Other control statements like CONTROL SET COLOR or CONTROL SET STYLE, may not have effect on it.

    This control has the same limitations as any mobile web browser, for example youtube videos need to be started manually via clicking the play button.
    www.patreon.com/pluribasic

  • #2
    I just re-uploaded the installer, correctling a bug in the engine.
    www.patreon.com/pluribasic

    Comment


    • #3
      A little more work has been put in this control. Now the WebView control sends 5 notifications to the parent dialog:

      %WM_FORWARDING
      Sent when a control is first created and when a URL link is clicked.

      %WM_PAGESTART
      Sent when the page starts loading. This message may be sent several times for a single page if it contains iFrames.

      %WM_DONELOADING
      Sent when a page is finished loading. This message is sent only once, for the main page and not for iFrames. Note that
      this message does not wait until images are loaded in the page, just the source codes.

      %WM_WEBERROR
      This message means the host app had an unrecoverable error, like out of memory or something similar. CB.Wparam will contain the error code number.

      %WM_HTTPERROR
      This message means an HTTP error was received. For a list of the HTTP Client errors please click here. The client errors are a value higher than 400, for example: 404 Not found. CB.Wparam will contain the error code number.


      For all this notifications, CB.Text will contain a string representation of the URL causing the event.
      For error notifications, it will also contain the text representation (if available) of the HTTP error description separated with $CRLF. For example:

      "http://www.powerbasik.com\r\n404 Not found."




      www.patreon.com/pluribasic

      Comment


      • #4
        Build 5.00.6.168178 will properly mute and stop stuff in the WebView when the host dialog is destroyed (DIALOG END) or when the control is individually killed (CONTROL KILL).
        www.patreon.com/pluribasic

        Comment

        Working...
        X