Delphi与HTML / CSS接口 [英] Delphi with HTML/CSS interface

查看:271
本文介绍了Delphi与HTML / CSS接口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用一个HTML / CSS图形用户界面来开发一个delphi应用程序,而不一定是从网络浏览器中运行。我想这样做,创建一个更丰富的动画图形用户界面,并摆脱正常的VCL组件/ Windows外观。有什么建议么?

I want to develop a delphi application with an HTML/CSS graphical user interface, not necessarily running from within a web browser. I want to do this do create a richer graphical user interface with animations etc. and break away from normal VCL components / Windows look. Any suggestions?

推荐答案

在我的一个应用程序中,我有一个嵌入式浏览器,并且已经实现了IDocHostUIHandler界面。这允许我通过GetExternal方法暴露一个COM对象。我只是有一个COM对象,暴露了我的应用程序的方法和属性,使它们可以在嵌入式浏览器中托管的网页上。

In one of my applications I have an an embedded browser and I have implemented the IDocHostUIHandler interface. This allows me to expose a COM object via the "GetExternal" method. I simply have a COM object that exposes methods and properties of my application which makes them available to the web pages hosted inside the embedded browser.

所以我的网页中的脚本有external.DoSomething()和i = external.GetThisValue()这样的行。所以,例如,在按钮onclick事件之后,您可以运行一个应用程序的方法(在主窗体中实现,COM对象本身,或任何您喜欢的内容)。

So the script in my web pages has lines like "external.DoSomething()" and "i=external.GetThisValue()". So, for example, behind button onclick events you can run a method of your application (implement in the main form, in the COM object itself, or whatever you like).

该网站在您的Delphi应用程序中嵌入了很多浏览器的信息:
http:/ /www.delphidabbler.com/articles?article=22

This site has lots of info on embedding a browser in your Delphi app: http://www.delphidabbler.com/articles?article=22

实现很多这样的东西肯定会很麻烦,在很多情况下可能是更好的选择但是为了我的具体目的,我可以提供一个主页,可以轻松修改它,以改变其布局,查看,甚至暴露更多(或更少)自己或我的用户所要求的功能。

It can certainly be cumbersome to implement a lot of this stuff and in many cases there are probably better options. But for my specific purpose I am able to offer a "home page" which can easily be modified to change its layout, look and even expose more (or less) functionality as required by myself or my users.

这篇关于Delphi与HTML / CSS接口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆