IDE Development

From Lazarus wiki
Revision as of 15:21, 7 May 2008 by Junior (talk | contribs) (→‎Working: - Change "-dEnabledTFrame" to "-dEnableTFrame")
Jump to navigationJump to search

This page contains notes for lazarus core developers about ongoing development.

Multi form properties / using DataModules from other forms in the designer

Short Description

This feature allows to use components of other designer forms. A common example is to use the TDataSource on a DataModule for the DataSource property of a db control. Designer forms can only reference each other if they have a CreateForm statement in the lpr file (Project Options / Forms).

Working

Manual referencing via source code works.

Some features are only enabled via -dEnableMultiFormProperties (You can set this in Tools -> Configure Build Lazarus dialog -> Options)..

  • TPersistentPropertyEditor.GetValues - List all possible values. Check for class compatibility and if the target form is listed in the CreateForm statements of the lpr file and if the target unit does not belong to a package that will conflict if used.
  • TPersistentPropertyEditor.GetValue - Show component path
  • TPersistentPropertyEditor.SetValue - search the component via the given path
  • When component is deleted, the property must be set to nil - This is not the job of the IDE, but should be achieved by the normal TComponent FreeNotification feature. Maybe eventually a check could be added, if this is implemented properly and force a nil on error.
  • When a component is renamed the property does not need to be updated, because the form is open and use the pointer not the name. But the designer must be flagged 'modified', because the lfm has changed. See below.
  • When reference form is opened, then target forms are opened too.
  • When target form is closed, then only the designer is closed. The component is kept hidden.
  • When all referring forms are closed/hidden, the hidden component will be automatically freed.
  • Circle dependencies are allowed.
  • When referenced component is renamed, the using units must be set modified.
  • When referenced component is deleted, the using units must be set modified.
  • Opening a unit now checks if designer is already created
  • Reopen/Revert a form - all connected forms are now closed

ToDo

  • Warn if a reference is found, that has no CreateForm statement in the lpr.

Translations, i18n, lrt files, po files

Short Description

This feature automatically creates and updates .po files for packages and projects.

Working

  • Dialog options for project/package to enable i18n
  • Collect TTranslateStrings from RTTI while designer form writing and writing them to lrt file.
  • Copying new strings from rst and lrt files to a single .po file for each package/project
  • load the .po files

ToDo

  • Delete unused strings from the .po file of package/projects
  • Update translated .po files, similar to the updatepofiles tool.
  • Collect all .po files of project and all used packages into a directory. This directory can then be used by the project to load the strings at runtime. And installers can copy the content.
  • standardize filenames and path, so that loading the translations at runtime is possible without writing code.

Frames

Short Description

Frames are special child forms. The goal is to edit them like forms in the IDE designer, and to use them as components on designer forms.

Working

compile ide with passing -dEnableTFrame

  • Manually creating via source
  • gtk1, gtk2, qt, win32/win64
  • Create a new frame
  • Open a frame in the designer
  • Save a frame
  • Close a frame
  • Revert a frame
  • Design a frame (adding, selecting, moving controls, ...)

ToDo

  • wince
  • carbon
  • Open a frame with ancestors in designer
  • Open a form with an embedded frame
  • Close a form with an embedded frame
  • Save a form with an embedded frame
  • Revert a form with an embedded frame
  • Add a frame to a form
  • Delete a frame embedded in a form
  • Edit a frame embedded in a form (?)

UTF-8 Sources

Short Description

The IDE should open sources in various encodings, convert them on the fly during loading to UTF-8 and convert them back on saving. The IDE should help to convert sources of whole projects and packages to UTF-8.

Formerly the IDE only supported one encoding. Under windows this was the windows code page. Under gtk2 it was UTF-8. Now the IDE can edit files with various encodings. (one encoding per file). For instance, the user opens a unit1.pas file created on a german windows. Then the german umlaute will be encoded with the windows code page cp1250. The IDE now "sees", that this is not UTF-8, assumes it is the system encoding and converts it to UTF-8 (only in memory, not on disk), before passing it to SynEdit. Now SynEdit can edit it. When the file is saved, the IDE converts it back to cp1250. This way the file on disk can have the windows system encoding, but all IDE functions only need to support UTF-8.

Working

  • GuessEncoding checks for BOM, encoding directive, ASCII and UTF-8. Otherwise it uses the system encoding. If the system encoding is UTF-8 then ISO-8859-1 is used.
  • Example for encoding directive. Put at the beginning of a source file:
 {%encoding cp1250}
  • ISO-8859-1
  • windows code pages
    • cp1250 central europe
    • cp1251 cyrillic
    • cp1252 latin 1
    • cp1253 greek
    • cp1254 turkish
    • cp1255 hebrew
    • cp1256 arabic
    • cp1257 baltic
    • cp1258 vietnam
    • cp874 thai
  • koi-8 russian cyrillic
  • Showing the current encoding: via popup menu of source editor
  • Compile with -dVerboseIDEEncoding for debugging

ToDo

  • menu items to change the encoding of a file
  • Improve GuessEncoding to find more encodings.

CodeTools Debugging

Short Description

The codetools and its integration in the IDE is a complex part and a bug can create strange side effects, happen sometimes only after a long time and are hard to reproduce. The IDE needs some debugging tools to show the internal structures and run consistency checks.

Working

  • Compile with -dCheckNodeTool to make consistency checks on various.
  • IDE Internals / Package Links

ToDo

  • Consistency Checks for all codetools node caches

SynEdit: Special Characters

Short Description

Show special characters in SynEdit.

Working

  • Compile with -dDebugShowTabs

ToDo

  • Show tabs
  • Show special characters