Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: TChromiumFMX at RunTime..



Permlink Replies: 3 - Last Post: Jun 18, 2014 2:12 PM Last Post By: Eli M
Goga Goge

Posts: 2
Registered: 2/6/06
TChromiumFMX at RunTime..
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 19, 2012 8:28 AM
is anyone familiar loading the TChromiumFMX, on firemonkey form, at runtime? it seems like i cant get it to work. not sure why.
all i do is:

[..]
var chr: TChromiumFMX ;
begin
chr := TChromiumFMX.Create(nil);
chr.parent := form1;
[..]

then, to load any webpage, you have to write:
chr.browser.main.loadurl('http://google.com');

but i dont know why, the chr.browser returns nil for me.
how should i assign the chr.browser?

thanks.

Goga Goge

Posts: 2
Registered: 2/6/06
Re: TChromiumFMX at RunTime..
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 25, 2012 6:58 AM   in response to: Goga Goge in response to: Goga Goge
ok guys!
after few experiments, i got a solution for you!

basically there is a problem with this component creating at runtime. so all we do at the design time, is to create one Chromium browser, hide it and let it run.
then, to use it on your form, just assign new parent on it, and show it back!

to create more of them on runtime, just duplicate the current one using memory method. and there you have it!

:)
Marc C

Posts: 8
Registered: 5/6/07
Re: TChromiumFMX at RunTime..
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 11, 2014 9:00 PM   in response to: Goga Goge in response to: Goga Goge
Goga Goge wrote:
ok guys!
after few experiments, i got a solution for you!

basically there is a problem with this component creating at runtime. so all we do at the design time, is to create one Chromium browser, hide it and let it run.
then, to use it on your form, just assign new parent on it, and show it back!

to create more of them on runtime, just duplicate the current one using memory method. and there you have it!

:)
Hello Goga Goge,

I'm facing the same issue with XE6. Right now I got it to work by creating it as design time and just assigning its parent at runtime as needed, but there are a few fallbacks on this approach.

I tried using MyNewChromiumFMX := TChromiumFMX( MyExistingChromiumFMX.Clone( MyNewChromiumFMX ) ); with no success... any tips?
Eli M

Posts: 1,346
Registered: 11/9/13
Re: TChromiumFMX at RunTime..
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 18, 2014 2:12 PM   in response to: Goga Goge in response to: Goga Goge
I have an updated version here that addresses this problem.

http://www.fmxexpress.com/web-browser-component-for-delphi-xe6-firemonkey-on-windows-and-mac-osx/

Now you can do this to create at runtime:
procedure TForm1.Button1Click(Sender: TObject);
var
fBrowser: TChromiumFMX;
begin
fBrowser := TChromiumFMX.Create(Self);
fBrowser.Parent := form1;
fBrowser.Align := TAlignLayout.alclient;
fBrowser.InitializeBrowser; // this line is to add obligatory
fBrowser.Load(‘http://www.fmxexpress.com/’);
end;
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02