Form.PixelsPerInch no longer used in Delphi Tokyo - delphi

In older Delphi's (for example Delphi XE4), it is clear what the Form.PixelsPerInch property is for. If I change this property and save the form, close and then reload it, all controls and fonts on the form will be resized accordingly.
However, in Delphi Tokyo (maybe since Seattle) making such a change has no effect on the controls on the form, and seems to serve no purpose.
Is this correct?
If Delphi Tokyo is not using the PixelsPerInch property I wonder how it can correctly scale the form at different DPI's..

Related

How to apply DEFAULT style for all the project

I work with VCL and FMX on this application, we are updating pack by pack of the software to FMX.
Something I did on the code, changed the STYLE of the application.
On the design view, it is the DEFAULT style, without any style edition.
However, when the application is compiled the STYLE for all FMX forms are changed, and the screen become a mess, the buttons disappears, etc...
I don't know what has been done to achieve it, but I could not find a manner to set all project to DEFAULT LAYOUT.
I tried to use
TStyleManager.SetStyleFromFile('light.style')
using the samples from delphi folder.
However, noon of the .STYLE are the DEFAULT.
Is there any DEFAULT.STYLE?
Or any manner to set DEFAULT.STYLE on RUNTIME?

How to paint all VCL Styles tab sheet controls to a given canvas when the tab is not visible to the user?

Using C++ Builder 10.2, VCL & VCL Styles...
I have a TPageControl that has TFrames on each of its TTabsheets. One of these frames contains some TEdit controls that show data read from a device. After the reading is acquired and the frame is updated, the system may create a screenshot of this frame and store it in a jpeg file.
Since the TTabsheet in the TPageControl with the TEdit controls may not be visible when the jpeg is created, the jpeg may not have the text contents of the TEdit controls painted. This has given me fits.
I have found that by using a TStaticText that is styled, the text appears in the jpeg. This seems to be due to the fact that TStaticTextStyleHook.Paint (in VCL.StdCtrls.pas) draws the control itself rather than letting Windows do it.
There are two problems with using TStaticText. Selecting the SystemStyle choice (Windows) causes TStaticTextStyleHook.Paint to skip painting the control itself and delegates to Windows (I think). Also, the appearance of TStaticText isn't exactly what I want, but I may have to live with it.
Is Windows refusing to paint TEdit control contents because the parent is not Visible?
Is there a way to force Windows to paint the TEdit controls in this situation?
UpdateWindow() and RedrawWindow() does not work.

TBitBtn displays only using legacy Windows theme

I created the manifest file for my Delphi 6 application so it can display controls according to the theme defined by Windows (controls 6.0). Everything looks fine, except TBitBtn component, which is displayed using the legacy theme:
The behavior is the same on Windows XP and Windows 7, regardless of the current theme, even when no image is assigned to the TBitBtn component.
Now, when I put a regular TButton component on a form, it displays OK. If I then programmatically set an image to this button in runtime (using SendMessage(Handle, BM_SETIMAGE, IMAGE_ICON, LPARAM(Icon))), it immediately reverts its style to the legacy one.
Is there a way to either make TBitBtn use a proper style, or to display glyph on a regular TButton without reverting to the legacy one in Delphi 6?
In Delphi 6 it is not enough just to add the comctl32 v6 manifest. You also need to modify the VCL to be theme aware. The TBitBtn control is a VCL implemented control that, in its Delphi 6 incarnation, does not know anything about XP themes.
The standard way to deal with this is to add some third party software that performs the magic. That's the XP theme manager from Mike Lischke.
Here's a screenshot from a Delphi 6 application that includes the theme manager:

Embedding a VCL form in an FMX ScalingLayout

I am trying to embed a VCL form in an FMX form, where the FMX form contains a TScalingLayout set to alClient so that on form resize the entire content is scaled.
The only way I have found to embed the VCL form in FMX Form in the first place is like so:
VCLForm.ParentWindow := WindowHandleToPlatform(FMXForm.Handle).Wnd;
VCLForm.Show;
Unfortunately this leaves me unable to parent the VCLForm to my TScalingLayout directly, so when I resize my FMX form naturally the embedded VCL form does not scale.
I thought that if I can only put the VCL form onto a form directly I could just use another FMX form as a container and embed this container form in my ScalingLayout, but since I can only "embed" an FMX form in another by moving all its children my VCL form won't be moved.
Is there a way to embed my VCL form in a way that will scale its content in the same way all the FMX controls on my ScalingLayout are scaled ?
No it is not possible. The reason Firemonkey can scale its components is because Firemonkey makes and draws them all by itself from scratch.
Most VCL controls are made out of built-in Windows OS components that your program calls. And those don't have any ability to scale. They are not drawn by the VCL, the VCL tells Windows to draw them. So if FMX does not draw them, it cant scale them.

There is a TCustomStyleServices in Delphi 7?

In order to override TPanel's Paint procedure to make the background color clwhite in delphi 7, I am following #RRUZ Answer, but I can't find the TCustomStyleServices class.
There is an alternative to do what I want?
I'm using XPMan resource (IDK if changes anything).
Since Delphi7 does not support VCL-Styles, setting Parentbackground to false and Color to clWhite should fit your requirements.
You can see that the question, your link to, is tagged with VCL Styles tag.
How I can change the color of a TPanel with the VCL Styles enabled?
You can click on tthe tag below the question text and read it's description:
https://stackoverflow.com/tags/vcl-styles/info
The information says that VCL styles were introduced with Delphi XE2.
Since Delphi 7 was released somewhat before XE2 it can not contain that feature.

Resources