HTML GUI Renderer

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
Kukulkan
Addict
Addict
Posts: 1352
Joined: Mon Jun 06, 2005 2:35 pm
Location: germany
Contact:

HTML GUI Renderer

Post by Kukulkan »

Hi,

I really wish that PB GUI is using some built-in HTML renderer (eg Chrome, Webkit etc) for GUI. By this, we would be able to use HTML and CSS for any GUI layout inside of a Window. We simply may add some PB-Related identifier to access the elements like we do for Dialog library?

Code: Select all

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>My test dialog</title>
  <link rel="stylesheet" href="css/styles.css?v=1.0">
</head>

<body>
  <script src="js/scripts.js"></script>
  <input name="txtFirstname" type="text"> 
  <input name="btnTest" type="button" value="OK"> 
</body>
</html>
Later on, we might be able to get the gadget ID (and bind events) using:

Code: Select all

Html.i = LoadHTML(htmlString.s)
HtmlDialog.i = OpenHTMLDialog(#PB_Any, Html.i, HTMLTitle(HtmlDialog.i), 400, 400)
Gadget.i = HTMLGadget(HtmlDialog.i, "btnTest")
; and
BindGadgetEvent(Gadget.i, @ButtonCallback(), #PB_EventType_LeftClick)
LoadHTML(), OpenHTMLDialog(), HTMLTitle() and HTMLGadget() are, of course, the new functions needed.

Just dreaming...
(Yes, I know about the Node.js and other techniques some users already posted. But this is handicapped and complicated stuff. We need some real native implementation).

Of course, it is needed to provide some more functionality:
* Accessing and manipulating all elements in DOM (eg like jQuery using name or id)
** Example: SetHTML(HtmlDialog.i, "btnTest", "value", "okay") -> will set attribute "value" of button to be "okay"
** Example: Ret.s = GetHTML(HtmlDialog.i, "btnTest", "value") -> will return attribute "value" of button
* Allow calling PB functions from JS and get returned value (string, integer, float, bool)
** Example: Ret.s = CallHTML(HtmlDialog.i, "ScriptName", Params.s) -> Will call JS function "ScriptName"
* Allow calling JS functions incl. parameters from within a PB function (eg HTMLExecute("function", ParameterMap))
** Example: JS is calling PB_Call("PBFunctionName", Para1, ParaN) to call PB function

So, I never said it was easy, but really cool, huh?
Seymour Clufley
Addict
Addict
Posts: 1233
Joined: Wed Feb 28, 2007 9:13 am
Location: London

Re: HTML GUI Renderer

Post by Seymour Clufley »

I like this idea, because a native solution always makes for tidier code. But what you describe can already be done using code available on the forum, however, we are limited to HTML4-era web technology because of the webgadget's reliance on Internet Explorer, which is literally a dead browser. IMHO it should be seen as a high priority to get PB up to date with HTML5.
JACK WEBB: "Coding in C is like sculpting a statue using only sandpaper. You can do it, but the result wouldn't be any better. So why bother? Just use the right tools and get the job done."
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: HTML GUI Renderer

Post by JHPJHP »

Seymour Clufley wrote:... however, we are limited to HTML4-era web technology because of the webgadget's reliance on Internet Explorer, which is literally a dead browser.
I agree that it would be great to have access to web features provided by the latest browser technology, but also wanted to mention that some HTML5 features are accessible from the WebGadget.
- see MP4 Player and YouTube Player

HTML5test:
- Internet Explorer 11.461.16299.0: 312 out of 555 points
- Microsoft Edge 41.16299.461.0: 476 out of 555 points
Seymour Clufley
Addict
Addict
Posts: 1233
Joined: Wed Feb 28, 2007 9:13 am
Location: London

Re: HTML GUI Renderer

Post by Seymour Clufley »

Yes, but as CSS evolves, IE11's CSS support doesn't evolve, which means that HTML which displays one way in all the modern browsers will display differently in the webgadget. And then you've got all the newer HTML5 things that IE11 doesn't support - even the "download" attribute on hyperlinks! It's ridiculous to be stuck in 2010.
JACK WEBB: "Coding in C is like sculpting a statue using only sandpaper. You can do it, but the result wouldn't be any better. So why bother? Just use the right tools and get the job done."
User avatar
Kukulkan
Addict
Addict
Posts: 1352
Joined: Mon Jun 06, 2005 2:35 pm
Location: germany
Contact:

Re: HTML GUI Renderer

Post by Kukulkan »

I also think that the current Webgadget is not sufficient. This is why I wrote
I really wish that PB GUI is using some built-in HTML renderer (eg Chrome, Webkit etc) for GUI.
I believe, especially because of the Linux issues, PB has to come with it's own component (like cURL, Ogre etc). Maybe the license of Webkit or Blink should be compatible with such product enhancements? So PB would have to compile/link the render engine into such projects. By this, it would be independent and still cross platform. Of course, the executables would be bigger.
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: HTML GUI Renderer

Post by JHPJHP »

I fully agree with you both, my post was only meant to clarify HTML5 support for people not familiar with its limitations.

I also recognize that this is the Feature Requests and Wishlists forum, and not the proper place to discuss features of the WebGadget; my mistake.
davido
Addict
Addict
Posts: 1890
Joined: Fri Nov 09, 2012 11:04 pm
Location: Uttoxeter, UK

Re: HTML GUI Renderer

Post by davido »

+1

@JHPJHP,
Thank you for the explanation, regarding the WebGadget; I found it useful.
DE AA EB
User avatar
CELTIC88
Enthusiast
Enthusiast
Posts: 154
Joined: Thu Sep 17, 2015 3:39 pm

Re: HTML GUI Renderer

Post by CELTIC88 »

I propose to integrate 'Chromium Embedded Framework' for pb

https://bitbucket.org/chromiumembedded/cef

8)
interested in Cybersecurity..
User avatar
chi
Addict
Addict
Posts: 1028
Joined: Sat May 05, 2007 5:31 pm
Location: Linz, Austria

Re: HTML GUI Renderer

Post by chi »

+1 for CEF
Et cetera is my worst enemy
The8th
User
User
Posts: 29
Joined: Fri Sep 04, 2015 10:23 am

Re: HTML GUI Renderer

Post by The8th »

The old Trident rendering machine of Internet Explorer is really hopelessly out of date.
The Edge machine has e. g. built in audio features (like live streaming) which IE never can do reguardless of what browser code you enter in FEATURE_BROWSER_EMULATION in the registry. This hint is often given when users complain that they cannot see up to date web pages in the WebGadget. But this hint is really useless. It does not make an Edge rendering machine out of an old IE renderer.

Recently I read somewhere that Microsoft has delivered a new browser emulation with Windows 10/1803 update which can simulate Edge. But it does not replace the old one automatically. Unfortunately I have lost the url and do not have further informations.

73s, Henry
DarkDragon
Addict
Addict
Posts: 2218
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Re: HTML GUI Renderer

Post by DarkDragon »

Wah please no. HTML/CSS/JavaScript grew to a big mess of historical crap. Use something like Android's XML language, but not HTML! Please, no! Btw. if you are concerned about your customer's security, then you'd basically have to update your application every hour or so, because new security flaws will be found in your "browser" you ship to them.
bye,
Daniel
Post Reply