WebBrowser : VCL to FMX [duplicate] - delphi

I'm trying to create an Android (multi-device) application with Delphi 10.2 that uses TWebBrowser. I load a URL and I want to parse its contents for fields, but I don't know how do it.
I read this excellent guide: http://www.cryer.co.uk/brian/delphi/twebbrowser/twebbrowser_oleobject.htm#OleObject.Document, but the property WebBrowser.OleObject.Document doesn't exist.
Can somebody help me, please?

The TWebBrowser for FMX is completely different from TWebBrowser for VCL. The VCL one makes use (for access to the Document, etc) of interfaces provided by Internet Explorer, or rather the DLLs on which it is based. IE only runs on Windows, so you shouldn't be surprised to learn that the interfaces it provides are not available on FMX.
The FMX TWebBrowser is a completely different and far more limited beast. It is not automatable in the same way TWebBrowser for VCL/Windows is, and some would say that is a good thing.

Related

Using FMX forms in a VCL application in XE7?

Even though it is not officially supported by Embarcadero there are many examples showing that you can include a FMX form in a VCL application e.g. MonkeyMixer and this SO question.
However, when I create a test application with only one empty VCL form and one empty FMX form, I get two problems:
There are two application icons in the task bar (apparently one for
each instance of TApplication i.e. VCL and FMX)
It crashes when I close the application (when it calls TStyleManager.UnInitialize in FMX.Forms.FinalizeForms).
How can I make this work?
I need this combination as we want our application to be native on Windows, Mac OS and iOS. Therefore on Windows it is a VCL application and the other OS's are FMX using the TMS native components. We have some large custom graphical components that are made for FMX, and they must also work on Windows.
Edit:
I see only two alternative solutions, and I like none of them:
Use FMX on Windows too. I don't like the idea of styled components instead of native. Experienced users can easily tell the difference.
Maintain to sets of our custom components: VCL and FMX editions. That will require some work, and also the graphical features of FMX are much better than VCL.
I've needed to host an FMX app inside a VCL app for display and training purposes. The FMX app is really an Android target and the VCL a Windows 'demonstrator'. The FMX hosting is done using TFireMonkeyContainer hosting the FMX main form. Yes it's got slight wrinkles but it works ok and I'm sure we'll find a way to improve things.
My FMX main form is created at runtime and has visibility of only FMX.Forms. It is then passed to TFireMonkeyContainer and is destroyed by it when the VCL app closes.

How to read page source TWebBrowser Firemonkey

How can I read source of the open page in TWebBrowser in firemonkey (RadStudio XE7 - Firemonkey for Android)
In VCL I simply used WebBrowser1.document but in firemonkey it has an error
TWebBrowser does not contain a member named document
How can I fix that?
The sad answer is that you can't access the source code of a webpage directly from the TWebBrowser. You can't access it because the TWebBrowser in FireMonkey is cross-platform and that means it must work on all platforms. Android and iOS does not support and allow this, which means the Windows Desktop version of TWebBrowser can't allow this either.
You will have to use a different component to do this, probably a third party component.
I am not sure if this will help you or not, but here is a link to something that might help: http://firemonkeylessons.blogspot.tw/2015/01/get-htmljson-from-twebbrowser.html

Form/Button/other component styles

Ok, so I downloaded a .zip file of all different kinds of examples from embarcadero... the way the buttons look and among other things are completely different from when I just create an application within my Delphi 7. I believe these examples were made for or made at a new time... because the button look way different from the way the button when I put them on my application. the buttons from the example look very modern and sleek and have mouse over effects (This applies for all the examples..its not a custom component ) I was wondering I can get this effect in my own applications within Delphi 7.. I can do this by opening one of the examples and just erasing all the code... but that's not what im trying to do..im wondering how I can accomplish these styles.. how come the examples have these nice looking buttons and such..but when I make an app within D7 its much older looking and such..
I apologize if my question is hard to understand.. and I appreciate any help on this.
Thank you in advance.. I appreciate it.
If I understand your question correctly, you're asking about the native control appearance changes that were added by the addition of Windows Themes in Windows XP.
Delphi 7 supported themes by use of the XPManifest component, which does nothing but add a manifest to your application which tells Windows your app is theme-aware and therefore it should load a more recent version of the common controls library. You can find the XPManifest component in the VCL component palette on the Win32 tab, or simply add the XPMan.pas unit to your uses clause. Note that the themed drawing does not work for all controls (grids, for instance, are not drawn using themes, and IIRC neither is TSpeedButton - it's been a long time since I used D7, so I'm not sure exactly what is and isn't supported, but the support is limited).
Starting with Delphi 2007, there is built-in support for Windows Themes, which is available by default in new projects. It can also be enabled in older projects using a checkbox in the Project->Options->Application dialog.
(Of course the real answer is that if you want your app to have the features included in modern versions of Windows, you should upgrade from your Windows-95 era version of Delphi to one that is more recent.)

Is it possible to buy/download/try components used in Adobe products like (Adobe Encore) for delphi?

Here is the screenshot of the Adobe Encore program.
Here you can see the set of the darkish components.
Can such be bought, downloaded, etc? Are they made public from Adobe Cor.?
Thanks
The easiest way to achieve that look and feel is either:
To purchase a skin engine or component library that has skins enabled, if you must use an old version of Delphi prior to XE2.
But the preferred method is to just use the VCL skins library that comes in Delphi XE2, called VCL Styles. Unfortunately it has bugs, but so do all the other skin libraries. You can also achieve similar results in Delphi XE2 using the Firemonkey framework, which like whatever non-delphi technology is used in Adobe products, eschews native controls for a completely self-contained environment that can look any way you want it to.
If you want funky/pretty user interfaces, personally, I recommend you get Delphi XE2. If you insist on "try/buy/component" then I suggest you look into the Developer Express component suite, or one of the ones listed in this question such as VCLSkin.

Switch GUI application behavior between SDI and MDI

I currently have an SDI application that is build with Delphi 7, I want the final user to choose the type of interface between SDI and MDI at runtime. my question is how can I change the behavior of the application between SDI and MDI at runtime?
Currently I know a couple of applications build with delphi that allow this: EMS SQL Manager and TOAD.
thanks in advance.
Download the Jedi JVCL and install it and look at the Demos for JvDocking "docking in code". They do this exactly.
They mean that you do not actually use the FormStyle=fsMDIChild unless you want lots of problems. MDI is "emulated" when you need it by docking in code.
Do not convert windows into frames. This is a bad solution.
For an MDI-like environment, that does not have the MDI problems, use a docking solution (components either commercial or open source that support docking). I use JvDocking which is included in the JEDI JVCL, which is free and open source.
You use your forms in both "docked" and "undocked" (floating) modes, and this gives you a docked IDE look and feel (VIsual Studio and RAD Studio), and an undocked IDE Look and feel (RAD Studio in undocked, or classic delphi 7).
I would convert my current windows into frames and put these frames with align=alClient into either mdi child windows or normal windows as configured.
But beware: I have never actually done this, so there might be problems that I don't know about.
At runtime set TForm.FormStyle either to fsNormal or fsMDIChild depending on if you want SDI or MDI.
Like #WarrenP's solution, I strongly recommend a docking-based solution. It should be said that you don't need to use Jedi VCL to achieve this. As an example, here's a very simple (all-native-vcl) component I've produced which allows you to simply drop on as many instances to your form(s) and set their alignment to enable docking (and tabbed docking) in those regions.
MDI itself is an accident waiting for a place to happen. There are solutions available to achieve the "MDI look and feel" without using MDI itself, though I've yet to encounter one I'd consider "neat" (probably for a lack of looking).
Ultimately you should probably question the wisdom in providing MDI as an option. Docking (with or without the ability to undock, and especially when Tabbed Docking is a user-determined choice) feels more modern, and (done properly) can be far more flexible and intuitive than MDI ever was.
Just my 2-pence worth.

Resources