Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate

QuickEdit v0.2 (Preview) - Lightweight Text Editor

  • Please log in to reply
1 reply to this topic
  • Members
  • 1029 posts
  • Last active:
  • Joined: 01 Oct 2005
QuickEdit is a lightweight text editor similar to Notepad but with a few additional features. It was originally created as an example for the Edit Library.

Key features:
[*:2ew1beb7]File Format. DOS, Unix, and MAC file formats are supported. See the Issues/Considerations section for more information.

[*:2ew1beb7]Spell Check. Check the spelling of selected text or the entire document. Includes a built-in custom dictionary.

[*:2ew1beb7]Text-To-Speech. Speak the selected text or the entire document. Start speaking from anywhere in the document. The Text-To-Speech player includes word tracking.

[*:2ew1beb7]Auto-Save Untitled Files. Originally created for another project, this feature removes the annoying prompt to save Untitled files but retains the ability to save and restore these files.

[*:2ew1beb7]Miscellaneous features including:

[*:2ew1beb7]Auto Formatting
[*:2ew1beb7]Convert Case
Posted Image

The Code
The pertinent files are as follows:Project: QuickEdit.zip (Includes EXE, library files, dictionary, and source (files, folders, and icons))
Documentation/Help: Nothing official yet.
A few considerations:
[*:2ew1beb7]Preview Release. Since this a preview release, some of the code has not been optimized and there may be some residual debug code lying around. If there is any interest, these issues will be corrected in future releases.

[*:2ew1beb7]File Format. The file format determines what characters are used to mark the end-of-line (EOL). The DOS file format uses the carriage return and line feed characters (CR+LF), the Unix file format uses the line feed character (LF), and the MAC file format uses the carriage return character (CR).

QuickEdit uses the standard edit control to edit text so support for multiple file formats is limited to 1) detecting the file format when loading a file and 2) saving the file in the requested file format. Additional considerations:

[*:2ew1beb7]New. For a new file, the file format is initially set to DOS.

[*:2ew1beb7]Open. When a file is loaded, the file format is automatically detected by the program. If there are no EOL characters in the file, the file format is set to DOS. If more than one file format is detected, DOS takes priority and then Unix.

[*:2ew1beb7]Internal format. While the file is being edited, the program uses the file format supported by the standard edit control (DOS).

[*:2ew1beb7]Saving. When a request to save is made, all EOL characters are converted to desired file format. Additional considerations:

[*:2ew1beb7]If the edit control is empty, an empty (0 bytes) file is saved. If this file is opened in the future, the file format cannot be detected and the DOS file format will be assumed.

[*:2ew1beb7]If the requested file format is Unix or MAC, EOL character(s) are automatically added to the end of file if needed.[*:2ew1beb7]Mac OS. The MAC file format (CR) is used by the Mac OS up to version 9. For Mac OS X and above, the Unix file format (LF) is used.

[*:2ew1beb7]Binary/Raw. Unlike some other text editors, there is no binary or raw mode. Don't try to open/edit anything other than text files.[/list][*:2ew1beb7]Auto Formatting And Undo. Auto Formatting commands (Auto Indent, Auto Bullets, etc.) use standard edit control commands to add information (spaces, bullets, and sequences) to the edit control. If this new information is not wanted, it can quickly be removed by using the Undo (Ctrl+Z) command. However, since the standard edit command is limited to one Undo request, only the newly created auto formatting text can be reversed. Changes made prior to auto formatting cannot be reversed using the Undo (Ctrl+Z) command.

[*:2ew1beb7]Tab Spacing. When real tab characters are used, the spacing width is based on the Microsoft default of 4 Dialog Template Units (DTUs) per character. This default is very accurate when a fixed-pitch (monospace) font is used but can vary substantially when a proportional font is used. If there is any interest, tab spacing may be calculated on a per-font basis in the future (additional research required).

[*:2ew1beb7]Too Many Fonts. Very rare. A "Too many fonts" error can occur if the editor font is changed too many times. If this error occurs, stop and restart the script.

[*:2ew1beb7]Print. Not yet.

[*:2ew1beb7]Spell Check. English (United States) dictionary only for now. Future: ?

[*:2ew1beb7]Documentation. Not yet.

[*:2ew1beb7]Unicode. Nope.[/list]References
Some of the function libraries used by this project:
COM Standard Library
Used by the Text-To-Speech feature

Edit Library

Spell Library
Used by the Speck Check feature
Final Thoughts
Although QuickEdit is quick, lightweight, and has some cool features, there is no big push for yet another text editor so I don't really see much demand for this project. But and however, the source code is available so you can tweak it for your particular needs.

Release Notes

Original release.

v0.2 (Preview)
- Enhanced support for running multiple occurrences of the script.
- Added AutoSave Untitled Documents option ("Options" menu). This option is not enabled by default. To find and open saved Untitled files, added Open Untitled command ("File" menu). To limit the total number of saved Untitled files, added the Max Untitled Files option to set the total number of saved Untitled files (default: 50).
- Added Auto Formatting options: Indent, Bullets, Numeric Lists, and Alphabetical Lists. Also, user can define custom bullet characters and sequence delimiter characters.
- Added support for tab size and and real tab characters. Also, Tab and Shift+Tab keyboard shortcuts are used to shift (indent) and unshift (remove indention) selected text.
- Added option and keyboard shortcut (F5) to add the current date/time to the current location (similar to Notepad). The date/time format is completely customizable.
- Added Date/Time Format help.

  • Members
  • 1029 posts
  • Last active:
  • Joined: 01 Oct 2005
v0.2 (Preview). Added some additional features just for the fun of it. See the bottom of the first post for a list of changes.