TButtons and "runtime themes": peculiar behavior - delphi

Have you seen this?
I have a little utility application (for easy load / test xml generation from CDS and/or DBGo), and I had put some buttons (the poorest button of all, TButton) to trigger some actions.
I never paid attention to appearance, because I'm the only one that uses it. So today I added a new button, and they appeared different from the others in designer - but not when running. It's just an copy and paste process (change the button name, caption and event - the rest is equal to the origin).
When I looked the other buttons have an grey gradient and round corners, the button I copied and pasted not (just a bare rectangle). When running all buttons where just bare rectangles.
So I discovered that on designer, W7 and delphi are applying themes. On running, they are obeying the Project/Options/Application/Enable runtime themes flag.
This is annoying. There's a way to make Delphi doing that obeying the project options flag on forms designer?
(Or even manually if is not possible to automate that)?
EDIT:
The toolbars on the form are from CNWizards ;-)
EDIT II:
Apart of disabling themes for the IDE executable, all buttons get themed equally if the form (or project) is reloaded. But it's really weird.

If you want to enable/disable themes in the IDE, then open the properties of bds.exe, select the 'Compatibility' tab, and make sure that the 'Disable visual themes' checkbox is unchecked/checked.
Programs that you run from the IDE will inherit the compatibility settings of the IDE.

Delphi IDE itself is an application and the way the designer draw the form is using the setting for the IDE application (delphi32.exe or bds.exe's compatibility settings) so the answer is no. The default behaviour is different between IDE versions, for eg. the opposite behaviour (not drawing themed) happened in past.

Related

Delphi 11.2 Speedbuttons don't show border at design time

Running windows 10 21H2. Just upgraded to Delphi 11.2 (from 11.1).
Speedbuttons (with Flat=False) do not show the button rectangle at design time. It does appear at runtime.
Most/all of our VCL projects have an empty style name. I have noticed that if I set the Stylename for the button (or even the form), then it shows normally. But is this the best way of handling it? Is there a global setting somewhere that can restore "normal" behaviour?
In 11.2 the Form Designer Options have a new option Mimic the system style, which is active by default. Disabling that should solve your problem.
Form Designer Options

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?

Is it possible to have the Design/Form window open while the Code/Unit window is open? [duplicate]

I program in Delphi 2010, and I have enough screen space to show both a form and its code (that is, the code and design tabs of a form) at the same time, but so far I haven't had any luck trying to make that happen. Is there a way to customize the IDE to show both at the same time?
Set your desktop to "Classic Undocked"
Then you need to uncheck the embedded designer option in the VCL Designer options page:
You'll also have to restart the IDE for those changes to take effect.
The option Andreas is talking about is located under Tools | Options | Environment options | VCL Designer. It is called Embedded designer.
When you uncheck that a form will be displayed free-floating at its designed position instead of embedded in the docked editor. You need to restart the IDE for the option to take effect.
To show both form and code you will have to change your layout and/or move the form to a position where it doesn't cover the code editor.
As an alternative you could opt for the classic undocked layout. That way you can certainly position form and code editor not to overlap. To activate that you need View | Desktops | Classic Undocked.
Note: be aware that the position of the form at designtime is reflected at run-time if you have a form's Position property set to poDesigned.
Cool hack for Delphi XE4-XE7:
Changing 'HKEY_CURRENT_USER\Software\Embarcadero\BDS\11.0\Form Design\Embedded Designer' to FALSE will bring the classic designed back.

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.

How can I get Delphi 2010 IDE to show a split view with a form and its code at the same time?

I program in Delphi 2010, and I have enough screen space to show both a form and its code (that is, the code and design tabs of a form) at the same time, but so far I haven't had any luck trying to make that happen. Is there a way to customize the IDE to show both at the same time?
Set your desktop to "Classic Undocked"
Then you need to uncheck the embedded designer option in the VCL Designer options page:
You'll also have to restart the IDE for those changes to take effect.
The option Andreas is talking about is located under Tools | Options | Environment options | VCL Designer. It is called Embedded designer.
When you uncheck that a form will be displayed free-floating at its designed position instead of embedded in the docked editor. You need to restart the IDE for the option to take effect.
To show both form and code you will have to change your layout and/or move the form to a position where it doesn't cover the code editor.
As an alternative you could opt for the classic undocked layout. That way you can certainly position form and code editor not to overlap. To activate that you need View | Desktops | Classic Undocked.
Note: be aware that the position of the form at designtime is reflected at run-time if you have a form's Position property set to poDesigned.
Cool hack for Delphi XE4-XE7:
Changing 'HKEY_CURRENT_USER\Software\Embarcadero\BDS\11.0\Form Design\Embedded Designer' to FALSE will bring the classic designed back.

Resources