The short answer is... If you want to do it properly, it's complicated AND comes with a drawback.
The not so short answer is... use lazy man's solution: the runtime/design time mix. Also comes with a possible (but unlikely) drawback.
The full answer is:
Whatever library we install, it comes in two “flavors”: runtime libraries and design time libraries (actually, there are three… keep reading).
Run-time libraries
Some libraries only provide run-time routines and no visual components (VCL).
- We just compile this library. There is nothing to “install” (there is no “Install” entry into the pop-up menu for such library).
- Include library’s files into your project (drag and drop it into the Project Manager) or add the library’s path to the “Search Path” / “Library Path” as shown above.
Now, we can simply call the functions of that library from our program.
If the library has two packages (two DPK files), one marked as Design time and one marked as Runtime, always compile the Runtime library before the Design time library. Note that sometimes there is just a “D” (Design time) and an “R” (Runtime) at the end of the name.
If we start with the Design time library, it may complain that it cannot find the Runtime library.
Design time libraries
Libraries that provide visual components are design-time libraries*. We need to load these libraries in Delphi (into the Project Manager) and install them.
After the installation, the visual components of that library will appear into the “Palette” so we can drag and drop them on our form, at design time.
The documentation of the library will tell us under which category we will find the new installed components. If there is no documentation, do a search into the units of that library for a procedure called “Register”. This will take as parameter two strings: the name of the component and the category where it will appear in the “Palette”:
The TRichLog component will appear under the “Cubic” category in the Palette.
If we don’t want the library anymore, we right-click on it in “Project manager” and choose “Uninstall”.
Design time and Run time libraries
Some people might not agree with my statements above. See these pages for details:
RobsTechcorner.blogspot.com/2011/06/runtimedesigntime-what-delphi-packages.html
This is because, in theory, design time packages should only contain code for special things like property editors (you can see property editors in the Object Inspector). And the runtime packages should only contain code that is not necessary during development. Runtime packages should never contain or require design time code.
This is the theory. The good way to program and keep your code separated. However, this comes at a price: it could be difficult to keep these two separated.
The solution is to declare your packages as mixed “Design time and Run time libraries”.
By the way, when using the wizard to create a new package, Delphi will declare that package as “design time and runtime” by default. But still, this is considered, lazy man’s solution.
To be honest, I only use this solution. Even though I created lots of visual components, none has design time editors.