In one of my projects we are using CodeGear C++ Builder 2009 from Embarcadero.
I am also working with Eclipse and VS2010.
Now there is one thing that I don't understand with C++ Builder (that I have no problem with in the other IDEs), isn't there any way to find a definition?
it wasn't until 2010, when they brought back the class explorer, that you could go to both the declaration and the definition of a class. That takes more steps than control-click, but is a bit better.
I am using SourceNavigator http://sourcenav.sourceforge.net/ for this purpose and more...
Related
It seems that C++ builder 10.3. comes with a new testframework.hpp. The class Assert does not exist any longer.
Can anyone tell me how to use this new framework?
I am desperate because I wrote a lot of code and obviously Rio is not really compatible.
for example the following code line, written in Builder 10.2.3, doesn't work any longer:
Dunitx.Testframework::Assert::IsTrue (result == true);
I found the solution in the testframework.hpp - file. The usage is now a lot easier but you will have to know how to handle it. The description in the embaracdero help system is wrong and should be corrected.
You seem to have found the TestFramework.hpp for DUnit. But it is obvious your code was using DUnitX before. These are similar but incompatible test frameworks.
To get the Dunitx.Testframework.hpp you need, simply add DUnitX.TestFramework.pas to your C++Builder test project (add it in the project manager) and completely re-build your project. The Pascal compiler will generate the necessary .hpp file for you.
But before you do all that, you may want to copy your project to a new folder, and load it from there, just to be sure. That way, the older project will not be modified. Be sure to update all your paths in the project manager and C++ library settings too, if necessary.
If you think DUnit is easier to use (I certainly do), then keep on using that. But you will have to rewrite some parts of your tests. More info can be found in the Delphi help files (and on the web counterpart) and on the DUnit website.
DUnit was the former test framework for Delphi (hence the D), but at some time in the past, it was replaced by the more modern DUnitX. But that uses some Delphi features (like Delphi attributes) that make it harder to use in C++Builder. DUnit is still part of the RAD Studio installation.
MS Visual Studio has a great feature: it automatically suggests the units to add in using clause when you typing the code with refrences to absent standard classes.
Is there any 3-rd party tool to implement similar feature for Delphi?
I'm tired to add all those SysUtils, Windows, Messages etc in each new unit.
If the unit which contains the reference is not yet in the uses list, this is how I save many manual steps:
right-click on the underlined (error-insighted) text
choose “Refactoring | Find Unit…“.
A dialog will present the available unit which contains the unknown type or symbol, and a mouse click adds the selected unit to the uses list of the current file.
CNPack Input Helper can sugest and autocomplete units (sorry for another answer, but I can't comment other).
CNPack unfortunately don't auto-add units from place of code input but you can:
Copy a word from cursor place (CNPack->Editor enchancements->Tabset/Button->Clipboard operations->Cut/copy token...).
Eventually search this word in source files (grep) to identify unit.
Use CNPack->Toggle Uses/Include Field (Ctrl+u) and start typing and use CNPack->Input Helper sugestion/autocompletion, or IDE/GExperts/CNPack use unit future
Back to place of code edition
The JCL includes the "Uses Wizard." It watches for compilation errors mentioning "Undeclared identifier," and when it sees one, it automatically adds the unit where that identifier is declared.
The package JclUsesExpert.dpk is only available for certain Delphi versions. I don't know if that's because the plug-in doesn't work in later versions, or if someone merely neglected to copy the project into later versions' folders.
This is not a tool to suggest references, it only cleans up unneeded unit clauses.
CnPack IDE Wizards is an excellent opensource plugin for Delphi.
http://www.cnpack.org/index.php?lang=en
I use its Uses cleaner feature a lot.
There is a menu item:
CnPack->Project Enhancements->Use Unit
I think this can be helpful for your needs.
Or maybe you can try this:
http://www.epocalipse.com/products.htm
Unit Expert
"A freeware Delphi add-in that allows you to quickly open units and also add them to the uses clause."
I never tried this expert but it semms promising.
The rFindUnit IDE extension is the enhanced version of built-in "Refactoring | Find Unit…" function suggested by #mjn above.
I've begun working with using Lazarus to make some simple utilities for my own use on Ubuntu 9.10. I know many people like the modular Delphi 7 layout, but I prefer a docked layout.
I'd also like to have the Delphi 2007 palette menu. Is this possible within the latest version of Lazarus (v0.9.28.x) ?
How can I configure Lazarus to look like, or behave like, Delphi 2007/9/10?
NOTE: This question is very old. It's now (2023) possible to configure Lazarus to appear more Delphi-like, and has been for a few years. Here's a good guide.
Kudos and thanks to the Lazarus developers for their amazing work!
I'm not sure that you can make it look like the newer Delphi IDEs.
I've used it in the past and I think that the D7 look is the only available option.
You could always edit the source and change it.
There is no option to have the palette menu like Delphi 2007 in Lazarus. I think there is also a reason for this: the Lazarus developers are mostly 'hard core, oldschool' Delphi programmers, and this kind of programmers seems to prefer the Delphi 7 tools menu.
You can try Anchor Docking. It Helps, but, not change the menu.
From the Lazarus main menu pick "Package" - "Install/Uninstall Packages" and install the "anchordockingdsgn" package
https://wiki.freepascal.org/Anchor_Docking
It's open source, you can code it...
I'm using delphi6, and it lacks the following abilities:
a library object,
a list object(looks like TList,TStringList is good enough?)
a algorithm library(like sort,)
template library like STL
dynamic language feature or GC.
and so on.
how can I find this things?
Try Jedi Code Library. There are good replacements for container classes and sorting algorithms. I don't think there is GC or STL-like library for Delphi 6.
Delphi 6 is behind the times, check Delphi 2009 or at least Turbo Delphi
There is DeCAL, which claims to be similar to the STL. I've never really tested it, however.
There are many third party delphi libraries, components and source code examples on the net.
Just a couple off the top of my head
JEDI http://www.delphi-jedi.org/
and
a Delphi super page http://delphi.icm.edu.pl/
As an alternative to DeCAL (Which is a very good alternative to TList without generics), I will propose EZSDL by Julian M Bucknall.
List of main third party components compatible with Delphi 2007 for Win32 and RAD Studio 2007 by Andreano Lanusse at http://edn.embarcadero.com/article/37455
The first three are in the VCL, take a look in the help and the sources. Delphi 6 has no generics, so cannot be used with a template library. And no garbage collection.
If you want to program in Delphi, forget about them. If not, find another language.
I used to work in Delphi 6, and got very used to having CodeRush's various helpful IDE additions. Many are now in the IDE itself, or I've managed to replace with something else, but the one feature I REGULARLY find myself wishing I had in Delphi 2007 still, is the ability CodeRush had that added little "connecting lines" between components that were linked to each other (lines showing the connections between TDataSets and TDataSources, for instance).
Does anyone make something that does that in the newer Delphi IDE?
=== * LATER NOTE / Clarification * ===
Andreas is correct in his comments below... "I don't think that he meant structural highlighting which works on the source code. He wants "connection lines" between components in the form designer."
He also says "as far as I know there is no such tool for Delphi 2005 or newer".. which is a bummer if true. (...and if that IS the case, what's the best place to make Delphi IDE feature requests?)
I don't think it exists. The best place to make form designer feature requests is here.
another freeware/opensource option would be to look at CNPack which supports structural highlighting and runs well in Delphi 2009. The library contains many other enhancements to the IDE also, some which are duplicated in other packages such as GExperts. I run both CNPack and GExperts in both 2009 and 2006 without any problems.
You want Castalia, which works fine here on my D2007 for structural highlighting.
Castalia from Twodesk