How to auto-save in XE2? - delphi

Is there any way that I can have the Delphi IDE auto-save all opened projects every X minutes, or just before compilatilation? I looked in XE2 and in Gexperts and didn't see anything, but that means nothing as I am thick.

Check the checkbox in Tools->Options->Environment Options->Autosave->Editor Files. It will save the files on compile/run.
(If you haven't already, I'd also check Tools->Options->Editor Options->Create backup files, and set the File backup limit to 10 or more. This enables a sort of version control using the .history folder for each project (which you can access using the History tab at the bottom of the Code Editor.)

Andy's DDevExtensions has a "Compile Backup" option that automatically saves a copy of modified units to a .cbk file (e.g. Example.pas.cbk).

In Delphi Rio
Tools>Options>IDE>Saving and Desktop

CnPack seems to have such function since version 0.8.2
It is at CnPack - IDE enhancement Settings - Editor Enhancements - Tabset / Button - Auto Save All in my version 1.1.4.924 on the XE7:

Related

Delphi not opening projects

I have been using Delphi 2010 for some time with no issues but recently every time I try to open a project I get a dialog box asking me to open the project
with a folder that doesn't exist. How do I change the path Delphi opens projects.
Assuming you are using Windows...(up to 10 anyway)
Right click on the project's DPR and choose Properties.
What does the Opens with: line say? Mine says bdsLauncher.exe
If it says anything else, then you somehow had the system change it directly or indirectly. Virus, installation of some other text editor, whatever...not a big deal in any case. Do the same check for files with extensions DPROJ, GROUPPROJ, ...
If you need to change it, the file should be in a path similar to my C:\Program Files (x86)\Embarcadero\Studio\21.0\bin except that your version isn't 21.0
I did have issues once upon a time with XE7 where I had to set DPR to open with bds.exe, and DPROJ opened fine with bdsLauncher, but it was probably due to IT's setup of my laptop for someone else, and something with the Win 10 software reset (instead of a format or restore from clone) when they gave it to me. Installing an XE7 update fixed the problem, and it hasn't been an issue since we moved to 10.4

How can I change the IDE language of Delphi XE7

I want to change the language of the Delphi XE7 IDE from German to English. BDSSetLang.exe doesn't work for the toolbar and menu items (e.g. 'File / Open project' instead of 'Datei / Projekt öffnen').
Use BDSSetLang.exe in the bindirectory of your Delphi installation.
Did you notice that there are separate settings for the IDE UI and the Library?
QUICKFIX: Move all *.de files from the folder C:\Program Files (x86)\Embarcadero\Studio\15.0\bin\ to another location (so you can move them back if it does not work). If that fixes your issue, delete them.
(Or *.fr for French or *.ja for Japanese- (English is default).
for current versions (Delphi 10.4.2), the solution here works for me:
>cd C:\Program Files (x86)\Embarcadero\Studio\21.0\bin
>bdssetlang en

how to show the files thumbnails like windows explorer in delphi?

I use the TFileListBox control to show lists of files. But I wonder how to show the file thumbnails in the same way that Windows Explorer does?
You should try using the ShellControls components included in Delphi. (Note that David Heffernan sort of mentioned, and TLama made the initial specific suggestion in the first two comments to your question.) They're not installed by default in recent versions, so you'll have to install them yourself.
These instructions are for the version of Delphi you've indicated you're using (Delphi 2010) - they're the same basically for XE/XE2, except they're in the Samples\Delphi\VCL\ShellControls folder instead (and the Start entry contains XE or XE2 instead of 2010, of course).
Use Start->All Programs, navigate to the Embarcadero RAD Studio or Embarcadero Delphi 2010 item, expand it, and choose Demos. It's in the Win32 folder under DelphiWin32\VCLWin32\ShellControls. Open and build the vclshlctrls.dproj first, and then build and install the dclshlctrls.dproj. You'll need to add the folder above to your Project->Options in the search path for the compiler to be able to find them.
To install the components after building the second package, right-click on the project in the 'Project Manager' and choose 'Install' from the popup (context) menu. The 'Project Manager' in the default configuration is the area on the right edge of the screen that displays the files in the project. Remember, you need to build vclshlctrls first, and then install dclshlctrls, which is the design-time package.
You should then find the TShellListView, TShellTreeView, TShellComboBox, and TShellChangeNotifier components on your palette in the Samples category.
.thumb files are ordinary png files, just with a different file suffix.
Knowing this one can display them in a TImage.
First the .thumb extension needs to be registered as new file format.
For this include PngImage in your uses and call this:
MyImage.Picture.RegisterFileFormat('thumb', 'PNG based thumbnails', TPngImage);
Later you can display the thumb file you like like this:
MyImage.Picture.LoadFromFile('d:\Pictures\Pictures.thumb');

Sharing a project between two versions

Delphi is a great IDE and compiler. But sometimes it also has a few minor flaws. Like my problem right now...
I am working on a project that's created in Delphi 2007. But I like to use Delphi XE simply because the IDE has some interesting features and it happens to be more stable on my computer. So I opened the project in Delphi XE and have been changing the code, with backwards-compatibility in mind.
When I save the project again to open it in D2007, it has problems reading the project, though. The dproj file of XE is not compatible with 2007. To open the project in D2007 again, I need to delete the dproj file and open the dpr file. (Or I need to save the old proj file of 2007 and put it back again when I want to use D2007 again.)
This is annoying. Does anyone know a better solution to keep the right dproj file for each version?
One thing you could do would be to place the DPR and DPROJ files in separate directories. Unfortunately you would have to merge any changes you make in one version to the other, but that is fairly simple using Beyond compare:
BCompare.exe .\d2007\project.dpr .\dXE\project.dpr
You can have your project in version control like Subversion. If you omit the .dproj files from version control, it is usually quite manageable to work in different versions of Delphi
I'm using single .dpr and multiple .dproj files in such case.
Basic steps:
- Create project in D2007.
- Close project.
- Copy project.dproj to project.xe.dproj.
- Open project.xe.dproj in XE.
- Let it upgrade the project, save it and overwrite old project.xe.dproj.
- Delete backup copy of project.xe.dproj created during the upgrade.
Now you have project.dproj to use in D2007 and project.xe.dproj to use in XE. Both are using the same codebase - project.dpr.

How to disable the Formatter in Delphi 2010

The formatter in Delphi 2010 is really an annoying thing to me.
I prefer formatting my code manually.
I believe I do it better.
How can I disable it?
NOTE: Answers on why I don't use it in the first place will not be accepted. I need it switched OFF. Nothing more, nothing less.
Install DDevExtensions from Andreas Hausladen.
In its last version:
Version 2.0 (2009-09-13)
Added: Embarcadero RAD Studio 2010 support
Added: Editor tab double click action (zoom, super-zoom)
Added: Source Formatter hotkey (Ctrl+D) can be disabled
Remove or rename the file Embarcadero.Modeling.Formatter.dll in Delphi's bin directory.
There is no need for downloading and installing an extension, not even for deleting a file!
In the Delphi 10 Options head to:
Formatting / Delphi / Profiles and Status
(the captions may differ slightly, I have translated them from German)
There is a Checkbox there, titled "Activate Formatting".
Possible downside: This Formatter feature is also deactivated in the Edit menu.

Resources