Delphi - how to customize IDE layout - delphi

Delphi 2010 - all patches, Win 8.1 64 bit. Reinstalled EVERYTHING... windows,etc, so functionally a new machine. Installed D2010, then installed GExperts and CnPack Wizards, as I had used them both before a really liked them.
I have 2 monitors, so I changed my layout to Classic Undocked. The default is to have the component palette at the top right of the Delphi main window.
In my previous release, I was able to change the HEIGHT of this window to double whatever it is now, and drag the palette UNDERNEATH the glyphs from the File / Edit / Search area, so that way my component palette went across the whole screen. For whatever reason, I cannot do this now. When I move my mouse to the BOTTOM of the delphi window area, I get the "expand window up and down" cursor, like I should, but the window refuses to increase in height. There is some setting preventing me from increasing this windows height, but I can't find it. What setting am I looking for in order to be able to increase the height, so I can drag/drop my palette to the bottom LEFT corner of this window?
Thanks

The size of the main undocked window cannot be modified by resizing it manually. It is sized so that it is exactly large enough to contain its children. So, you can do what you want by moving the component palette to the desired location. When you do so the main window will increase in size so that the component palette fits.
Judging by your screenshot, your toolbars are drawn in a way to indicate that they are locked and cannot be dragged. That's not functionality that is present in the plain vanilla Delphi IDE, so I suspect that you have used functionality from either GExperts or CnPack to lock your toolbars. Obviously you'll need to unlock them in order to move them.
Finally, I should point out that the inability to resize the main window vertically is not new. Classic Delphi versions (e.g. Delphi 7) behaved in exactly the same way. So I think that the fundamental issue is not related to a Delphi version upgrade, but rather is related to you having locked your toolbars.

Related

Delphi 11.2 Patch 1 frames and High-DPI

I have encountered a problem with Delphi's multi monitor high-DPI support that I would welcome any insights you might have. I am using Delphi 11.2 patch 1 on a 5K monitor with Delphi's form designed set to Automatic (Screen PPI)
I have a small test project with a TDBAdvGrid and a TDBNavigator at the top of the form and a separate Tframe at the bottom of that form added at design time also having a TDBNavigator and a TDBAdvGrid on it. When I run the program initially it all looks fine.
As I said,I am designing on a 5K monitor (5120x2880) at 200% font scaling and I have a second monitor attached (1920x1080) at 100% font scaling. If I drag the form onto the second monitor the grid and navigator on the form appear to respond nearly as they should (just doesn't get the column widths quite correct) but the grid and the navigator in the TFrame don't.
Then if I drag the form back to the main monitor the TFrame is even more messed up
Do you have any recommendations on how to handle this? Should I be doing something with the main form's onBefore/OnAfterMonitorDPIChange events?
This high-DPI stuff all seems very much work in progress. And if I wanted to persist the column widths in an ini file, how would that work? Would I have to save it separately for each monitors PPI settings?

WebView2 (TEdgeBrowser) not working in background (if not visible on screen) - only shows as grey rectangle

I've confirmed this issue using the standard Delphi 10.4 EdgeBrowser VCL demo with the only difference that I have put the panel with the edgebrowser component on a TPageControl Tabsheet.
Now if my app starts with the Edgebrowser not visible directly on screen (because another tabsheet is active), the Edgebrowser will never fully paint on screen at any later date. It will ever only present itself as a grey rectangle and cannot recover from that, unless I call EdgeBrowser.CloseWebView; EdgeBrowser.CreateWebView; while the Edgebrowser component is visible on screen (it must be visible, or once again nothing happens).
This means I cannot issue "Edgebrowser.Navigate" commands or to anything while the Edgebrowser is in the background, on another tabsheet or while the form is hidden, or it will "go grey" again.
I wonder: Is this a bug or am I missing something major here? I tried calling Edgebrowser.Refresh and Edgebrowser.Repaint but neither help. Once it's grey, only closing and re-creating WebView helps to recover it.
It seems clear to me that this is some kind of canvas issue but I have no clue where to go from here.
I hope you can help or at least confirm this strange behaviour.
System Specs:
Delphi 10.4 Update 1 in Windows 10 Pro 20H2 in VMware Workstation 16
microsoft.web.webview2.0.9.579 from nuget and latest Edge Runtime from here (installed with bootstrap installer)
To quickly recreate the same scenario on your system:
open "C:\Users\Public\Documents\Embarcadero\Studio\21.0\Samples\Object Pascal\VCL\WebBrowser\Edge\EdgeBrowser.dproj"; cut pnlWebViewHost to the clipboard (this is the panel that contains the Edgebrowser component); insert TPageControl; add 2 tabsheets and paste the pnlWebViewHost on one of them. Switch to the other, empty tabsheet, then run the app. At runtime, click on the tabsheet with the browser which should only appear now as a grey rectangle.

10.4 IDE Cuts Off Component Toolbar

I downloaded latest Delphi IDE (10.4) and installed it. I turned off the embedded designer and set the layout to Classic Undocked.
Now the toolbar, in fact everything in the top form, is cut off. Can't see the save icons, run button or anything else. Also can't expand the form to make it taller.
If I change to startup layout it will let me expand the form, but I prefer Classic Undocked. Has anyone else had this yet and, more importantly, does anyone know a workaround?
I stumbled on a workaround for this problem. Here are the steps that makes the entire tool panel visible for me in Classic Undocked mode for Delphi 10.4 Sydney (on Win 7):
Grab the right edge of the top form (Classic Toolbar) and resize it slightly (make sure it is in Resizeable mode, not Full Screen). Zap! now everything works. Not only that, it appears to remember the "lesson" permanently once this has been done once - it is a complete and permanent fix.
This bug should be trivial for Embarcadero to fix.

How to restore/clear form position after multi-monitor setup change

Within the IDE, when F12 toggles between code and form,
the forms are displayed outside the monitor borders,
and therefore not visible.
This happens after a multi monitor setup has changed,
and the forms no longer open within the available new monitor screen areas.
One way to resolve this is to use the property inspector and
set the Top/Left properties to 4 to make the forms visible.
This is however a lot of work,
especially if many forms and possibly many projects are involved.
Is there a better way to reset the form locations once and for all,
so they are all visible with the new monitor setup?
There is nothing (AFAIK) in Delphi 6 IDE that would help. But assuming you are using Windows, the help is near, (tested on Windows 7):
Right-click on taskbar and select 'Cascade windows', this affects all windows in one go.
or
Alt-Tab to the window, press Alt-Space and then M (for move). Move the window with the arrow keys. This you would have to do seperately for each window.
Close your Delphi IDE. Then, if your current project group file is xyz.groupproj, open the file xyz.dsk with an text editor. Look for section [UndockedDesigner] entry "Count" and change its value to zero.
[UndockedDesigner]
Count=0
That will force all design window positions to 0,0 on your main monitor.

Greyed TWebBrowser control

When TWebBrowser control is too small it becomes greyed.
If TWebBrowser control is aligned to alClient and there are no other controls on the form I can make it really small (50x10 for example). However, when I add other controls like panels, toolbar, main menu and so on which all float on top (alTop) - the more controls I add it seems, the smaller window of TWebBrowser I can get without greying itself. When window is resized to become larger, then it becomes ungreyed again.
In this example I placed TToolBar with 2 buttons aligned to alTop, and TWebBrowser aligned to alClient. If I make toolbar invisible, I can make web browser really small. However, with toolbar visible it greys itself. The more controls I add it seems to have less and less usable space before greying itself.
As you can see in last example web browser is even smaller than in second example but still visible and everything is the same except there is no toolbar on top. Same applies if used on Windows 7 or 8 or with Internet Explorer 10 or 11.
The examples here are just examples. I don't have a problem with having 100x100 control as minimum size. The problem is that when I place quite a bit of controls then it doesn't allow me to have smaller control than 550x250, which is quite large.
Can anyone enlighten me why other controls have an effect on web browser not being able to use smaller size when it can do this perfectly normally when there are no other controls on form?
Many thanks to bummi in the comments up there for finding a following workaround:
It appears that the problem with greyed control doesn't appear in XE3 and later but can be reproduced in earlier versions like XE2, XE, 2010 and 2009.
For these earlier versions the workaround is to place TWebBrowser on another control such as TPanel and then align both controls to alClient (so that the TWebBrowser fills entire TPanel and TPanel fills entire area previously filled by TWebBrowser). Of course, alignment here is not an issue but the workaround is just to place one control on another.
The same works for TEmbeddedWB and probably other controls that host Internet Explorer ActiveX control.
When placed on container control like TPanel, web browser can be resized to any size without the problem described above.

Resources