Delphi 11 theme export - delphi

I have recently installed RAD Studio 11 on a new VM. I have a huge active project in Delphi 10.2 in a different VM, that among other things uses themes. Migrating the D10.2 project to D11 is not an option right now. But I'd like to export the Windows 11 themes from the D11 IDE to use in the D10.2 project if that's possible. So far I haven't found a way to do the export. Am I missing something in the IDE, or is a 3rd-party tool available to do this? Or are the theme definitions in files stuck off in a folder somewhere that I'm not finding? Thanks.

OK, the downloaded .zip files containing the styles for D11 are stored in C:\Users\<user>\Documents\Embarcadero\Studio\22.0\CatalogRepository\<style name>, and the .vsf files from them are copied to the C:\Users\<user>\Documents\Embarcadero\Studio\19.0\Styles folder for D10.2. Restart the IDE and they show up in the list of available styles.
However, as David and Uwe noted, they don't work 100% as-is. They almost do - everything appears to work fine except forms with borderstyles that include a non-client title bar. On those forms, there's a large "X" in the middle of the title bar and a off-color square box on the left of that title bar underneath the form's icon (or underneath the title text for toolwindows without an icon.) Also, a few 3rd-party controls aren't quite right (TMS TAdvSpinEdits paint their up/down arrows wrong, etc.) These may be fixable with one of the style editors out there, or at least give a basis from which to create a new style .vsf that's D10.2 compatible. Or I can spend the money to get the D10.2 W11 styles pre-done from one of the styles vendors.

Related

Form/Button/other component styles

Ok, so I downloaded a .zip file of all different kinds of examples from embarcadero... the way the buttons look and among other things are completely different from when I just create an application within my Delphi 7. I believe these examples were made for or made at a new time... because the button look way different from the way the button when I put them on my application. the buttons from the example look very modern and sleek and have mouse over effects (This applies for all the examples..its not a custom component ) I was wondering I can get this effect in my own applications within Delphi 7.. I can do this by opening one of the examples and just erasing all the code... but that's not what im trying to do..im wondering how I can accomplish these styles.. how come the examples have these nice looking buttons and such..but when I make an app within D7 its much older looking and such..
I apologize if my question is hard to understand.. and I appreciate any help on this.
Thank you in advance.. I appreciate it.
If I understand your question correctly, you're asking about the native control appearance changes that were added by the addition of Windows Themes in Windows XP.
Delphi 7 supported themes by use of the XPManifest component, which does nothing but add a manifest to your application which tells Windows your app is theme-aware and therefore it should load a more recent version of the common controls library. You can find the XPManifest component in the VCL component palette on the Win32 tab, or simply add the XPMan.pas unit to your uses clause. Note that the themed drawing does not work for all controls (grids, for instance, are not drawn using themes, and IIRC neither is TSpeedButton - it's been a long time since I used D7, so I'm not sure exactly what is and isn't supported, but the support is limited).
Starting with Delphi 2007, there is built-in support for Windows Themes, which is available by default in new projects. It can also be enabled in older projects using a checkbox in the Project->Options->Application dialog.
(Of course the real answer is that if you want your app to have the features included in modern versions of Windows, you should upgrade from your Windows-95 era version of Delphi to one that is more recent.)

Best way to add icon to delphi 2007 app (win7)

I want to add icon to my delphi app. Icon was generated from image via ICOFX, including 128x128 and 256x256 (Vista) icons. I tried to add icon several times:
First of all, using Code Gear IDE: Project Options->Application->Icon. This was an easy way, but Vista-sized icons (128x128 and 256x256) were not added. When scaling in Windows Explorer Ctrl+Wheel, icon stoped increasing in size after 64x64. This happens because Delphi does not support big icons.
Then I tried to change icon in MyProject.RES file (using ResourseExplorer). It did not helped much.
When changing .exe-file icon using ResourseExplorer problems seems to be solved, but this is not a Path of a jedi, obviously. And some problems appears/remains, such as:
when changing .exe-file name (ex: from MEPROG.EXE to _MYPROG.EXE), file icon is changing either (128x128 and 256x256 icons disappeare).
when using MouseRightButton->Send to->Desktop to create a label, label's icon is of small resolution.
copy-pasting exe-file into some other directory(not in deplhi project output dir), could also change icon.
Is there a better way to do this, or I am doing this wrong way?
The Delphi 2007 IDE cannot handle large Vista icons, which use PNG compression. And neither can the brcc32 resource compiler that ships with Delphi 2007.
My solution, when I was still using legacy Delphi versions, was to make a .rc file containing the icons, and compile using the MS resource compiler, rc. The MS resource compiler does support such icons, and is readily available, for example with the Windows SDK.
See the change-log around 2.7 version
http://andy.jgknet.de/blog/ide-tools/ide-fix-pack/
it seems you just try to use Delphi without installing necessary fixes
PS. another way might be to make some command-line utility replacing icon resource and then auto-call it after compilation phase. Still ugly, but better than manually launchign ResEdit each time.
If you do not see the icon, you can just run the following command to clear the icon cache:
ie4uinit.exe -ClearIconCache
For Windows 10, use:
ie4uinit.exe -show

Delphi runtime theme enabled, but not used

In a legacy application (created in Delphi 6 under WinXP in 32-bit, recently ported to Delphi XE2 under Win7 in 64-bit) at design time, the standard controls look "modern", with color gradients etc. In run-time though, they look just like an old Win95 version.
That would not bother me much if, in particular, the default colors in TPageControl and TTabControl wouldn't make it really difficult to tell which tab is currently selected.
So my questions are:
What could make the theme not active at run time?
Is it possible to easily (e.g. through IDE configuration) make the design time look like the run time?
Note:
In the project options, I enabled runtime themes for each existing target. It didn't help.
I also tried to enable GlassFrame in the forms containing those controls. Unfortunately, the runtime look and feel stayed unthemed.
This application is built on a lot of in-house and external code that
I don't master (just a dwarf standing on shoulders of giants),
but whose source are available to me. Suspecting that some
instruction would disable themes at application startup, I looked for
some keywords like "Theme", "Skin", "TStyleManager", "SetWindowTheme"
hoping to solve this by myself. I could not find anything significant (to me, at least).
I tried to skin a small application as a test, using infos from
Question
Delphi XE2 VCL styles tutorial - how to change the style at runtime,
and it worked perfectly.
Skinning my application is not my goal. I just would like to be able to visually tune some GUI elements at design time, and it is easier if design and run time look alike.
It turns out that removing the line "{$R *.res}" in the dpr file had made the themes unavailable.
Under D6, I disabled version information in the project and replaced "{$R *.res}" with "{$R 'myApp.res' 'myApp.rc'}", to use my own rc file to have the version information in a separate, easy to edit file, and not to be forced to go through the project options.
Under XE2, that did not work anymore because the resource would often be overwritten (or not taken into account, I'm not quite sure) by Delphi during the build. I had to rename the rc file so that it does not match the application name, thus replacing "{$R 'myApp.res' 'myApp.rc'}" with "{$R 'myApp_rc.res' 'myApp_rc.rc'}".
Putting the "{$R *.res}" again (along with "{$R 'myApp.res' 'myApp.rc'}") seems to make things right with themes and not break the version information.
Thank you Brian for having me look in the good direction.
In my experience this is often due to project differences between DEBUG mode (used by default when in the IDE) and RELEASE mode. Open your project options and scroll to application (where themes styles and icon are defined). Notice that the platform and build option combo at the top holds separate values for each setting and I expect you will find that your DEBUG build config has runtime themes enabled but RELEASE does not.

i lost windows 7 effects after accidently modifiying 'compiled resource script '?

my forms look dull and windows 95 like in a large project that i have been programming(cant program all over again) i accidently modified 'comiled resource script ' for that project using a text editor,when i reopened my project it asked if i want to recreate some file to which i clicked yes. now my form look dull and windows 95 style, adding xpmanifest component does bring them back to xp theme but what about windows 7,i do not have windows7/vista so i cant test if my forms behave like win7 forms on win7 or not(but probably they'l look and feel like xp) how to make them win 7 style again
help!
i am using delphi 2010
Under the Project | Options menu, select the Application Section, then make sure there is a check box in Enable runtime themes.
With this enabled your forms should look good in Vista and Windows 7.
This replaces the need for the XpManifest component.
You can further enhance the look by adjusting the property of GlassFrame on each form.
First check "Project/Options/Application/Enable runtime themes" checkbox; it should be checked to enable Vista/Win7 "look and feel"
Updated
Open your project in IDE. Click "Project" from the main menu. From the "Project" menu click "Options..." - it is the last item. Now "Project Options" dialog appears. On the left panel click "Application". On the right panel you should see "Enable runtime themes" checkbox. It should be checked to enable theme support.
By deleting *.res file you can loose some project settings, but you can restore these settings from the "Project Options" dialog.
More important than ALL the advice on how to fix it. GET A REVISION CONTROL SYSTEM! And mistakes like this will be easy to fix. Two popular ones that are easy to use
git
svn (this is actually a shell extension that includes SVN)

How can I interrogate the Delphi component palette?

I have lots of components installed - trouble is when I want to find one I rarely use it takes ages to find it. I can look at the ALL choice which lists all components but finding one with say 'grid' in the title is still very time consuming. Is there a database of titles or (preferably) a text file I could interrogate and search?
Try DDevExtensions 1.61, it add ability to search for components for Delphi from version 5 and above, with other many improvement for the IDE.
Which version of Delphi? In recent versions, just click on the top of the palette and type "grid". Ctrl-Alt-P will focus the palette, and then you can just start typing.
In RAD2009 and RS2010, do this and it'll find all components with "grid" anywhere in the title.
Since you didn't specify which version of Delphi...
1) In older versions (D7 and before), you can right click on the component palette to see the properties. This shows all of the components you have installed one page at a time. It isn't searchable, but at least the list shows each component's name and package, so it's easier than using the popup hints on each individual component.
2) In Delphi 7, you can select View|Component List, which brings up a searchable alphabetical list of all components. Unfortunately, it only matches on the first part of the component name. The first version of the "new" tool palette had this same limitation.
3) DDevExtensions (free) allows partial string matches in the old component palette (D5-D7), and restores something like the old palette in newer versions of Delphi (D2005 and up). It's also included in Delphi 2010 for people who prefer that style. I like how the search works in Delphi 7, but in Delphi 2010, the filtering seems a little awkward to me. It filters the components and palette pages, but if you have matching components on more than one page, they aren't all shown at the same time. You still have to click on each individual page.
4) My favourite. I prefer the new tool palette (Delphi 2005 and up). Very configurable, lets me see the component names, shows components on more than one page at a time, dockable, etc.
Bottom line. If you don't have or don't like the new tool palette, get DDevExtensions.
Before Delphi 2005: Install DDevExtensions, then choose Tools -> DDevExtensions Options -> Component Selector -> Check the "Active" box, click OK
Delphi 2005 and later: Click in the component palette and type the name of the one you want.
Use GExperts - they help a lot.

Resources