Recent

Author Topic: How can I zoom a TWebBrowser on MacOS  (Read 1008 times)

Wilko500

  • Full Member
  • ***
  • Posts: 180
How can I zoom a TWebBrowser on MacOS
« on: March 24, 2024, 12:30:56 am »
MacOS:  I have installed TWebBrowser form this link https://macpgmr.github.io/MacXPlatform/lclwebbrowser-src.zip successfully.  I placed a TPanel on my form and the TWebBrowser on that panel.  The following code loads a web page I am trying to view but it is too big to fit on the panel. In my old VB6 working program I send Ctrl + or  Ctrl - to zoom the browser.  I am trying to mimic this in Lazarus but cannot work out how. I have read many suggestions but they relate to Windows.  Since I am developing on MacOS perhaps it is not possible? I would welcome confirmation of this or suggestions .  .  .
Code: Pascal  [Select][+][-]
  1. procedure TForm1.Panel1Paint(Sender: TObject);
  2. begin
  3.     WebBrowser1.LoadPage('https://www.PvOutput.org');
  4. end;  
  5.  
MacBook Pro mid 2015 with OS Monterey 12.7.6
FPC 3.2.3 Lazarus 3.7
FPC 3.2.2 Lazarus 3.4

jamie

  • Hero Member
  • *****
  • Posts: 7701
Re: How can I zoom a TWebBrowser on MacOS
« Reply #1 on: March 24, 2024, 02:46:42 pm »
you mean a scrollbar box?

if so, drop a TScrollBox on the panel and use that as the display surface.
The only true wisdom is knowing you know nothing

Wilko500

  • Full Member
  • ***
  • Posts: 180
Re: How can I zoom a TWebBrowser on MacOS
« Reply #2 on: March 24, 2024, 04:44:55 pm »
Thank you for your suggestion but no, I don’t mean a scroll bar. The Tpanel already has scroll bars which I can scroll. While that does work, sort of, it’s clumsy for my needs. What I actually want to do is to single click (a button) and view the full extent (width) of the web page. It gives me a very quick confirmation that all data is/is not uploaded.
I could just create another form of the appropriate size and show that rather than in panel on main form but that’s also rather clumsy.

The purpose of my program is to evaluate the practicability of migrating a Windows VB6 program that’s been working just fine for more than 10 years. Web browser is just one element of many. MS Access Db to SQLite done, timers done, HTTPS post & get next. What I don’t want to do is re-design/code the entire program.
MacBook Pro mid 2015 with OS Monterey 12.7.6
FPC 3.2.3 Lazarus 3.7
FPC 3.2.2 Lazarus 3.4

jamie

  • Hero Member
  • *****
  • Posts: 7701
Re: How can I zoom a TWebBrowser on MacOS
« Reply #3 on: March 24, 2024, 07:50:42 pm »
use the anchor editor to force the panel to stay in track with the form, this also includes the browser within the panel.

you can resize the form the panel lives in and the panel will grow with it.

Using your border icons, you have the option of maximin etc.

The anchor editor can be gotten with a right click on the designer or do it the hard way.

You can also employ a splitter where the panel can also attached itself to it.



The only true wisdom is knowing you know nothing

Wilko500

  • Full Member
  • ***
  • Posts: 180
Re: How can I zoom a TWebBrowser on MacOS
« Reply #4 on: March 24, 2024, 07:53:16 pm »
Thank you Jamie. I’ll have a look at this.
MacBook Pro mid 2015 with OS Monterey 12.7.6
FPC 3.2.3 Lazarus 3.7
FPC 3.2.2 Lazarus 3.4

 

TinyPortal © 2005-2018