salvadordf / OldCEF4Delphi

OldCEF4Delphi is an open source project to embed Chromium-based browsers in applications made with Delphi.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HTML select pop-up location

Y-A-K-E opened this issue · comments

hi,

RIO 10.3 + FMXBrowser +windows 10

The select list is display outside the form.

markdown

Copy the code that handles the WM_MOVE and WM_MOVING messages inside uFMXApplicationService.pas to your application and set a breakpoint to make sure it's executing the TFMXChromium.NotifyMoveOrResizeStarted function.

uFMXApplicationService.pas is available in all FMX demos.

I use is SimpleFMX Browser demo, has NotifyMoveOrResizeStarted function.

procedure TSimpleFMXBrowserFrm.NotifyMoveOrResizeStarted;
begin
  if (FMXChromium1 <> nil) then FMXChromium1.NotifyMoveOrResizeStarted;
end;

url :
https://getbootstrap.com/docs/4.3/components/forms/#form-controls

Problems still exist.

WindowsState:= WSMaximized;
It's working.

Form can't get move messages,

I'm trying to solve it now.

var 
cz_chrome_l,cz_chrome_t:Integer;

procedure TForm1.Timer2Timer(Sender: TObject);
begin

//Form Move
if (cz_chrome_t<>Form1.Top) or (cz_chrome_l<>Form1.Left) then
  begin
    cz_chrome_t:=Form1.Top;
    cz_chrome_l:= Form1.Left;
    CzPanel.Size.Width:= CzPanel.Size.Width+1.0;   //Resize
    CzPanel.Size.Width:= CzPanel.Size.Width-1.0;
  end;

end;

procedure TForm1.ResizeCzChild;
var
  TempRect : System.Types.TRect;
begin
  if (FMXCZWindowParent <> nil) then
    begin
      TempRect.Top    := Trunc(CzPanel.Position.Y);
      TempRect.Left   := Trunc(CzPanel.Position.X);
      TempRect.Height  := Trunc(CzPanel.Size.Height);
      TempRect.Width:=Trunc(CzPanel.Size.Width);
      FMXCZWindowParent.SetBounds(TempRect);
    end;

end;


procedure TForm1.CzPanelResize(Sender: TObject);
begin
 if CZChromium.Initialized then
  begin
     ResizeCzChild;
  end;
end;