Lazarus IDE Tools/es

From Lazarus wiki
Jump to navigationJump to search

Deutsch (de) English (en) español (es) suomi (fi) français (fr) 日本語 (ja) 한국어 (ko) Nederlands (nl) português (pt) русский (ru) slovenčina (sk) 中文(中国大陆)‎ (zh_CN)

Descripción general

   El IDE de Lazarus utiliza una librería llamada codetools para analizar y editar el código fuente pascal. Estas herramientas ofrece funciones para completar código, extraer, mover, insertar y embellecer el código pascal. Utilizarlas permite ahorrar mucho tiempo y evitar duplicar esfuerzos. Son configurables y cada una de las funciones es accesible mediante un atajo (ver Editor Options).

   Al trabajar únicamente con código fuente pascal (de FPC, Delphi y Kylix) no necesita unidades compiladas ni instalar el compilador Borland. Se puede editar código Delphi y FPC a la vez. Incluso se puede trabajar con varias versiones de Delphi y FPC al tiempo. Todo lo anterior hace la conversión de código Delphi mucho más fácil.

Tabla resumen de los atajos

Buscar Declaración Ctrl+Click o Alt+Up (Salta a la declaración de la variable)
Salto a Procedimiento Ctrl+Shift+Up (Salta entre la definición y el cuerpo de procedimientos y funciones)
Plantillas de Código Ctrl+J
Completar Código Ctrl+Shift+C (Completar Clase)
Completar Identificador Ctrl+Space
Completar Palabra Ctrl+W
Ayuda de parámetros Ctrl+Shift+Space

Salto a Procedimiento

   Para ir desde el cuerpo de un procedimiento (o función) al lugar donde está su declaración (procedure Nombre;), o viceversa se utiliza la combinación de teclas Ctrl+Shift+Up.

   Por ejemplo: <delphi> interface

procedure HacerAlgo; // declaración del procedimiento
 //...  
implementation
 //...  
procedure HacerAlgo; // Cuerpo del procedimiento 
begin
 //...
end;</delphi>

   Si el cursor está en cualquier parte del cuerpo del procedimiento y se pulsan las teclas Ctrl+Shift+Up, el cursor salta a la declaración. Volviendo a pulsar Ctrl+Shift+Up se regresa al cuerpo, y el cursor se sitúa al principio de la primera línea trás el begin.

   Esto funciona con procedimientos y funciones, sean o no miembros de una clase.

   Nota: 'Salto a Procedimiento' busca el procedimiento (o función) con el mismo nombre y lista de parámetros. Si no existe coincidencia exacta, salta al mejor candidato y situa el cursor en la primera diferencia que encuentra. (Delphi solo busca la coincidencia exacta, en D7 al menos).

   Por ejemplo una función con diferente lista de parámetros: <delphi> interface

function HacerAlgo(p: char); // declaración de la función

implementation
  
function HacerAlgo(p: string); // cuerpo de la función
begin
end;</delphi> 

   El salto desde la definición al cuerpo posicionará el cursor delante de la palabra clave string. Esto puede sernos útil para renombrar métodos y/o cambiar sus parámetros.

   Por ejemplo:
   Remombramos 'HacerAlgo' a 'Hazlo': <delphi> interface

procedure Hazlo; // declaración del procedimiento

implementation

procedure HacerAlgo; // Cuerpo del procedimiento
begin
end;</delphi>

   Ahora saltamos desde el redefinido Hazlo al cuerpo. El IDE buscará un cuerpo que se corresponda, al no encontrarlo buscará un candidato plausible. Trás cambiar el nombre existe un único procedimiento sin su declaración (HacerAlgo), por lo que saltará a él, situando el cursor justo delante de "HacerAlgo". Ahora solo resta escribir el nuevo nombre. También funciona si hemos cambiado algo en la lista de parámetros.

Archivos de inclusión

   El contenido de los archivos de inclusión es insertado en el código fuente con las directivas de compilación {$I NombreArchivo} o {$INCLUDE NombreArchivo}. Lazarus y FPC utiliza una gran cantidad de ellos para reducir la redundancia y eliminar estructuras ilegibles con {$IFDEF} que dan soporte a múltiples plataformas.

  El IDE de Lazarus da soporte completo a los archivos de inclusión, al contrario que Delphi. Se puede saltar desde la declaración de un método en un .pas a su cuerpo en un archivo de inclusión. Todas las funciones de codetools consideran los archivos de inclusión un ámbito especial, tal cómo hace Completar Código.

  Por ejemplo: Cuándo Completar Código añade el cuerpo de un nuevo método tras el cuerpo de otro, mantiene ambos en el mismo archivo. Así podemos poner la implementación completa de la clase en el archivo de inclusión, tal cómo se hace en la LCL para todos sus componentes.

   Pero aquí hay una trampa para novatos: Si se abre un archivo de inclusión por primera vez y se usa Procedure Jump o Buscar Declaración se obtiene un eror. El IDE no sabe la unidad a la que pertenece el archivo de inclusión; hay que abrir la unidad previamente pra que la cosa funcione.

   Tan pronto como el IDE analiza la unidad, se evalúan las directivas de inclusión y el IDE toma nota de las relaciones entre los archivos.Al cerrar o guardar el proyecto esta información se guarda en el archivo $(LazarusDir)/includelinks.xml. La próxima vez que abramos el archivo de inclusión y realicemos un Procedure Jump o Buscar Declaración el IDE hará uso de esta información y las funciones trabajarán correctamente.

   Este mecanismo tiene límites, por supuesto. Algunos archivos están incluidos dos o más veces, por ejemplo, $(LazarusDir)/lcl/include/winapih.inc.

   Los saltos a los cuerpos desde las definiciones de procedimientos o métodos desde este fichero dependerán del contexto actual. Si se está trabajando con lcl/lclintf.pp el IDE saltará a winapi.inc. Si se está trabajando con lcl/interfacebase.pp, el salto se realizará a lcl/include/interfacebase.inc (u otro archivo de inclusión). Si se está trabajando con los dos, habrá una situación ambigua. ;)

Plantillas de código

   Las Plantillas de código permiten convertir un identificador en un texto o en un fragmento de código.

   El atajo, por defecto, para las Plantillas de código es Ctrl+J. Se escribe un identificador, se pulsan las teclas Ctrl+J y el identificador es sustituido por el texto definido para el identificador. Las Plantillas de código se definen en Entorno -> Plantillas de Código....

  Ejemplo:   Escribimos el identificador 'classf', con el cursor justo a la derecha de la 'f' pulsamos las teclas Ctrl+J y 'classf' será reemplazado por <delphi> T = class(T)

private

public
  constructor Create;
  destructor Destroy; override;
end;</delphi>

además el cursor de posicionará detrás de la primera 'T'.

   Podemos desplegar la lista de plantillas disponibles, situando el cursor en un espacio (no en un identificador) y pulsando las teclas Ctrl+J. Aparecerá la lista de plantillas. HAciendo uso de las teclas de dirección o escribiendo algo seleccionaremos una de ellas. Con intro usaremos la plantilla elegida y con escape cerraremos la lista sin hacer nada.

  La plantilla que más tiempo nos ahorrará es 'b'+Ctrl+J para begin..end.

Sugerencia de Parámetros

   Sugerencia de Parámetros muestra una caja con la lista de posibles declaraciones con sus parámetros para el procedimiento o función actual.

   Por ejemplo:

<delphi> Canvas.FillRect(|);</delphi>

   Situamos el cursor dentro de los paréntesis y pulsamos Ctrl+Shift+Space. La lista de sugerencias aparecerá con los posibles parámetros, según distintas declaraciones de FillRect.

Completar Código

   Completar código se encuentra en el menú Editar del IDE y su atajo por defecto es Ctrl+Shift+C. También Aparece en el menú contextual Refactoring -> Completar código.

   Para usuarios de Delphi:   En Delphi "code completion" muestra la lista de identificadores en la posición actual del código (Ctrl+Space). En Lazarus esta función se llama "Completar identificador".

   Completar código combina varias potentes funciones. Ejemplos:

  • Completar Clase (Class Completion): completa propiedades, añade cuerpos de métodos, añade variables y métodos privados.
  • Completar procedimiento (Forward Procedure Completion): añade cuerpos de procedimientos.
  • Completar asignación de eventos (Event Assignment Completion): completa la asignación de eventos y añade la definición del método y su cuerpo.
  • Completar declaración de variables (Variable Declaration Completion): añade la declaración de variables locales.
  • Completar llamada a procedimiento (Procedure Call Completion): añade un nuevo procedimiento.
  • Completar procedimiento inverso (Reversed procedure completion): añade la definición de cuerpos para procedimientos y funciones.
  • Completar clase inversa (Reversed class completion): añade declaraciones para cuerpos de métodos.

   La función que se activa depende de la posición del cursor en el editor de código.

Completar Clase

   La función más potente de completar código es Completar clase. Escribe la definición de la clase, añade los métodos y las propiedades y Completar clase añadirá los cuerpos de los métodos, los métodos de acceso a las propiedades y variables y las variables privadas.

   Por ejemplo: crea una clase (utiliza Platillas de código para ahorrarte trabajo de escritura):

<delphi> TEjemplo = class(TObject)

public
  constructor Create;
  destructor Destroy; override;
end;</delphi>

   Pon el cursor en la clase y pulsa Ctrl+Shift+C. Con esto se crean los cuerpos que faltan de los métodos y el cursor se situará dentro del primer cuerpo de método creado, y ya puedes empezar a escribir el código de la clase:

<delphi> { TEjemplo }

constructor TEjemplo.Create;
begin
  |
end;

destructor TEjemplo.Destroy;
begin
  inherited Destroy;
end;</delphi>

   Nota: El carácter '|' representa el cursor.

   Sugerencia: puedes saltar entre la definición y el cuerpo de un método con Ctrl+Shift+Up.

   Cómo se puede ver, el IDE añade la llamada 'inherited Destroy' siempre que el método esté definido con override.

   Ahora añade un método HacerAlgo:

<delphi> TEjemplo = class(TObject)

public
  constructor Create;
  procedure HacerAlgo(i: integer);
  destructor Destroy; override;
end;</delphi>

   Ahora se pulsa Ctrl+Shift+C y el IDE añadirá

<delphi> procedure TEjemplo.HacerAlgo(i: integer);

begin
  |
end;</delphi>

   El método se inserta entre Create y Destroy, igual que en la definición de la clase. De esta forma los cuerpos mantienen el mismo orden lógico que se ha definido. Se puede definir la política de inserción en Entorno -> Opciones de CodeTools -> Creación de código.

Completar Propiedades

   Añade la propiedad UnEntero: <delphi> TEjemplo = class(TObject)

public
  constructor Create;
  procedure HacerAlgo(i: integer);
  destructor Destroy; override;
  property UnEntero: Integer;
end;</delphi>

   Pulsa Ctrl+Shift+C y obtendrás esto: <delphi> procedure TEjemplo.SetUnEntero(const AValue: integer);

begin
  |if FUnEntero=AValue then exit;
  FUnEntero:=AValue;
end;</delphi>

   Completar código ha añadido el procedimiento de acceso de escritura a la propiedad (Write) y añadido al mismo el código más común. Ve a la definción de la clase con Ctrl+Shift+Up para ver los cambio realizados en la clase: <delphi> TEjemplo = class(TObject)

private
  FUnEntero: integer;
  procedure SetUnEntero(const AValue: integer);
public
  constructor Create;
  procedure HacerAlgo(i: integer);
  destructor Destroy; override;
  property UnEntero: integer read FUnEntero write SetUnEntero;
end;</delphi>

    La propiedad se ha extendido con los modificadores de acceso Read y Write. La clase tiene una nueva sección private con una variable 'FUnEntero' y el procedimiento 'SetUnEntero'.    Es habitual en el estilo Delphi añadir 'F' delante del nombre de las variables privadas y 'Set' a los procedimientos. Si no quieres que esto ocurra, cambialo en Entorno -> Opciones de CodeTools -> Creación de Código.

   Crear una propiedad de sólo lectura: <delphi> property NombrePropiedad: TipoPropiedad read;</delphi>    Se expandirá a <delphi> property NombrePropiedad: TipoPropiedad read FNombrePropiedad;</delphi>    Crear una propiedad de sólo escritura: <delphi> property NombrePropiedad: TipoPropiedad write;</delphi>    Se expandirá a <delphi> property NombrePropiedad: TipoPropiedad write SetNombrePropiedad;</delphi>    Crear una propiedad de sólo lectura con una función de lectura: <delphi> property NombrePropiedad: TipoPropiedad read GetNombrePropiedad;</delphi>    La función GetNombrePropiedad será añadida: <delphi> function GetNombrePropiedad: TipoPropiedad;</delphi>    Crear una propiedad con un modificador 'stored': <delphi> property NombrePropiedad: TipoPropiedad stored;</delphi>    Se expandirá a <delphi> property NombrePropiedad: TipoPropiedad read FNombrePropiedad write SetNombrePropiedad stored NombrePropiedadIsStored;</delphi>    Cómo stored se utiliza para el streaming los modificadores read y write se añaden automáticamente.

   Sugerencia: Completar identificador también reconoce propiedades incompletas, sugiriendo los nombres por defecto. Por ejemplo: <delphi> property NombrePropiedad: TipoPropiedad read |;</delphi>    Sitúa el cursor un espacio después del 'read' y pulsa Ctrl+Space para invocar Completar identificador. En la lista desplegable se aparecerán la variable 'FNombrePropiedad' y el procedimineto 'GetNombrePropiedad'.

Forward Procedure Completion

"Forward Procedure Completion" is part of the Code Completion and adds missing procedure bodies. It is invoked, when the cursor is on a forward defined procedure.

For example: Add a new procedure to the interface section:

procedure DoSomething;

Place the cursor on it and press Ctrl+Shift+C for code completion. It will create in the implementation section:

procedure DoSomething;
begin
  |
end;

Hint: You can jump between a procedure definition and its body with Ctrl+Shift+Up.

The new procedure body will be added in front of the class methods. If there are already some procedures in the interface the IDE tries to keep the ordering. For example:

 procedure Proc1;
 procedure Proc2; // new proc
 procedure Proc3;

If the bodies of Proc1 and Proc3 already exists, then the Proc2 body will be inserted between the bodies of Proc1 and Proc3. This behaviour can be setup in Environment > Codetools Options -> Code Creation.

Multiple procedures:

procedure Proc1_Old; // body exists
procedure Proc2_New; // body does not exists
procedure Proc3_New; //  "
procedure Proc4_New; //  "
procedure Proc5_Old; // body exists

Code Completion will add all 3 procedure bodies (Proc2_New, Proc3_New, Proc4_New).

Why calling it "Forward Procedure Completion"?

Because it does not only work for procedures defined in the interface, but for procedures with the "forward" modifier as well. And because the codetools treats procedures in the interface as having an implicit 'forward' modifier.

Event Assignment Completion

"Event Assignment Completion" is part of the Code Completion and completes a single Event:=| statement. It is invoked, when the cursor is behind an assignment to an event.

For example: In a method, say the FormCreate event, add a line 'OnPaint:=':

procedure TForm1.Form1Create(Sender: TObject);
begin
  OnPaint:=|
end;

The '|' is the cursor and should not be typed. Then press Ctrl+Shift+C for code completion. The statement will be completed to

OnPaint:=@Form1Paint;

A new method Form1Paint will be added to the TForm1 class. Then class completion is started and you get:

procedure TForm1.Form1Paint(Sender: TObject);
begin
  |
end;

This works just like adding methods in the object inspector.

Note:
You must place the cursor behind the ':=' assignment operator. If you place the cursor on the identifier (e.g. OnPaint) code completion will invoke "Local Variable Completion", which fails, because OnPaint is already defined.

Hint:
You can define the new method name by yourself. For example:

 OnPaint:=@ThePaintMethod;

Variable Declaration Completion

"Variable Declaration Completion" is part of the Code Completion and adds a local variable definition for a Identifier:=Term; statement. It is invoked, when the cursor is on the identifier of an assignment or a parameter.

For example: <delphi> procedure TForm1.Form1Create(Sender: TObject); begin

 i:=3;

end; </delphi> Place the cursor on the 'i' or just behind it. Then press Ctrl+Shift+C for code completion and you will get: <delphi> procedure TForm1.Form1Create(Sender: TObject); var

 i: Integer;

begin

 i:=3;

end; </delphi> The codetools first checks, if the identifier 'i' is already defined and if not it will add the declaration 'var i: integer;'. The type of the identifier is guessed from the term right to the assignment ':=' operator. Numbers like the 3 defaults to Integer.

Another example: <delphi> type

 TWhere = (Behind, Middle, InFront);

 procedure TForm1.Form1Create(Sender: TObject);
 var
   a: array[TWhere] of char;
 begin
   for Where:=Low(a) to High(a) do writeln(a[Where]);
 end;

</delphi> Place the cursor on 'Where' and press Ctrl+Shift+C for code completion. You get: <delphi>

 procedure TForm1.Form1Create(Sender: TObject);
 var
   a: array[TWhere] of char;
   Where: TWhere;
 begin
   for Where:=Low(a) to High(a) do writeln(a[Where]);
 end;

</delphi>

Since 0.9.11 Lazarus also completes parameters. For example <delphi>

 procedure TForm1.FormPaint(Sender: TObject);
 begin
   with Canvas do begin
     Line(x1,y1,x2,y2);
   end;
 end;

</delphi> Place the cursor on 'x1' and press Ctrl+Shift+C for code completion. You get: <delphi>

 procedure TForm1.FormPaint(Sender: TObject);
 var
   x1: integer;
 begin
   with Canvas do begin
     Line(x1,y1,x2,y2);
   end;
 end;

</delphi>

Completar Llamada a procedimiento

   Nota de traductor: lo que sigue no funciona, si lo intentamos no hace nada.

   Completar código creará un nuevo procedimiento desde la orden de invocación.

   Supongamos que acabas de escribir la orden HacerAlgo(Ancho); <delphi> procedure UnProcedimiento;

var
 Ancho: integer;
begin
 Ancho:=3;
 HacerAlgo(Ancho);
end;</delphi>

   Coloca el cursor sobre el identificador "HacerAlgo" y pulsa Ctrl+Shift+C para obtener:

<delphi> procedure HacerAlgo(aWidth: LongInt);

begin
end;
procedure UnProcedimiento;
 var
  Width: integer;
begin
 Width:=3;
 HacerAlgo(Width);
end;</delphi>

Completar Clase inversa

   "Completar Clase inversa" es otra función de Completar ya Código que añade la declaración de un método para el cuerpo de funcion o procedimiento en que esté situado el cursor cuando se invoca; si la declaración existie dará un mensaje de error: Ya fue definido el identificador ....

   Esta función está disponible desde la versión 0.9.21 de Lazarus.

   Por ejemplo: <delphi> procedure TForm1.HacerAlgo(Emisor: TObject);

 begin
 end;</delphi>

El método HacerAlgo no está declarado en TForm1. Pulsar Ctrl+Shift+C y el IDE añadirá "procedure HacerAlgo(Emisor: TObject);" en la definición de la clase TForm1.

Para usuarios de Delphi: Completar clase funciona en Lazarus siempre en un único sentido: de interface a implementation o viceversa. Delphi invoca siempre los dos sentidos. La forma de Delphi tiene la desventaja de que por un error tipográfico podemos crear inadvertidamente un procedimineto nuevo.

Comments and Code Completion

Code completion tries to keep comments where they belong. For example:

 FList: TList; // list of TComponent
 FInt: integer;

When inserting a new variable between FList and FInt, the comment is kept in the FList line. Same is true for

 FList: TList; { list of TComponent
   This is a comment over several lines, starting
   in the FList line, so codetools assumes it belongs 
   to the FLIst line and will not break this 
   relationship. Code is inserted behind the comment. }
 FInt: integer;

If the comment starts in the next line, then it will be treated as if it belongs to the code below. For example:

 FList: TList; // list of TComponent
   { This comment belongs to the statement below. 
     New code is inserted above this comment and 
     behind the comment of the FList line. }
 FInt: integer;

Refactoring

Invert Assignments

Abstract
: "Invert Assignments" takes some selected pascal statements and inverts all assignments from this code. This tool is usefull for transforming a "save" code to a "load" one and inverse operation.

Example:

procedure DoSomething;
begin
  AValueStudio:= BValueStudio;
  AValueAppartment :=BValueAppartment;
  AValueHouse:=BValueHouse;
end;

Select the lines with assignments (between begin and end) and do Invert Assignments. All assignments will be inverted and identation will be add automatically. For example:

Result:

procedure DoSomething;
begin
  BValueStudio     := AValueStudio;
  BValueAppartment := AValueAppartment;
  BValueHouse      := AValueHouse;
end;

Encerrar Selección

Selecciona un blouqe de texto e invócala, con el menú contextual (Refactoring -> Encerrar Selección), por ejemplo. En el [diálogo que aparece] puedes seleccionar en que estructura se encerrará el código seleccionado, try..finally o cualquier otro tipo de bloque de los posibles.

Rename Identifier

Place the cursor on an identifier and invoke it. A dialog will appear, where you can setup the search scope and the new name.

  • It will rename all occurences and only those that actually use this declaration. That means it does not rename declarations with the same name.
  • And it will first check for name conflicts.
  • Limits: It only works on pascal sources, does not yet rename files nor adapt lfm/lrs files nor lazdoc files.

Find Identifier References

Place the cursor on an identifier and invoke it. A dialog will appear, where you can setup the search scope. The IDE will then search for all occurences and only those that actually use this declaration. That means it does not show other declarations with the same name.

Show abstract methods

This feature lists and auto completes virtual, abstracts methods that need to be implemented. Place the cursor on a class declaration and invoke it. If there are missing abstract methods a dialog will appear listing them. Select the methods to implement and the IDE creates the method stubs.

Extract Procedure

See Extract Procedure

Find Declaration

Position the cursor on an identifier and do 'Find Declaration'. Then it will search the declaration of this identifier, open the file and jump to it.

Every find declaration sets a Jump Point. That means you jump with find declaration to the declaration and easily jump back with Search -> Jump back.

There are some differences to Delphi: The codetools work on sources following the normal pascal rules, instead of using the compiler output. The compiler returns the final type. The codetools see the sources and all steps in between. For example:

The Visible property is first defined in TControl (controls.pp), then redefined in TCustomForm and finally redefined in TForm. Invoking find declaration on Visible will you first bring to Visible in TForm. Then you can invoke Find Declaration again to jump to Visible in TCustomForm and again to jump to Visible in TControl.

Same is true for types like TColor. For the compiler it is simply a 'longint'. But in the sources it is defined as

TGraphicsColor = -$7FFFFFFF-1..$7FFFFFFF;
TColor = TGraphicsColor;

And the same for forward defined classes: For instance in TControl, there is a private variable

FHostDockSite: TWinControl;

Find declaration on TWinControl jumps to the forward definition

TWinControl = class;

And invoking it again jumps to the real implementation

TWinControl = class(TControl)

This way you can track down every identifier and find every overload.

Hints: You can jump back with Ctrl+H.

Identifier Completion

"Identifier Completion" is invoked by Ctrl+Space. It shows all identifiers in scope. For example:

 procedure TForm1.FormCreate(Sender: TObject);
 begin
   |
 end;

Place the cursor between begin and end and press Ctrl+Space. The IDE/CodeTools will now parse all reachable code and present you a list of all found identifiers. The CodeTools cache the results, so invoking it a second time will be much faster.

Note for Delphians: Delphi calls it Code completion.

Some identifiers like 'Write', 'ReadLn', 'Low', 'SetLength', 'Self', 'Result', 'Copy' are built into the compiler and are not defined anywhere in source. The identifier completion has a lot of these things built in as well. If you find one missing, just create a feature request in the bug tracker.

Identifier completion does not complete keywords. So you can not use it to complete 'proc' to 'procedure'. For these things use Ctrl+W Word Completion instead or Ctrl+J Code Templates.

Identifier completion shows even those identifiers, that are not compatible.

Prefix

You can start identifier completion in a word. Then the letters to the left will be taken as prefix. For example:

 procedure TForm1.FormCreate(Sender: TObject);
 begin
   Ca|ption
 end;

The box will show you only the identifiers beginning with 'Ca'.

Keys

  • Letter or number: add the character to the source editor and the current prefix. This will update the list.
  • Backspace: remove the last character from source editor and prefix. Updates the list.
  • Return: replace the whole word at cursor with the selected identifier and close the popup window.
  • Shift+Return: as Return, but replaces only the prefix (left part) of the word at the cursor.
  • Up/Down: move selection
  • Escape: close popup without change
  • Tab: completes the prefix to next choice. For example: The current prefix is 'But' and the identifier completion only shows 'Button1' and 'Button1Click'. Then pressing Tab will complete the prefix to 'Button1'.
  • Else: as Return and add the character to the source editor

Methods

When cursor is in a class definition and you identifier complete a method defined in an ancestor class the parameters and the override keyword. For example:

<Delphi> TMainForm = class(TForm) protected

 mous|

end; </DELPHI>

Completing MouseDown gives:

<Delphi> TMainForm = class(TForm) protected

 procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X,
        Y: Integer); override;

end; </DELPHI>

Properties

<Delphi> property MyInt: integer read |; </DELPHI>

Identifier completion will show FMyInt and GetMyInt.

<Delphi> property MyInt: integer write |; </DELPHI>

Identifier completion will show FMyInt and SetMyInt.

Uses section / Unit names

In uses sections the identifier completion will show the filenames of all units in the search path. These will show all lowercase (e.g. avl_tree), because most units have lowercase filenames. On completion it will insert the nice case of the unit (e.g. AVL_Tree).

Statements

<DELPHI> procedure TMainForm.Button1Click(Sender: TObject); begin

 ModalRe|;

end; </DELPHI>

becomes:

<DELPHI> procedure TMainForm.Button1Click(Sender: TObject); begin

 ModalResult:=|;

end; </DELPHI>

Word Completion

"Word Completion" is invoked by Ctrl+W. It shows all words of all currently open editors.

Otherwise works the same as identifier completion.

Goto Include Directive

"Goto Include Directive" in the search menu of the IDE jumps to {$I filename} statement where the current include file is used.

Publish Project

Creates a copy of the whole project. If you want to send someone just the sources and compiler settings of your code, this function is your friend.

A normal project directory contains a lot of information. Most of it is not needed to be published: The .lpi file contains session information (like caret position and bookmarks of closed units) and the project directory contains a lot of .ppu, .o files and the executable. To create a lpi file with only the base information and only the sources, along with all sub directories use "Publish Project".

Note: Since version 0.9.13 there is a new Project Option that allows you to store session information in a seperate file from the normal .lpi file. This new file ends with the .lps extension and only contains session information, which will leave you .lpi file much cleaner.

In the dialog you can setup the exclude and include filter, and with the command after you can compress the output into one archive.

Contribuciones y cambios

   Esta página ha sido convertida desde la versión de epikwiki.

  • Creación de la página y plantilla original - 4/6/2004 VlxAdmin
  • Nuevo contenido inicial - 4/10/2004 MattiasG
  • Pequeños retoque sobre formato - 4/11/2004 VlxAdmin
  • Adición de la Tabla resumen de los atajos de las IdeTools - 12 July 2004 User:Kirkpatc
  • Versión en castellano (español) iskraelectrica (jldc) / junio-julio de 2008.