About the Resource Editor

The EasyLanguage Resource Editor is used to create or edit a form that is associated with an EasyLanguage study, trading app, or strategy. Controls such as buttons, text boxes, etc. can be added to the form from the Toolbox and you can arrange the controls to fit anywhere within the form and change their appearance as desired. You can edit the properties of form controls using the Properties Editor. The Properties Editor can also be used to assign methods to be called when objects fire events ("event handlers"). For example, the method to be called when a user clicks a particular button can be assigned in the Properties Editor.

 

 

Adding a Form to an EasyLanguage Document

A form is added to an EasyLanguage document (Indicator, ShowMe, strategy, trading app, etc.) using the following steps:

  1. Open an existing EasyLanguage document (or create a new one) to which you want to add a form.
  2. Right-click anywhere in the EasyLanguage document and select Add Form from the shortcut menu.
  3. A blank form will appear on a tab in the editor and will be named Form1 by default (for the first form).
  4. To display the form as part of your study or strategy you'll also need insert a line of EasyLanguage code into your document that calls the Show() method for the specified form, such as:
          Once form1.show();
  5. If you already have a Form in another study that you wish to re-use, you can copy the Form, along with its controls, to the new study. Begin by opening the Resource Editor in the source study. Select the entire Form by clicking on it. Use the right-click menu (or Ctrl-C) to copy the Form and all its controls. Proceed to the new study. Right-click in any blank area of the EasyLanguage document for the new study. Select Paste from the right-click menu (or Ctrl-V). The Form and all its controls will be copied to the new study.
  6. Once a Form has been added to a study, it can be reopened from the Resource View (View menu - Toolbars - Resource View).
 

Editing a Form

Once a form has been added to your EasyLanguage study, you are ready to add controls to the form and edit their properties:

  1. With a form selected, open the Toolbox. (See About The Toolbox for more about adding and removing controls and components from the Toolbox.)
  2. Double-click on a the name of a control (i.e. Button, ComboBox, etc) in the ToolBox to add it to the form. The selected control will first appear in the upper-left corner of the form.
  3. Drag the control to a new position in the form and re-size the control and form, as desired.
  4. With a control selected, go to the Properties panel to view and change the text, appearance, and other properties of the control.
  5. Individual controls, groups of controls, and entire forms (with all their controls) can be copied and pasted within a study or between studies.
  • To copy an entire form and all of its controls, follow the instructions above in the section entitled "Adding a Form to an EasyLanguage Document."

  • To copy (or cut) an individual control (button, checkbox, combobox, etc.), click on the control to select it. Then, from the right-click menu, select Copy (or Cut). Go to the Form, Panel, or other location where the control is to be pasted. Right-click and, from the right-click menu, select Paste. The shortcut keys (Ctrl-C, Ctrl-X, and Ctrl-V) can be used as an alternative to using the right-click menu.

  • To copy (or cut) a group of controls (e.g., a group consisting of two labels and two textboxes), click in the form's background and drag the mouse as if drawing a rectangle around the group of controls. This will cause all the enclosed controls to be selected. Then, using the right-click menu (or Ctrl-C), copy the controls as a group. Proceed to the form into which the controls are to be pasted and, after selecting the form, use the right-click menu to paste the group of controls. Note: if the controls are not easily selected by dragging the mouse so as to form a rectangle around them, the controls can be individually selected by clicking on them while holding down the Shift key.

 

Using Events with Form Controls

Use the following steps to connect a control to an event handler method in your EasyLanguage code. The method will be called when an event occurs (eg. when a button is pressed or when a form is re-sized).

  1. Select the desired form control.
  2. In the Properties editor, click the Event icon. Then, double-click the available event type in the Event column (Click, Resize, SelectedIndexChanged, Scroll, etc). Note that not all controls have associated events. The name of the generated event handler will appear in the Value column and the code for the event handler method will be inserted into your EasyLanguage document.
  3. Click the EasyLanguage document tab to view the code. You will see code similar to:
    method void CheckBox1_Click( elsystem.Object sender, elsystem.EventArgs args )
    begin
            { Insert your EasyLanguage statements here }
    end;
    In this example, the method will run whenever a checkbox event fires, indicating that the checkbox was checked or unchecked.