Editing Text

Home • Gallery • Tutorials • Download • Purchase • Site Map
 

Editing Text Overview

On several the Fractal Science Kit fractal generator Application Windows, an editor pane is provided to edit a block of text. The editor pane is a simple text editor with support for standard commands like Undo, Redo, Cut, Copy, Paste, Delete, Select All, Clear All, and Find and Replace... along with a few additional commands useful for editing program instructions including Increase Indent, Decrease Indent, Comment Block, and Uncomment Block.

As with most text editors, you use the mouse to position the cursor or select some text, and then you start typing. The text is inserted at the cursor position and replaces the selected text (if any).

Commands

The editor commands are accessed via the context menu and/or a set of key mappings.

The context menu is displayed by right-clicking over the text.

The context menu has the following commands:

  • Undo is used to undo the last change to the text.

  • Redo is used to redo a change you previously undid!

  • Cut deletes the selection from the editor and places the text on the Windows clipboard.

  • Copy copies the selection to the Windows clipboard.

  • Paste replaces the selection (if any) with text found on the Windows clipboard.

  • Delete deletes the selection from the editor.

  • Select All selects all the text in the editor.

  • Clear All clears (deletes) all the text in the editor.

  • Find and Replace... displays the Find dialog that you can use to find/replace a word or phrase in the text.

  • Increase Indent is used to increase the indentation of the selected block of text. Increase Indent is disabled if the selection is empty or does not contain 1 or more whole lines of text. This is useful when editing program code.

  • Decrease Indent is used to decrease the indentation of the selected block of text. Decrease Indent is disabled if the selection is empty or does not contain 1 or more whole lines of text. This is useful when editing program code.

  • Comment Block is used to comment the selected block of text. Comment Block is disabled if the selection is empty or does not contain 1 or more whole lines of text. This is useful when editing program code.

  • Uncomment Block is used to uncomment the selected block of text. Uncomment Block is disabled if the selection is empty or does not contain 1 or more whole lines of text. This is useful when editing program code.

Most of these commands can also be accessed using the following key mapping:

  Undo Ctrl+Z
  Redo Ctrl+Y
  Cut Ctrl+X
  Copy Ctrl+C
  Paste Ctrl+V
  Delete Delete
  Select All Ctrl+A
  Find and Replace Ctrl+F
  Increase Indent Tab
  Decrease Indent Shift+Tab

The following editing commands are also supported:

  Delete Next Word Ctrl+Delete
  Delete Previous Word Ctrl+Backspace
  Move Down By Line Down
  Move Down By Page PageDown
  Move Left By Character Left
  Move Left By Word Ctrl+Left
  Move Right By Character Right
  Move Right By Word Ctrl+Right
  Move To Document End Ctrl+End
  Move To Document Start Ctrl+Home
  Move To Line End End
  Move To Line Start Home
  Move Up By Line Up
  Move Up By Page PageUp
  Select Down By Line Shift+Down
  Select Down By Page Shift+PageDown
  Select Left By Character Shift+Left
  Select Left By Word Ctrl+Shift+Left
  Select Right By Character Shift+Right
  Select Right By Word Ctrl+Shift+Right
  Select To Document End Ctrl+Shift+End
  Select To Document Start Ctrl+Shift+Home
  Select To Line End Shift+End
  Select To Line Start Shift+Home
  Select Up By Line Shift+Up
  Select Up By Page Shift+PageUp
  Toggle Insert Insert

Hyperlinks

If you include a sequence of characters recognized as a hyperlink, it is displayed as an active link, and clicking on the link will attempt to connect to the Internet and view the associated page.

If you want to link to a file on your computer, you can use the file:// tag followed by the full path to the file. You will need to surround the link with the characters < and > to allow the use of spaces in the path. If the file is located in the My Files folder, you can use a relative path rather than a full path for the link.

Example:

<file://My Docs\shapes.htm>

The text above defines a link to a file named shapes.htm in the folder My Docs under the My Files folder.

Double-Click Behavior

As with most editors, you can double-click on a word to select it or triple-click to select the entire line. However, there are a few issues you need to be aware of related to how the underlying control that I use for the editor pane behaves when you double-click on a word.

The first issue is that any spaces following the word are also selected. This is common in many editors but is sometimes problematic.

The second issue relates to what characters delimit a word. The underlying control treats an underscore as a word delimiter but since an underscore can be used as part of an identifier this is inconvenient. For example, double-clicking on the z in the identifier size_x would only select the first 4 characters of the identifier. Worse yet, the underlying control does not treat a caret as a word delimiter but as part of a word so that double-clicking on the z in the expression size^2 would select the ^2 too.

The final issue relates to bug in the underlying control with respect to single quotes. When you double-click on a word followed by a single quote and 1 or more spaces, the control selects the single quote and the trailing spaces rather than the word you double-clicked on!

I have tried to find a way to correct these issues but as yet have not been successful.

 

Copyright © 2004-2014 Hilbert, LLC
All rights reserved