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.
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.
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
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
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.
These are functions within your own code that may match with any partial text
that may be written.
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.
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.
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.
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.
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
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.
Keyboard navigation is also possible, and you can press
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
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.
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
Here we can see the menu and its options. The first three are simply yet another way to perform clipboard
The Check Spelling menu item mirrors the same feature that is available from the main
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
"Touch" is again just a mirror from the main
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
"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
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
back to the top
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