Back

Tools Editor Options



The Display Tab

Here you can change your font options and display options in the Delphi Code Editor.

Brief cursor shapes - uses Brief cursor shapes that when checked shows the small square like cursor and when unchecked shows the stick type of curesor.

Create backup file - is a helpful feature if you feel you need to keep backups of your project files. If you have not got a lot of hard disk space available you may not want to use this option becuse the backups made of your files can add up to a lot of disk space after a few months if you use Delphi a lot.
You can easily recognize the backup files because Delphi puts a tilde charactor (~) before the first letter of the backup files extension when you Save.

Examples:

Unit1.ddp - Unit1.~ddp
Unit1.dfm - Unit1.~dfm
Unit1.pas - Unit1.~pas

Preserve line ends - is used to reserves end-of-line position.

Zoom to full screen -  here you have the option of the Code Editor maximizing to full screen or not maximizing to full screen.
If this option is not checked and you click on the maximize button on the Code Editor Caption Bar you still will be able to see the IDE Main Menu and Component Palette etc.

Sort popup pages menu - You can Right-Click on a unit tab and move the mouse cursor down to the menu item Pages and you will see the unit tabs, if you click on one then that unit will be shown.
By default the unit tabs are displayed in alphabetical order,  the Sort popup pages menu option allows you to change this to the order they were created.

The Margins and Gutter options allow you to select whether you want a visible right margin, visible gutter, set the gutter width and set the right margin of the Code editor.

You can also change the Code Editor font and size to settings what you prefer.


The Key Mappings Tab

The Key Mappings page is for you to select the key mapping modules (which enable users to switch key bindings easily) and you can also enable or disable the enhancement modules.

Default - This is the default that uses key bindings that match CUA mappings.
IDE classic - Borland Classic editor keystrokes.
BRIEF emulation - The standard Brief keystrokes.
Epsilon emulation - This emulates a large part of the Epsilon editor.
Visual Studio emulation - Emulates a large part of the Visual Studio editor.
Visual Basic emulation - Emulates a large part of the Visual Basic editor.
New IDE Classic - Uses key bindings from only a small subset of the Emacs editor - used for demos only.
New IDE Emacs - Uses key bindings from only a small subset of the Emacs editor - used for demos only.

You can experiment with these to see if you like any of the options.


The Color Tab

To help stop your eyes from getting tired or being strained from looking at a computer screen for long periods of time, you can change the colours of the Code Editor.
An easy way to go about this is to use the Classic setting, Turbo Pascal programmers will be familiar with this.
Go to Tools, then Environment Options, then Colors, then click on the ComboBox Drop-down list and then click on 'Classic'.
You can also choose: Defaults, Twilight and Ocean.


The Code Insight Tab

Code Templates:

Code Templates were added to the Delphi IDE so that you can get Delphi code fast and without much typing, these are functions or expressions that you use often.

An example is if you use

case I of
    1:
    2:
    3:
    4:
else
   ShowMessage(' ');
end;

often then you can make this into a code template.

To do this go to Tools|Editor Options in the Delphi IDE Menu, then click on the Code Insight tab.
This may be different for your version of Delphi.

On the lower half of the page you will see Code Templates.

Click on the Add button and you will see a dialog like this:

Type in the new template shortcut name, we will use "cashow" for this example.

Next type in a description, something like "Case with showmessage", click the OK button.

Paste in this code:

case I of
    1:|
    2:
    3:
    4:
else
   ShowMessage(' ');
end;

Next click on the OK button.

We used the 'pipe' character after the 1:  to show Delphi where we want the caret to be when the code appears in the Editor.

In the Delphi Code Editor hold down the Ctrl key and type "j"

And you should see your template in the list like this:

Scroll down to your template and press the Enter key.

You should now see the code in the Delphi Code Editor like this:

procedure TForm1.Button1Click(Sender: TObject);
begin
    case I of
      1:
      2:
      3:
      4:
    else
      ShowMessage(' ');
  end;

end;

A faster way to get your code is to type cashow then press the Ctrl + J keys.

If you type just an 'a' then you get the list starting with 'a' like in this image:


 

Using Code Templates can save you a lot of time and will really speed up your work if you take the time to learn how to use them and create your own code templates.
Your Code Templates are saved in the Delphi32.DCI file which should be in your Delphi/bin directory.

Code Completion:

To activate Code Completion you can use the Ctrl + Spacebar keys, this works even if the automatic feature is disabled. If you decide to remove the Code Completion box then press the Esc key.

You can type a class name then type a period (Full stop) which will activate Code Completion. You will then get a list of methods, properties and events which are appropriate to the class or record displayed.

Use the down arrow key or your mouse to select the item you want and then press the Enter key, the Spacebar works for this as well. You can also press the ; key and this will add the ; just after the entered text like this:

Panel1.Refresh;

You can right-click on the listbox to change the list to Sort by Scope or Sort by Name.
You can also press the Home or End keys to go to the top of the list or to the bottom.

In Delphi 6 when the listbox is visible you can start typing and the list will filter out words that do not match the letters you are typing. For example if you type:

Panel1.al

Only these words will be visible in the list:

Also you will notice different colors are now used to help you find what you want in the list.

You can also drag and resize the listbox to a size you want, and Delphi remembers the new size.
 

Code Parameters:

If you type a function, method or procedure name and then add the left parenthesis (Opening parenthesis) you will see the parameter names and types.
You can press Shift + Ctrl + Space to display the list box at any time, whether or not Code parameters is on automatic.

Tooltip Symbol Insight:

Also of interest is Tooltip Symbol Insight.
When you put the mouse cursor over an identifier Tooltip Symbol Insight displays declaration information, this information could be procedure, function, type, constant, variable, unit, etc.


Back


Copyright © 1998-2001 James M Sandbrook & Sandbrook Software. All rights reserved.
Do not duplicate or redistribute in any form.