Page 1 of 1
chr window width problems
Posted: Fri Aug 18, 2017 5:42 pm
by snoop
hello! some more questions:
1. what is difference between tchromiumwindow and tcefwindowparent??
2. I have weird things while changing width of tchromiumwindow; I have align=alNone; And I have trouble setting big width. When I set it ~over 1000, the window size changes, but part of browser over 1000px is inactive and grey. I have some other components in my project so I even tried to bring it to front everytime I change size in case something is overlaying it, but its not. MaxWidth is unlimited (default 0).
Your demos have no troubles with big sizes, but use align=client. Any help on my problem?? I can do screenshots. Also, I see some methods like .UpdateSize or .NotifyMoveOrResizeStarted
They didnt seem to help me yet...
I also tried to make on SimpleBrowser demo align=alNone and just made on form resize to set chromium window width:=form.width; worked fine... what can cause a problem in my project ?
3. cookies/cache. how should i write directory? full path or relative? they seem not to be stored in my project directory
Can you give full example? Like GlobalCEFApp.cookies:=...;
Re: chr window width problems
Posted: Sat Aug 19, 2017 11:09 am
by salvadordf
Hi,
snoop wrote: Fri Aug 18, 2017 5:42 pm
hello! some more questions:
1. what is difference between tchromiumwindow and tcefwindowparent??
TChromiumWindow inherits from the TCefWindowParent class and includes a TChromium.
It's just a simpler way to create a browser.
snoop wrote: Fri Aug 18, 2017 5:42 pm
2. I have weird things while changing width of tchromiumwindow; I have align=alNone; And I have trouble setting big width. When I set it ~over 1000, the window size changes, but part of browser over 1000px is inactive and grey. I have some other components in my project so I even tried to bring it to front everytime I change size in case something is overlaying it, but its not. MaxWidth is unlimited (default 0).
Your demos have no troubles with big sizes, but use align=client. Any help on my problem?? I can do screenshots. Also, I see some methods like .UpdateSize or .NotifyMoveOrResizeStarted
They didnt seem to help me yet...
I also tried to make on SimpleBrowser demo align=alNone and just made on form resize to set chromium window width:=form.width; worked fine... what can cause a problem in my project ?
Have you tried to create a TPanel with align=alnone and then add a TChromiumWindow with align=alclient inside the TPanel ?
snoop wrote: Fri Aug 18, 2017 5:42 pm
3. cookies/cache. how should i write directory? full path or relative? they seem not to be stored in my project directory
Can you give full example? Like GlobalCEFApp.cookies:=...;
You can use full and relative paths.
If your application is in
c:\my projects\my app directory and you set GlobalCEFApp.cookies to '
cef', then the cookies will be stored in
c:\my projects\my app directory\cef
You can also use full paths in GlobalCEFApp.cookies like this :
GlobalCEFApp.cookies := 'e:\cookies';
Re: chr window width problems
Posted: Tue Aug 22, 2017 10:25 am
by snoop
hellO! Thank you for reply again.
The problem #2 was because of #1. I was using TChromiumWindow, and it resizes incorrect with cuts. parentwindow works fine!
But I have more questions on #3. I have these settings now:
GlobalCEFApp.Cookies := gsAppPath+'cookies';
GlobalCEFApp.Cache := gsAppPath+'cache';
GlobalCEFApp.SmoothScrolling:=true;
GlobalCEFApp.FastUnload:=true;
GlobalCEFApp.DeleteCache:=false;
GlobalCEFApp.DeleteCookies:=false;
I don't see cookies folder, But I see cookies file in 'cache' folder. is it what i need?
Also, say some words about smoothscrolling and fastunload please.
And also, in which files browser preferences (zoom for example) are stored?
Re: chr window width problems
Posted: Tue Aug 22, 2017 4:56 pm
by salvadordf
snoop wrote: Tue Aug 22, 2017 10:25 am
But I have more questions on #3. I have these settings now:
GlobalCEFApp.Cookies := gsAppPath+'cookies';
GlobalCEFApp.Cache := gsAppPath+'cache';
GlobalCEFApp.SmoothScrolling:=true;
GlobalCEFApp.FastUnload:=true;
GlobalCEFApp.DeleteCache:=false;
GlobalCEFApp.DeleteCookies:=false;
I don't see cookies folder, But I see cookies file in 'cache' folder. is it what i need?
Close your app, delete the contents of the 'cache' folder, compile your app and run it.
If you have write privileges in that directory you should see a 'cookies' folder next to the 'cache' folder.
snoop wrote: Tue Aug 22, 2017 10:25 am
Also, say some words about smoothscrolling and fastunload please.
SmoothScrolling : This property appends a '--enable-smooth-scrolling' command line switch which enables smooth scroll animation on platforms that support it.
FastUnload : This property appends a '--enable-fast-unload' command line switch which enables the fast unload controller that speeds up tab/window close by running a tab's onunload js handler independently of the GUI.
For more information about TCEFApplication properties read this :
https://www.briskbard.com/index.php?lang=en&pageid=cef
Many of them are used in the CEF initialization :
http://magpcss.org/ceforum/apidocs3/pro ... ngs_t.html
More command line switches can be found here, but not all of them work in CEF :
http://peter.sh/experiments/chromium-co ... -switches/
https://bitbucket.org/chromiumembedded/ ... ew-default
snoop wrote: Tue Aug 22, 2017 10:25 am
And also, in which files browser preferences (zoom for example) are stored?
Some preferences are stored by the chromium engine, probably in the TCEFApplication.UserDataPath directory.
The rest must be stored by your application.