Replace selected found text in Delphi 10 RAD Studio editor - delphi

Requirements:
We have a text in Delphi RAD Studio editor and this text has been selected as a search result.
What happens
On any change (Del button or typing some text) changes are applied to the right of selection.
Expected
On any change (Del button or typing some text) the selected block is deleted and then the changes are applied.
Question
How?

The behaviour that you describe is simply how the IDE's search functionality is intended to work. You are expecting that when you search for text, the IDE will select occurrences of that text. However, it instead highlights occurrences.
There is no way (to the best of my knowledge) to alter this behaviour, short of writing an IDE plugin to implement your own search functionality.

To resolve this, use Ctrl + R.

Related

Select Text in vertical in Spyder text Editor

Is there a way for selecting text in vertical in Spyder3 Text Editor? What I mean is something equivalent to Alt + Shift in Atom text editor for example:
(Spyder maintainer here) No, there's no way to do that in Spyder, sorry. Unfortunately it's not so easy to implement it with our current editor code.
You can write text code in 'sublime' editor and perform all sorts of shortcuts there. to select matching text in the sublime editor, first select/highlight that text using the cursor and then press Ctrl+D as many times you want, sublime will keep highlighting matching text in the whole text file. To select all matching entries simply press Alt+F3 (in windows).

Modify the rightclick menu options of cxgrid

In cxGrid,where do you modify the menu options when you right click in the Grid?
I would like to get rid of that "Right to left reading order","Show Unicode control characters","Insert Unicode control character","Open IME" and "Conversion". I dont need them at all.
How can I do that ?
This is the standard context menu of the Windows EDIT control, and not part of the Delphi code behind the control that you are using. In other words, the Delphi control that you are using is wrapping some system provided functionality.
I suppose that it would be possible to remove some items from that, but it's not easy. The EDIT control does not offer you any way to remove these built-in items. This issue has been discussed at the devExpress forum:
https://www.devexpress.com/Support/Center/Question/Details/Q292288
https://www.devexpress.com/Support/Center/Question/Details/Q102030

Simple way to avoid TListView items clipping and replace with ellipsis

I have a TListView in vsSmallIcon mode. If I populate it with 2 items and first item text is longer than second item text it will draw first item over the second.
Is there a quick way to replace longer items with ellipsis? Or a complicated one?
I am using Delphi 2010 and C++ Builder 2010 with default settings of TListView
How it looks:
How I want it to look:
Edit: After trying out vsList style I discovered that the above is no longer an issue and it works without any additional code (no ellipsis but no items clipped also).
When working with TListView I often find myself investigating and mimicking the behavior of Windows Explorer.
Regarding your question with ellipsis in vsSmallIcon mode I checked out Explorer. I observed that when I resize the window there’s no ellipsis drawn for item captions. Instead the items are rearranged instantaneously. My suggestion would be to skip the ellipsis strategy because Microsoft has not implemented Explorer that way and chances of a quick fix for you decrease. If you can settle for rearranging then the two following “quick” alternatives should do the job, at least in XE3.
Alt 1:
ListView1.IconOptions.AutoArrange := true;
Alt 2: (must be called explicitly every time you desire a rearrangement):
ListView1.Arrange(arDefault);
Update:
I fired up Delphi 2006 and can confirm that the above methods work there as well

Using Unicode characters with Delphi XE2

I'm looking at converting one of our applications to Delphi XE2 and generally take the opportunity to bring it up to date.
One of the features of the application is a StringGrid that displays a number of check marks in a couple of columns. To achieve this the grid is actually 2 aligned grids - the second of which is setup with the font as Wingdings in order to display the check marks.
Am I wrong in thinking that I should be able to use something like a TListView and use the checkmark char (U+2713) alongside the rest of the text... If so how the heck do I do this?
Do I need to set the font to Wingdings for that column? Does this need to be in OnDraw?
Am I barking up the wrong tree...
File->New->VCL Forms application
In the Component Palette, expand the Win32 tab and choose TListView, and drop it on the form.
Right-click the newly added TreeView1, and choose Items Editor... from the context menu.
Click New Item. Type in any text (for instance x Testing, using the 'x' as a placeholder for now).
Start the Windows Character Map application (Start button, type Chara in the search box, or Start->Programs->Accessories->Character Map). Change the font to Arial Unicode MS, and navigate to the character you want (it's in there).
Click the character, and then the Copy button. Switch back to the IDE, select the x placeholder you put in the edit, and hit Ctrl+V to paste the character you just chose from Character Map. You should now see your check mark (or whatever character you chose), followed by Testing.
(The steps above are the two-minute process I followed to find out how to do this, and that quick experiment showed that you could.)

Editor to select text that is inside a rectangle

Often I find myself with some text where I want to exclude a certain part of the text, say the first three characters of 40 lines. The fastest way I could think of to do this would be to draw a rectangle and copy the text. I am mostly using Windows, but I am sure grep or something similar could do this with a tiny bit of code. My best way of doing this is to open Command Prompt. Then run "Edit" (yes the good old one). Then paste the text in there (this actually takes a significant amount of time). Then I am able to select the rectangle I am after.
Is there any other editors that support this feature? I am familiar with Notepad++.
You can select a rectangular area to cut/copy in Visual Studio be pressing the Alt key prior to making your selection with the mouse or (Shift +) cursor keys. See How to: Select and Change Text.
The Zeus editor can do keyboard driven column cut/copy and paste.
Also the default Zeus mouse marking is in column mode.
If you use Vim, Ctrl + V will let you select a rectangular block of text.
The documentation says Ctrl + Q will let you do a rectangular select in mswin compatibility.
Emacs supports kill-rectangle (bound to C-x r k by default) and yank-rectagle (C-x r y) to achieve this. Also of possible interest is delete-extract-rectangle (no default binding, and intended for programming use).
You use it by navigating to one corner of the interesting area, hitting C-<space> to set the mark, navigating to the opposite corner, and invoking the desired function.
UltraEdit has a column mode (menu Column/Column Mode, keyboard
shortcut Alt + C). This makes it possible to make block selections, delete, insert column-wise, etc. using only the keyboard (the mouse works too).
For your example: make a zero width selection at column position 1 for the 40 lines and press Delete three times. Or simply make the 3 x 40 block select and press Delete.
You can do this with NEdit (which is available for Windows). Hold down Ctrl and drag the mouse (left-click) to select rectangles.
In Linux, you could also just use cut:
cut -b4- file
It will remove the first three characters from every line and print the result to standard output.
jEdit supports vertical selections (keyboard shortcut is Alt + \). It can also do multiple, non-continuous selections (keyboard shortcut is Ctrl + \). And when you type it affects all selections, so you can edit multiple lines at the same time, or the same line in more than place simultaneously. Or both.
Vertical pasting is also supported. This is a feature I use all the time. It makes editing columns a breeze.
If you have too many lines to select easily, then jEdit's Find And Replace is as good as it gets.
jEdit is a Java application, and so uses more system resources than most editors. But on the other hand it works on most systems, and it has loads of plug-ins to make editing text more efficient.
This can be done using JGSoft's Editpad which has a freeware lite version that is not crippled.
In IntelliJ, go to Edit and then click on Column Selection Mode. Or use the ALT+SHIFT+INSERT shortcut.

Resources