Plugin for text navigation in Delphi - delphi

I am using delphi 2010, and I am used to work on emacs. Really I would like to do most of my editing on a more emacs, vi way but without go out of it. Is there anyway to do so?

I don't know emacs but it's probably possible by writing a custom keyboard binding.
Update: Delphi already includes a keyboard binding called "New IDE Emacs", check it out (go to Tools\Options\Editor Options\Key Mappings).

Related

Is there a hotkey to reverse the case of the selected text in the Delphi 10.2 Editor?

It is very annoying when the CapsLock pressed unintentionally and I realize that the text I just typed is in the reverse case.
Is there any hotkey to reverse the case of the selected text in the Delphi 10.2 Editor? And maybe for the other cases (upper, lower, capital, camel, uncapitalCamel).
MartynA answered this question and I have to realize that the hotkey mapped to this function (Ctrl-O U) is not a trivial one. So another question articulated in me : is there any way to customize the hotkey mappings? As I saw the Options dialog does not make it available. (Or I just could not find it)
Ctrl-O U see http://delphi.wikia.com/wiki/Default_IDE_Shortcut_Keys
If you are prepared to write an IDE add-in, you can do whatever you like in terms of changing case. F.i. GExperts has its own Change Case, under Editor Experts and the source is available so you could look up how to do it. GExperts also modifies the IDE's Key Mappings dialog under Tools | Editor Options so you could look up how to do that, too.

NSIS message box localization guidance

I am writing NSIS scripts for our application. Everything is just great except message box localization: the problem is text in message boxes is already localized, whereas OK, CANCEL and other buttons is not.
I checked language files, definitions are correct, I also load required language files, before .onInit and use LangDLL to input installation language from user. I have searched NSIS wiki and help files, but could not find anything regarding this problem.
Could you please guide me? Thanks in advance.
Actually you do not need to write totally new plug-in - you may use nsWindows plug-in (http://forums.winamp.com/showthread.php?t=304431&highlight=nswindows) which is suitable for creating new windows in NSIS.
Create replacement for MessageBox - new window with label, icon, caption and appropriate methods for this window.
It is a lot of work but it is only way and such window will be Windows (language) independent (as Anders said).
Also then setting font style/size/width will be possible as many other customizations.
NSIS uses the MessageBox function so the buttons will use the same language as Windows. The only way around this would be to write a custom NSIS plugin...

WM_Copy, wm_gettext and wm_keydown fail?

The problem: I need to obtain the selected text from a window in a Windows application (not my program). I am doing my work in Delphi XE and the software I am attempting to access is a kluge built over the past 15 years with C, C++, VB and who knows what else. I do not have the source code. The edit box (an RTF memo) I am attempting to read is of the class "Ter32Class". When I use wm_copy, nothing goes to the clipboard. when I use wm_gettext, nothing. When I use wm_keydown commands (to simulate Ctrl-Ins or Ctrl-C) nothing happens. Note that I can get all of these alternatives to work in wordpad, notepad, and FireFox but not this application (or OpenOffice, incidentally, but that's not the issue). The only way I have been able to programmatically obtain text from this box is to use autohotkey with the simple "send ^c" command. While it works, it is inelegant. HELP?!?
More information: Window hierarchy: Ter32Class is a child of OI_Mdi which is a child of MDIClient, which is a child of OI_Window . I am drilling down to obtain the appropriate handle as it will respond to a paste command.
I am using Delphi XE but I'd love any solution in C++ or VB if no Delphi XE gurus have the answer.
From Quick Macros Forum
One of the windows I need to talk to is of class Ter32Class which
apparently is a TE Edit Control, an editor that doesn't inherit from
the standard RichText Control
and
The published method of talking to this control is via it's DLL
so unless something has changed (post is 2006), it appears you'll need to use it's dll to get the text.
From Sub Systems (TE Edit control website)
Application Interface functions
GetTerBuffer: Retrieve Window Text
HANDLE GetTerBuffer(hWnd, size)

How to detect if file in IDE is being edited using Open Tools API

I made a small IDE plug-in using Open Tools API that accesses ClearCase. It has menu items "Check In", "Check Out", etc. It works OK but I want it to check out a read-only file automatically if I start typing in IDE editor or if I attempt to save the file. Do you think this is possible?
I tried a few things but gave up eventually. IOTAEditorServices.KeyboardServices has AddKeyboardBinding method which looked promising. Using it I added a notifier with binding type btPartial (and later tried btComplete) and the plug-in started detecting some shortcut key presses but not all keyboard events, far from it... Any ideas would be much appreciated!
I think a "cleaner" way is to hook up a IOTAEditorNotifier to each editor and have your IOTAEditor.Modified method called by the IDE whenever the contents of the editor is modified, whether by keyboard, mouse or programmatically from another plugin.
Here's an example which registers an IOTAIDENotifier to be notified of files being opened in the IDE so it can register its IOTAEditorNotifier instances.
I must be possible somehow: we use SourceConexion (http://www.epocalipse.com/scx.htm) here, which auto checks-out the file before you edit the source or change the form.
JVCS has IDE integration support, it is open source, maybe they have implemented this too:
http://jedivcs.sourceforge.net/

Stand-alone text editor with Visual Studio editor functionality

Is anyone aware of any text editors with Visual Studio editor functionality? Specifically, I'm looking for the following features:
CTRL+C anywhere on the line, no text selected -> the whole line is copied
CTRL+X or SHIFT+DEL anywhere on the line, no text selected -> the whole line cut
Thanks!
Komodo Edit does the two things you specified.
I use it all the time as a secondary editor, for various scripting and other programming tasks. Tons of features, free, open source.
Zeus can emulate the Visual Studio keyboard.
To change the keyboard mapping just use the Options, Editor Option menu and in the Keyboard panel and select the MSVC as the active keyboard mapping.
(source: zeusedit.com)
Notepad++, UltraEdit and TextPad are good ones.
EditPad Pro will cut or copy the line the cursor is on when no text is selected. People sometimes report that as a bug.
Twistpad looks something like Visual Studio 2005/2008 editor and seems has the same key bindings, including Ctrl-X to cut whole line if no text was marked.
Slickedit
Not to steal Chris' thunder for his suggestions on Notepad++, UltraEdit, and TextPad, but I would like to point out that there is a version of UltraEdit which can be run from a thumb drive (for those people who lack Admin rights at work and can not install programs).

Resources