Editor Quick Reference


Editor Window

back to the top


Top Tip

While you can double-click on words and phrases to select them, if you hold down either "Shift" key when double-clicking a user function name (like "main"), you will be taken to that functions definition automatically. Also, Shift/double-clicking system functions will open the help item if one exists in the dictionary. This makes it very easy to get the right help when you need it.

There may also be extra functionality depending on the plugin. For example, the AmigaOS4SDK plugin can also take you to include files if you select text that matches one. When viewing autodocs from the help system, it may specify include files to view for extra information. In this case you can hold down either Shift key, and drag-select the path to the include file. The plugin will then attempt to locate the file and open it for you in the editor as a read-only file.


Editor Buttons


  • New Button Create a new file and open it ready for editing.

  • Open Button Load an existing file from disk into the editor.

  • Save Button Save a modified file back to disk.


  • Cut Button Cut the highlighted block from the file and save to the clipboard.

  • Copy Button Copy the highlighted block from the file to the clipboard.

  • Paste Button Paste the contents of the clipboard back to the cursor position.


  • Goto Button Make the cursor jump to a specified line number.


  • Find Button Find a specified string in the current file and optionally replace.


  • Help Button Show the last Help item that was generated.


  • Print Button Print the current file, or the selected part of it. If a section of text is currently selected, a small popup menu will appear to ask you what you want to print, the entire file, or just the selected portion. The printer device can be changed in the preferences



  • Navigation Backward Button Navigate backwards to a previously visited file or position.

  • Navigation Forward Button Navigate forwards to a previously visited file or position.


  • Search Previous Button Search for the previous occurence of the selected text.

  • Search Next Button Search for the next occurence of the selected text.


  • Navigation Backward Button Show or hide the Line numbers.

  • Horizontal Ruler Show or hide the column ruler.


back to the top




The editor window features a "Tab" functionality allowing multiple files to be worked on at the same time without the need to have separate editor windows open. The name of the file is shown in the corresponding tab, and selecting the tab of interest will make that file the currently active one. Cursor and line positions are retained while switching from file to file allowing you instantly jump to a different file and back again without loosing your place.

Disk Image The tab for the relevant file will also reflect the saved state of the file. If the file has been modified and not saved to disk, a small red flag will be present in the tab for that file, giving you an instant view of which files have yet to be saved back to disk. The same flag will be shown for any project that has been modified and needs saving too.The main program preferences feature an "AutoSave" option, which will save the current file when switching to a new one. You can find out more information in the Preferences section.


Editor Status The editor also features a status line at the bottom of the window, and this gives you an instant view of the current cursor position. The small disk icon will also reflect the current saved state of the file, which, when saved will be a grey image, and unsaved will be a bright blue.

back to the top



Page Guide

page_guide page_guide2

The editor also features a page guide which helps to align text to a specific column width. When writing documentation or other reference material, it is sometimes preferable to line-wrap the text at a certain column so that the text does not appear too wide.

When the column ruler is visible, you will notice a small red coloured " handle". You may "grab" this by putting the mouse pointer over it, and pressing the left mouse button. The pointer will change to indicate that you have successfully "picked it up", and you may now move it left or right to place it at the desired column. This will be " dropped" in place when you release the left mouse button.

When saving the preferences, the current column position will be saved. You may also set the default column at which the page guide will appear from the preferences.


The editor also supports the use of a right button popup menu giving access to frequently used or context aware functions. These include clipboard handling, jumping to matching braces, " Touch"ing files, the insertion of code constructs, searching, attributes of the current file and more. This menu will be limited in operation when using the free licence version. (See below for further information)


back to the top



Help-as-you-Type function

After creating a dictionary, the contents of it are used as reference material for a live system which monitors what you are typing or have selected. Once the dictionary has been checked, any relevant information is shown in a small window which tracks the editors cursor, which means it will not obstruct the view of the source being edited.

In the case of the AmigaOS4SDK project type, the list presented will contain, but is not limited to, the following types of information.

  • User Functions
    These are functions within your own code that may match with any partial text that may be written.

  • System Functions
    System functions are derived from the information gained from the SDK files. The functions shown may partially or completely match the text under the cursor.

  • User Structures
    These are complex variables that have been defined in your own code. The list will show the structure, and the fields within it. The location of the definition is also shown for your convenience.

  • System Structures
    Again, these will be pulled from the dictionary, and will be generated automatically from the SDK files when building the dictionary. As before, the structure name and the fields within it will be shown, along with the file and line number of the "include" file where it is defined.

  • User definitions
    In your own code, you may "#define" some value. A common reason for this is to set a string constant to a more memorable name, or perhaps a numerical value to a decriptive name. Luckily, these are found and displayed in the Help-As-You-Type window, along with what the definition is defined as.

  • User Enumerations
    Just like definitions above, your own code made enumerate a series of values to more descriptive tags. These will also be shown in the Help-As-You-Type window along with their enumerated value.

The project settings give options on how to refine this data, and include showing the library interface (if any) the function belongs in, and also the prototype for the function.

In our example, placing the cursor over the Printf word results in this window appearing.

A selection from the list can be made by double-clicking it with the mouse, and that selection will replace the word that has caused the match. If an extended description was found in the dictionary, this will cause the Help button to be activated, and it can be shown in the editor as a Read only file. Although this help item cannot be edited, you may copy text from it and use it in your own files.

Top Tip

Keyboard navigation is also possible, and you can press <Shift-TAB> to activate the "Help-as-you-Type" window. Once activated, the first item in the list which can be inserted into the editor will be highlighted for you. You may choose the item you want by using the cursor Up and Down keys, and then make your selection by pressing < Return> or <Enter>. Once a selection is made, it will be inserted into the text. Alternatively, making a selection with either < Shift> key held down will jump to the file and line where the item is defined/declared.

> Items like those shown below which can be expanded to show more information can also be controlled via the keyboard. To expand an item, press the right cursor key over the item. To collapse it again, press the cursor left key. You may also close this window and return to the editor by pressing the <Escape> key.

HAYT_Structure More information on configuring the "Help-as-you-Type" system can be found in the Project Settings page. The structures are, again, shown during typing or cursor placement. Typing " Gad" would result in the Gadget structure being shown in the window. The fields shown in the list are Read-only, so unlike functions, these cannot be clicked on to insert them into the text, and are purely for reference purposes only. Any unions or structures embedded within the structure being shown will also be displayed in this "tree" view for ease of reference. back to the top


back to the top



Right button menus (popup)

The editor features a "popup" menu which can be accessed by pressing the right mouse button anywhere inside the editor pane, and gives a convenient way to carry out common operations like cutting and pasting sections of text. There are also some features present in this menu which are not available elsewhere, and that may also change according to the type of project being worked on. We shall cover all the options in the menu that are available with out example project. All C/C++ projects will have the same options available Editor popup Here we can see the menu and its options. The first three are simply yet another way to perform clipboard operations.

The Check Spelling menu item mirrors the same feature that is available from the main Editor menu.

The Block item gives us various options on what we can do with the currently highlighted text. Currently we can perform Indent and Outdent operations and also convert the block to upper or lower case characters. The Disable and Enable operations will comment or un-comment the entire block of text respectively in a way suitable for the project. In our example project, this would mean that every highlighted line would be prefixed with a "//" to signify a comment. A DOS script would have ";" prefixed, and so on. Enabling the block simply looks for the comment character at the start of the line and removes it. There is no limit to the amount of lines that can be highlighted, making this a very useful and versatile function.

The "Jump to matching" item simply mirrors the same option in the main Editor menus. "Touch" is again just a mirror from the main Project menus. Editor popup2

The "Insert" item allows various blocks of code to be inserted at the current cursor position. These blocks of code are classified as "Constructs" and are completely configurable. You may add, remove or edit these constructs by selecting the "Edit Constructs" menu item to open the construct editor. One point worth noting here is that inserting an "Autodoc entry" is best achieved by placing the cursor on the line just before the function definition. This will allow the AutoDoc text to include information about the function, like its name, prototype and parameters.

The "Search" item gives the option to search all files for the currently highlighted block of text. While a block is highlighted, you can use the "Next" and "Previous" items to conveniently search in the current file without opening the search window. Lastly, we can view the attributes of the current file by selecting the "File Attributes..." item, and this is mirrored in the Editor menus, and the Project window popup menu.

back to the top



Code Constructs

Code Construct Editor The concept of "Code Constructs" is quite simple, and basically consists of small blocks of source code that have been pre-defined and can be inserted into the text when required. This makes it much easier to handle frequently used constructs of source code, such as loops and decision making. The actual content of the constructs is defined on a project by project basis. Essentially this means that the code constructs defined in an AmigaOS4SDK type of project will be different to those in a PHP-HTML type of project etc. They will, however, be the same for projects of the same type. This saves having to define constructs for each and every project.

There are some constructs defined by default, and you may edit or delete these as you want to meet your requirements and code style.

You may supply indentation in your construct, but this will be changed when the construct contents are inserted into the text. The project settings for indentation will be used instead to give a consistent code formatting. The Indentation in the construct tells CodeBench which line should be indented, but the actual indentation will be changed to mirror the indentation settings of the project. Using indentation in the construct content is also very useful when creating larger constructs and will aid clarity.

You may select one of the already defined constructs in the list to see the contents in the editor in the lower half of the window. The name of the construct is what you will see in the Editor Popup menu, and this may be editied by double-clicking its name in the list. You can then change it by the inline editor of the list.

Creating a new construct is simply a matter of selecting "New". A new entry will appear in the list, and the inline editing will be active ready to set the name. Set the name to something that clearly reflects the contents or purpose of the construct. Once that is done, you may set the construct contents. You may either type in the contents, or you may paste some text from the clipboard by using the default keyboard shortcut.

You may also change the order that constructs are presented by using the "Up" and "Down" buttons. This will change the order that the constructs are shown in the Editor Popup menu, so you may keep more frequently used items at the top for quicker access.

You can delete any unwanted items by selecting the construct in the list and pressing "Delete".

back to the top



Editor Search function

The search system runs in different ways depending on which window it was launched from, and the editor window will tell the search system to search the currently open files for your required criteria, while the Find system will always search the current file being worked on. More information about all the functions of the search system can be found here.

back to the top

Valid XHTML 1.0 Transitional This is a W3C checked and compliant webpage.