Lazarus IDE Editor Window Overview

Introduction to the Lazarus Interface on First Launch

Main Window (Top Global Window), Area 1 in the screenshot above

Different from regular software you may have used, launching Lazarus opens multiple independent floating windows. The long topmost window is the main IDE window, with the title format: project1 - Lazarus IDE vVersionNumber. When opening other projects, the title automatically updates to the current project name. Purpose: Central IDE control window, containing the Main Menu Bar and Component Palette.

  • Beneath title bar: Main Menu Bar with standard menus: File, Edit, Search, View
  • Left below menu bar: Coolbar Quick Toolbar Icon buttons for fast access to frequently used menu functions;
  • Right below menu bar: Component Palette
Built-in Tab Groups

Standard、Additional、Common Controls、Dialogs、Data Controls、Data Access、System、Misc、LazControls、RTTI、SQLdb、Pascal Script、SynEdit、Chart、IPro

Two Core Editor Windows

Two side-by-side windows at the bottom of the IDE:

  • Left side: Object Inspector

Below are introductions to frequently used properties

Property NameFunction Description
ActionBind preset actions such as close and exit functions
AlignControl alignment relative to parent container: alTop Top, alBottom Bottom, alLeft Left, alRight Right, alClient Fill remaining space, alNone Free positioning
AnchorLock control margins to four window edges during resizing; e.g. [akBottom,akRight] locks bottom-right corner
CaptionDisplay text for controls (buttons, labels); use meaningful custom text instead of default Button1
ColorControl background color
EnabledBoolean value; False grays out the control and disables clicks
FontText font, size, color; expand for detailed configuration
Hint / ShowHintTooltip text on mouse hover; tooltips only appear when ShowHint=True
NameIdentifier name for controls in code; follow naming standards (OkBtn, ExitBtn) instead of default Button1
Left / TopTop-left coordinate of the control
Width / HeightControl width and height; Constraints set min/max size limits
ReadOnlyMakes input box view-only, disables editing
TabOrder / TabStopTab navigation sequence; TabStop=False skips control with Tab key
Text / LinesText for single-line input; Lines for multi-line text (TMemo content, array index starts at 0)
VisibleHides control completely when False
WordWrapAuto line break for multi-line text
PopUpMenuRight-click context menu

Below are commonly used events

EventTrigger Condition
OnClickLeft mouse click on control (most used for buttons)
OnChangeControl content or state modified (input text edit, dropdown selection switch)
OnEntryMouse enters control, focus acquired
OnExitMouse leaves control, focus lost
OnKeyDown / OnKeyPress / OnKeyUpKey pressed, character input, key released
OnMouseMove / OnMouseDown / OnMouseUpMouse move, mouse button press, mouse button release
OnDragDropDrag-and-drop release operation
OnEditingDoneUser finished editing, commonly used for input validation
OnResizeControl size changed
  • Right side: Source Editor Code Editor

Now we will modify the example from the last lesson to add more property changes on button click

procedure TForm1.Button1Click(Sender: TObject);
begin
  // Switch text state via Tag
  if Button1.Tag = 0 then
  begin
    Button1.Caption := 'Press again';
    Button1.Tag := 1;
    // Modify control size and color through code
    Button1.Height := 50;
    Button1.Color := clYellow;
  end
  else
  begin
    Button1.Caption := 'Press';
    Button1.Tag := 0;
    Button1.Height := 30;
    Button1.Color := clBtnFace;
  end;
end;  Code language: JavaScript (javascript)

The Form1 Form Designer window overlays the code editor

Tips

  • Shortcut F12: Switch between Form Designer / Source Code view
  • Form window: Drag controls to draw software graphical interfaces
  • Code Editor: Write Pascal business logic code

Other Auxiliary Windows

Message Window (Bottom of screen) Outputs compilation logs, errors and runtime prompts during program build;

Project Inspector Project Manager Displays all files contained in the project, supports adding / deleting units and forms;

Terminal Window (retained when launching Lazarus via terminal): Output full compilation logs.

Leave a Reply

Your email address will not be published. Required fields are marked *