Show: Delphi C++
Display Preferences

Customizing the components (IDE Tutorial)

From RAD Studio XE2
Jump to: navigation, search

Go Up to Starting your first RAD Studio application Index (IDE Tutorial)


In the previous section, Adding the components using the Form Designer, you have added all the required components to your form and then configured the action manager. Before you continue with writing code for the event handlers, customize the properties of the newly placed components.

To customize a component, select the component in the Form Designer. You can then edit the properties of the selected component in the Object Inspector.

Follow these steps to customize the memo component:

  1. Select the memo component in the Form Designer by clicking the memo component.
  2. Find the memo component in the Object Inspector (if the Object Inspector is not visible, press F11 or click View > Object Inspector).
  3. Set the Align property to alClient. This makes the memo component occupy all the free space available on the form.
  4. Set the Name property to TextMemo. Naming your component properly is very important because your code needs to access the component using that name. Setting a name you can easily remember is useful.
  5. Set the ScrollBars property to ssBoth. This results in displaying both the vertical and horizontal scroll bars in the memo and allows users to easily scroll through its contents.
  6. Set 'WordWrap' to False. WordWrap tells the memo to wrap all text on several lines if the text does not fit in a single line. A False value disables word wrapping.
  7. Find the Lines property and press the "..." button located in the value box. A dialog appears that allows you to edit the initial contents of the memo, as in the figure below. Delete all the text and then press OK to clear the memo.


TutorialIDEFig3-16.png

Figure 3-16. Editing the contents of the memo


After you have customized the memo, customize the status bar as follows.

  1. Select the status bar in the Design window.
  2. Set the Name property to TextStatus.
  3. Find the Panels property and press the "..." button at the right side of the value box. This displays a new dialog box that allows adding and customizing panels displayed in the status bar.
  4. Press the Insert key three times to add three panels. The panel editor should look like the following figure. You do not need to customize these panels, so just close the dialog.


TutorialIDEFig3-17.png

Figure 3-17. Panel editor showing the list of added status panels


This completes customizing the components.

Before writing code, save all the changes you have made to the project. Click File > Save As and save the unit as TextEditor. Also, click File > Save Project As and save the project as TextEditor_proj.

Next

Coding responses to user actions in the Code Editor

Personal tools
Previous Versions
In other languages