I have various hierarchical structures and would like to allow navigation around then using an editor like the Microsoft one found in the explorer address bar below. Is there such a Delphi component? (Paid for or free)?
TAdvExplorerTreeview from TMS might be what your looking for:
http://www.tmssoftware.com/site/advexptree.asp
Haven't tried by myself but Roy Klever's PathViewer component looks quite interesting.
I have spent the morning writing such a control. Actually, I wrote a very generic, completely virtual base control, from which I later derived a directory browser control:
The source code is published here
Here are some images:
Style := bbsClassic
Style := bbsFlat
Style := bbsHeader
Style := bbsThemed
Style := bbsCommand
Not sure about anything exactly like that but the BergSoft Next Collection includes a path control similar to that (useful for breadcrumb trails and the like)
http://www.bergsoft.net/component/next-collection/overview.htm
It's free providing you don't want access to the source. Source is pretty cheap though and it's a one off cost that'll get you all future updates.
Related
I am using Delphi 2010 and GExperts stable release 1.35
I am testing the "Replace Components" expert.
I add a main form and a secondary form. Each has three TEdits on it.
I use the Replace Components Expert to replace all TEdits with TRzEdit. I Check the Replace all components on all forms of the project.
It works, it replaces them all. However, it doesn't do anything to the DFM file. How do i make it replace those instances.
If i save, compile, or rebuild, i get errors.
If i try to view the form as text after replacing, i get errors.
Can someone explain to me the steps to make this work?
Thanks
I just tried it with Delphi XE and GExperts 1.35 and it does indeed crash now even after a single "Replace Selected". (It used to work fine in the past).
It seems that using the hidden menu Project | Clear Unit Cache just after Replace Components then doing a full build before trying any Save/Compile/View As Text... fixes the problem.
I think this menu is surfaced with cnPack. I don't have it and cannot guarantee, but you can easily do it yourself by adding the following unit in one of your installed packages:
unit FGEnableHiddenMenus;
interface
procedure Register;
implementation
uses
Classes, Forms, Menus;
procedure Register;
var
Comp: TComponent;
begin
//Make a hidden menu item visible
Comp := Application.MainForm.FindComponent('ProjectClearUnitCacheItem');
if Comp is TMenuItem then
TMenuItem(Comp).Visible := True;
end;
end.
Source: Brian Long's old goodies
Update:
I had to replace a couple of TEdit by TDBEdit on our main project at work and this trick worked.
But on a new Project with 3 Forms, it failed consistently to write/commit/save the changes on the last Form (same environment).
FYI, I tried with and without DDevExtensions 2.5 and IDEFixPack 4.6.1
Update2:
Went digging in the GExperts forum as suggested by Ulrich and finally found a possible explanation. The new property Touch does not like being copied from one component to another when the source is destroyed (causing the AV).
The suggested workaround is to do a bidirectional mapping in the Expert Settings to disable the copy for this property:
You might be running into this bug while trying to copy the Touch property from the old to the new component, but it has a workaround you can fairly easily test:
http://tech.groups.yahoo.com/group/GExpertsDiscuss/message/3994
Details:
There is a limitation/bug in Delphi 2010 and XE where if you assign a
Component.Touch property from one component to another and destroy the
original component that the new component becomes corrupt (it isn't
like component/interface references, where they either auto-correct
themselves or are reference counted).
For the moment, you can assign a bi-directional replace component
property map from TPanel.Touch to TGroupBox.Touch (use the two components being replaced in your specific case) that is marked as
a disabled property map, and that will work around this problem. Our next release
will not try to assign that property any longer.
GExperts 1.36 is also now available and includes a workaround for this issue. The workaround has been in the GExperts version control system and in testing for several weeks already.
I'm working in a Delphi IDE expert and I wonder if it's possible add new items to the code completion combobox displayed by the Delphi IDE when the user press CtrlSpace
UPDATE:
What I need is add items to the code completion list based in a specified type.
example suppose which I have a type called TMytype, what I want to do is add addional items to the code completion list when the user type a variable of the type TMytype
check this image
I found your question somewhat confusing but if you are in search of credible source on "Custom Live Templates" and the like on Delphi, head to the blog of Cary Jensen here.
Edit:
Looking forward to further improvement of the scope of the question, I suggest here another direction to explore:
Source code manipulation using IOTAEditor, IOTASourceEditor, IOTAEditReader and the like
Some Parsing for sanity check prior to apply any modification.
Adoption of Client DataSet as a format to store data (It's serializable) to simplify the coding of IDE editors.
Perhaps I haven't fully grasped the extent of what you are asking here, but you can add templates simply by going to 'View|Templates' from the Delphi IDE. This then opens a template viewer. Press the '+' icon. It opens a template1.xml document which you can then edit so create your new item.
If you wish to do this programatically, just add an xml file (of the same format) to the ..\RAD Studio\code_templates folder.
I've recently begun using Ctrl-LeftArrow and Ctrl-RightArrow in the IDE to move around on a line of source code (or, for that matter, in any Windows entry screen.) (And of course Ctrl-Shift-LeftArrow highlights the text. Also very helpful.)
I'm delighted at how often it saves me time because I don't have to reach for the mouse.
It takes a bit of practice (as well as learning where your CTRL and arrow keys are so can hit them without looking down), but if you're not using this method to move around Windows documents, I'd encourage you to try it!
Now, as a further speed-up, I would like to jump to the next instance of a single, specific character.
Many years ago I briefly used the "vi" editor, for which, as I recall, typing a lower case g and then a single character jumped to that character. And an upper case G did a "search again" (like ^L) on the previous single character searched for. Of course vi is moded, so this command was available. In the IDE, it would have to be a control character.
I think this would really speed up my moving around my source code in the IDE.
I've never done much with the tools available to enhance the IDE (Delphi 10 here). What tools might I use and how hard would it be to add this to the IDE?
Do any of the third-party IDE add-ins provide this kind of functionality?
TIA
Incremental search (Ctrl+E) will do what you want. Type one or more characters, and you are taken to the next occurrence. F3 and Shift+F3 take you back and forth between occurrences.
This has been available since Delphi 1. In recent versions, the feature has been updated to visibly highlight all other occurrences in the edit window.
You can use CnPack IDE wizards, This wizards provide a pascal script engine that you can enhance the IDE by Pascal scripting, also they provide number of samples with source code.
by this script engine you can search and modify the code in IDE editors as way you need.
CnPack Wizards are Open source, then you can use it Free of charge.
site : http://www.cnpack.org/index.php?lang=en
for example the code below comes with CnPack this code will make comment the selected code in IDE editor
{*******************************************************}
{ }
{ Pascal Script Source File }
{ Run by RemObjects Pascal Script in CnWizards }
{ }
{ Generated by CnPack IDE Wizards }
{ }
{*******************************************************}
program CommentCode;
uses
Windows, SysUtils, Classes, CnWizIdeUtils;
var
Lines: TStringList;
i: Integer;
begin
Lines := TStringList.Create;
try
if IdeGetEditorSelectedLines(Lines) then
begin
for i := 0 to Lines.Count - 1 do
begin
Lines[i] := '//' + Lines[i];
end;
IdeSetEditorSelectedLines(Lines);
end;
finally
Lines.Free;
end;
end.
GExperts(http://www.gexperts.org/) and CNPack(http://www.cnpack.org/index.php?lang=en) is one of the best third party IDE addons available, but I don't remember seeing what you're willing to accomplish, but using the mentioned addons as a starter, one could write his own specific addon. CNPack also provides a built in pascal interpreter which can help you write your own "snippets" that do "something".
I'm trying to get rid of some hints(*) the Delphi compiler emits. Browsing through the ToolsAPI I see a IOTAToolsFilter that looks like it might help me accomplish this through it's Notifier, but I'm not sure how to invoke this (through what xxxServices I can access the filter).
Can anyone tell me if I´m on the right track here? Thanks!
(*) In particular, H2365 about overridden methods not matching the case of the parent. Not so nice when you have about 5 million lines of active code with a slightly different code convention than Embarcadero's. We've been working without hints for months now, and we kinda miss 'm. :-)
Even if you could query BorlandIDEServices for IOTAToolsFilter, that interface isn't going to help you do what you're asking. That interface was introduced as part of a mechanism for adding additional build tools (compilers, etc.) to the IDE (before the IDE used MSBuild). It allowed you to write a custom "filter" to handle output from a particular build tool, but it would not let you apply a filter to one of the built-in tools (like the delphi compiler).
The reason the Supports(BorlandIDEServices, IOTAToolsFilter, OTAToolsFilter) call fails in Delphi2010 is that once MSBuild support was added to the IDE, the old way of adding build tools to the IDE was disabled, and the BorlandIDEServices interface no longer supported IOTAToolsFilter.
The declaration of IOTAToolsFilter should probably have been marked deprecated in ToolsAPI.pas (or least it should have been mentioned in the source code comment that it is no longer supported).
As far as your desire to filter a particular hint, I'm not aware of a way to do that via the ToolsAPI. It seems like a reasonable thing that can be added to IOTAMessageServices (the ability to enumerate, filter, and possibly change the messages in the IDE's Message View). I would enter a request in QualityCentral for that.
Also, please vote for QC #35774 (http://qc.embarcadero.com/wc/qcmain.aspx?d=35774), as if that were implemented, you would not need to use the ToolsAPI for this sort of thing.
According to http://docwiki.embarcadero.com/RADStudio/en/Obtaining_Tools_API_Services it should be possible to access it directly using BorlandIDEServices, eg:
var
OTAToolsFilter: IOTAToolsFilter;
begin
if Supports(BorlandIDEServices, IOTAToolsFilter, OTAToolsFilter) then
ShowMessage('supports IOTAToolsFilter')
else
ShowMessage('IOTAToolsFilter NOT supported');
end;
However this doesn't return the desired interface in Delphi 2010 (you'll get the not supported message), so there's either an error in the documentation, or an error in BorlandIDEServices not returning the correct interface.
I am looking for a data aware Tree View for delphi
what is the best one to use ?
Virtual TreeView is the fastest, with most features, the best and its free!
(for data aware there are free descants of it, also on that following page)
you will find it here:
virtual treeview control on softgems
here is a tutorial video (in german):
DelphiPraxis Stammtisch Videos
there was also a tutor in the german magazin "entwickler magazin"
Editions: 02/08, 03/08 and 04/08.
Entwickler Magazin
I would recommend the DevExpress QuantumTreeList. It looks really nice, is fast and data aware.
Virtual TreeView
Here is the (not easy to find) VirtualTreeView SVN repository url:
svn://www.soft-gems.net/library/VirtualTreeview
UPDATE: Mike moved the sources to Google Code:
http://virtual-treeview.googlecode.com/svn/trunk