
I don't think Delphi has a TMethodList class out of the box but it seems to be a good solution to the initialization.
Let me know when the MacOS demos are stable to remove the "experimental" label in the readme.
Did only see this post of yours now.salvadordf wrote: Sat Mar 06, 2021 1:54 pm I just saw all your work on the "fpc-for-discussion-context-init" branch and it looks really nice!![]()
I don't think Delphi has a TMethodList class out of the box but it seems to be a good solution to the initialization.
Let me know when the MacOS demos are stable to remove the "experimental" label in the readme.
It probably can be done by specializing a TGenericList<TNotifyEvent> / whatever it is called.salvadordf wrote: Sat Mar 06, 2021 1:54 pm I don't think Delphi has a TMethodList class out of the box but it seems to be a good solution to the initialization.
Code: Select all
c := count-1;
while c >= 0 do begin
// call
if c > count then c := count;
dec(c);
end;
I merged all your code. Thanks again!!!martin_fr wrote: Thu Mar 11, 2021 4:04 pm When you have some time (and I know I have been pushing a lot / i.e. pushing work your direction, not "git push") let me know where you want the latest commits to go. So no hurry.
I understand, you may not have the time to adapt the Lazarus work to be Delphi compatible. Or you may not like the concept of some of them. If so, that is ok. I can put them in a separate repro.
I can also put them in a separate repro and you can later decide to incorporate individual bits, as you see fit.
I would ask for the changes to existing components (such as new virtual methods in TBufferPanel) to be merged. As without some of my code can not work. (And I don't want to publish a copy of TBufferPanel).
I can create a new cut-down pull request, just for that.
Since you already merged "LazBrowserWindow", I would include changes to that.
Alternatively you can "un-merge" it, and I maintain it in a new repro.
I can only show you that the official CEF sample application (cefclient) handles the key events for Mac here :martin_fr wrote: Thu Mar 11, 2021 4:45 pm OSR (BrowserWindowOsrDom) is not 100% supported on Mac.
On all OS, the user must add the SysKeys. But on Mac there also seems to be other keys (cursor movement) that I did not get working.
For all OS, the user would have to add sys-key handling if they needs it.
There are some interesting discussions about this here too :martin_fr wrote: Thu Mar 11, 2021 5:05 pmIt probably can be done by specializing a TGenericList<TNotifyEvent> / whatever it is called.salvadordf wrote: Sat Mar 06, 2021 1:54 pm I don't think Delphi has a TMethodList class out of the box but it seems to be a good solution to the initialization.
The important thing is, when calling the events, to start at the last event.That way, if the event removes itself from the list while it is called, it will not affect the index of events still to be called.Code: Select all
c := count-1; while c >= 0 do begin // call if c > count then c := count; dec(c); end;
Maybe iterators can deal with that in an even smarter way, don't know.
Yes. Please rename it to TBrowserWindow.martin_fr wrote: Fri Mar 19, 2021 9:15 pm Should I rename the TLazarusBrowserWindow and other classes/units that have Laz/Lazarus in there name?
If they are going to be usable for Delphi, then it would be better to rename them now.
Code: Select all
MultiThreadedMessageLoop := False;
MultiBrowserMode := true;
Code: Select all
procedure TChromiumCore.doOnAfterCreated(const browser: ICefBrowser);
begin
if MultithreadApp or MultiBrowserMode then
AddBrowser(browser);
Code: Select all
function TChromiumCore.CreateBrowserHostSync( ....
begin
TempURL := CefString(aURL);
TempBrowser := TCefBrowserRef.UnWrap(cef_browser_host_create_browser_sync(aWindowInfo, FHandler.Wrap, @TempURL, aSettings, CefGetData(aExtraInfo), CefGetData(aContext)));
Result := AddBrowser(TempBrowser);