Turbo Pad Help

About

Introduction

Turbo Pad is a fast and feature rich text editor designed for programmers. This document describes all aspects of the Turbo Pad editor, including how to compile the editor from source. If you need more information, please contact me.

Note: This document is the process of being re-written. Some of its content may be out of date.

Copyright (C) 2002-2003 Matt Watkins [mattwat at users.sourceforge.net]. This document may be distributed under the terms of the MIT license.

Features

Turbo Pad possesses many advanced and helpful features. The following is a list of many of those features.

License

Turbo Pad is licensed entirely under the MIT License:

Copyright (c) 2002-2003 Matt Watkins

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Credits

The icons used in Turbo Pad are part of the Bluesphere SVG icon set. These icons can be found at http://sourceforge.net/projects/svgicons.

Bluesphere License:

Copyright (c) 2002, Christian Schaller / Vadim Plessky
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
    * The names of the Bluesphere icon set contributors
may not be used to endorse or promote products derived from this
software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.
        

Thanks everyone who worked on wxWidgets, with which this program was written. Thanks to Robin Dunn for wxStyledTextCtrl.
http://www.wxwidgets.org

Thanks to the GNU developers for GCC. Thanks to everyone who worked on MinGW.
http://www.gnu.org
http://www.mingw.org

Thanks everyone who worked on Dev-C++, the IDE with which Turbo Pad was primarily developed.
http://www.bloodshed.net

Thanks to Neil Hodgson for Scintilla and for SciTE.
http://www.scintilla.org

Thanks to Sourceforge for hosting this project.
http://www.sourceforge.net

Thanks everyone who worked on UPX, which was used to compress the executables.
http://upx.sourceforge.net

Thanks to everyone who worked on NSIS, which was used to create the Windows installer.
http://www.sourceforge.net/projects/nsis

Thanks to Denis Tranchemontagne, for working on the Linux port and writing a Linux makefile.

Thanks to Andre for making icons for Turbo Pad.

Lastly, thanks to all of the alpha and beta testers which helped to test the program, everyone who gave me ideas and reported bugs for Turbo Pad and, finally, everyone who supported its development.

Contact

Turbo Pad Website: http://turbopad.sourceforge.net
Turbo Pad Project Page: http://sourceforge.net/projects/turbopad
Turbo Pad Forums: http://sourceforge.net/forum/?group_id=78230

Downloads:
Latest Version
Nightly Tarball

Trackers:
Bug Reports
Get Support
Request A Feature
Submit A Patch

Forums

One way to contact me is by way of the forums. These can be found on the Sourceforge project page where it says "Public Forums".

Forums are an excellent resource and provide a quick and easy means to get help for any problems you are having with Turbo Pad. They are also a good place to discuss anything related to Turbo Pad with other users.

Tracker

Also on the Sourceforge project page are Trackers which are a quick and easy way to report bugs, request features or get technical support for Turbo Pad. If you want to report a bug, request a feature or simply get support, using the trackers is highly recommended and is the preferred means of communication with the Turbo Pad team.

Mailing Lists

Mailing lists are another means to contact either me or other users of Turbo Pad. There currently are two different mailing lists, a turbopad-announce mailing list which will e-mail you when a new version has come out, and a turbopad-users mailing list, which is basically an open discussion mailing list for anything related to Turbo Pad.

More information can be found on the project page.

E-Mail

To contact me via e-mail, you can send me an e-mail at mattwat at users.sourceforge.net (Remove no.spam. from the address)

Menus

File

New: Creates a new file.

Open: Opens a file in the editor.

Save: Saves the current file.

Save As: Saves the current file under the specified name.

Save All Files: Saves all currently loaded files.

Close: Closes the current tab.

Close All: Closes all tabs currently open.

Load Session: Loads a session file.

Save Session: Saves the currently open files as a session.

Recent Files: Shows a list of all recent files

Exit: Closes Turbo Pad.

Edit

Undo: Cancels the last operation.

Redo: Restores the last operation after an undo.

Cut: Removes the selected text and places it on the clipboard.

Copy: Copies the selected text to the clipboard.

Paste: Inserts the text on the clipboard.

Select All: Selects all text in the current document.

Search

Find: Shows a dialog that enables the user to search the document.

Replace: Shows a dialog which allows text to be replaced.

Find Next: Finds the next occurrence of the current search item.

Find Previous: Finds the previous occurrence of the current search item.

Go To Line: Shows a dialog which allows Turbo Pad to jump to the specified line.

Next Bookmark: Goes to the next bookmark in the document.

Previous Bookmark: Goes to the previous bookmark in the document.

Toggle Bookmark: Places or removes a bookmark on the current line.

Remove All Bookmarks: Removes all bookmarks in the document.

View

Show Matching Brace: Jumps to the brace that matches the one next to the caret.

Show Indent Guides: Shows lines at every tab stop to help with indentation.

Show Whitespace: Makes visible all tabs and spaces.

Show EOL: Makes visible all line endings in the document.

Show Fold Margin: Shows or hides the fold margin.

Show Line Numbers: Shows or hides line numbers in the document.

Show Bookmark Margin: Shows or hides the bookmark margin.

Read Only: Toggles read only mode for the current document.

Format

To Upper Case: Changes the currently selected text to uppercase.

To Lower Case: Changes the currently selected text to lowercase.

Sort Text: Sorts all selected lines (case-sensitive).

Block Comment: Block comments the selected lines using the current comment type.

Stream Comment: Stream comments the selected lines using the current comment type.

Insert:
Date/Time: Inserts the current date and time.
Code Template: Inserts a code template matching the word next to the caret.

Tools

Build: Builds as specified by the file extension in Exec.cfg.

Compile: Compiles as specified by the file extension in Exec.cfg.

Run: Runs as specified by the file extension in Exec.cfg.

Spaces To Tabs: Converts all spaces to tabs where applicable.

Tabs To Spaces: Converts all tabs to spaces.

Line Endings: Converts the document to type specified.

Options

Environment Options: Shows the options dialog.

Auto Indent: Enables or disables Auto-Indent.

Highlight Braces: Enables or disables the highlighting of braces.

Word Wrap: Enables or disables word wrap.

Help

Help: Shows the custom help file as specified in Help.cfg.

Turbo Pad Help: Shows this help file.

About: Shows the about box.

Command Line Arguments

Usage

TurboPad [-n] [File] [File]

Arguments

-n - Creates a new file.

Options

Options Menu

Many options can be edited via the Options Menu. Any options that are changed on the options menu are saved for the future. This also applies to some things on the View Menu, such as Show Whitespace and Show Indent Guides.

Config Files

On all platforms, options are stored in config files. The main config files can be found in the "Config" directory of the Turbo Pad folder. Most options and preferences can be found in the file "Prefs.cfg". All recent files are stored in "RecentFiles.cfg". Global style settings are stored in the file "Style.cfg" All highlighter config files can be found in the "Highlighters" directory.

Executing Files

Introduction

Turbo Pad provides support for executing files, meaning opening a file with another program, compiling a file, interpreting a file, etc. This section describes how to use Turbo Pad's file execution mechanism.

Editing Config Files

All execute information is stored in highlighter specific config files. Each highlighter config file can be found in the Highlighters directory. First, open the highlighter config file corresponding with a certain highlighter. Then look for a lines that look like the following:

[Highlighter].Compile =
[Highlighter].Build =
[Highlighter].Run =

In the above lines, highlighter would be replaced with the highlighter name. You can simply put the commands for building, compiling and running after the equals sign. You can use special variables as shown below which will be replaced with a value such as the filename or extension of the current file.

After doing this, you can now use Build, Compile and Run in the Tools menu for whatever highlighter config file you were editing.

Execute Command Reference

$(FilePath) - Filename with path.
$(FileDir) - Path only.
$(FileNameExt) - Filename only, without path but with the extension.
$(FileName) - Filename only, without path and extension.
$(FileExt) - Extension only, without a period in front.
$(ReloadFile) - Reloads the file after execution.

Code Templates

Introduction

Another advanced feature of Turbo Pad is Code Templates, which allows commonly used blocks of source code (or simply text) to be inserted quickly and easily. Turbo Pad comes with some code templates predefined. They can be found in the templates directory of the main Turbo Pad installation directory.

Usage

To use code templates, simply type a code template keyword and then press Ctrl+Space. Please note that each highlighter has its own code templates, so not all code templates will work with each highlighter.

Example

To test out code templates, first switch to the HTML highlighter. Now type ht. This is the keyword for a basic HTML layout. Now simply press Ctrl+Space. You should now see a basic HTML layout. To view other keywords for HTML, you can open HTML.tpl in the templates folder of the Turbo Pad installation directory.

Editing Config Files

Config File Overview

Each template file consists of groups of code templates. Each template first begins with a header line inside of brackets, specifying the name of the template and a short description after the "|" character. Following the header line is the actual code to be inserted for the template. The code ends once the next header or the eof is reached. All trailing newlines of the template itself will be removed before insertion. Also, you can specify the location at which the caret will be placed after insertion by placing a "|" character at that position. If you wish to insert a "|" character and not have the caret placed at that position, insert "||". Also, if you wish to insert a opening bracket, please use "[[" as brackets are used in header lines.

Example Config File
[if | If Statement]
if |:

[elf | Else If Statement]
elif |:

[els | Else Statement]
else |:

Custom Help Files

Introduction

Custom Help files allow you to open a help file corresponding to the current language. As an example, you could set the PHP help file to open whenever you select Help while writing PHP code. To set custom help files, you can simply edit the highlighter config file corresponding with each highlighter. By default, these config files can be found in the Highlighters directory of your Turbo Pad installation.

Config File Overview

In the config file corresponding to the highlighter you want to add a custom help file for, look for a line in the following form:

[Highlighter].Help = 

Where [Highlighter] is the highlighter name. Simply put the file name of the help file after the equals sign and save the config file. You can now press F1 to open the help file after switching to the correct highlighter.

Advanced Features

Quick Find

Quick find allows you to find text quickly without ever bringing up the find dialog. First highlight the word or move to the position of the word you would like to search for. Now, to search forward, press Ctrl+F3. If you would like to search backward, press Ctrl+Shift+F3.

Word Completion

Word Completion is an advanced feature which allows you to complete partially typed words in the document. Word completion gives you a list to choose from using words in the current document, so it will only work if you have previously typed the word you are trying to complete. To use word completion, press Ctrl+Enter.

Bookmarks

Turbo Pad also provides a flexible bookmarking system. To toggle a bookmark, either press Ctrl+F2 to bookmark the current line, or click in the bookmark margin. To go to the next bookmark, press F2, and to go to the previous bookmark press Shift+F2. You can also remove all bookmarks by going to Search and then Remove All Bookmarks.

Miscellaneous

Indenting: Press Tab when more than one line of text is selected to indent those lines. Press Shift+Tab to unindent when text is selected.

Transposing Lines: Press Ctrl+T to swap the current line with the above line.

Duplicating Lines: Press Ctrl+D to duplicate the current line.

Cuting Lines: Press Ctrl+L to cut the current line.

Copying Lines: Press Shift+Ctrl+T to copy the current line.

Deleting Lines: Press Shift+Ctrl+L to delete the current line.

Delete to the start of the word: Press Ctrl+BackSpace.

Delete to the end of the word: Press Ctrl+Delete.

Delete to the start of the line: Press Shift+Ctrl+Backspace.

Delete to the end of the line: Press Shift+Ctrl+Delete.

Go to the start of the displayed line: Press Alt+Home.

Select to the start of the displayed line: Press Shift+Alt+Home.

Go to the end of the displayed line: Press Alt+End.

Select to the end of the displayed line: Press Shift+Alt+End.

Getting The Source

File Releases

All file releases come with the source. File releases can be found on the Turbo Pad Project Page.

Windows Installer

If you downloaded the Windows Installer for Turbo Pad, you can choose to have the source installed alongside Turbo Pad. To do this, simply make sure the source component is checked upon install.

Source Packages

Source packages are another way to get the source. Downloading and building the source from a source package is the preferred way of using Turbo Pad on non-Windows operating systems. The source packages can be found in zip, gzip and bz2 formats on the file release page along with the Windows installer.

From CVS

The latest versions of source can be found on CVS. These sources may be broken or unstable from time to time, but are the best way to try out new features or help report bugs.

To get the sources from CVS, you must have a CVS client. If you don't, you can download one at the official CVS site. Once you have CVS, you should first login to CVS using the following command:

cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/turbopad login
        

When prompted for a password, simply press enter. Next, to check out the actual source, issue the following command:

cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/turbopad co Source
        

This will check out the latest version of the source which is present in the Source module. More information on using CVS with Turbo Pad can be found at http://sourceforge.net/cvs/?group_id=78230.

Building Turbo Pad

Note: All of the following information is outdated; please refer to the ReadMe.txt file that comes with the source.

The GCC compiler is required to build Turbo Pad. If you are using Windows, you will first need to download MinGW.

Dependencies

Turbo Pad requires wxWidgets and the wxStyledTextCtrl library. wxWidgets can be found at www.wxwidgets.org. wxStyledTextCtrl comes with wxWidgets and can be found in the "contrib" directory.

Compiling wxWidgets

Information on compiling wxWidgets can be found in the file "install.txt", which is in the docs folder. In the file /include/wx/[msw/gtk]/setup.h, make sure to turn all compatibility settings off and turn all non-obsolete features on (except OpenGL). Remember to copy setup.h up one level before compiling wxWidgets as specified in install.txt. When you are finished, copy wxWidgets/include/wx to your GCC or MinGW /include directory and copy all .a files in wxWidgets/lib to your /lib directory.

Compiling wxStyledTextCtrl

wxStyledTextCtrl is a contributed wxWidgets library, and thus can be found in the contrib/src and contrib/include folders with the name "stc". In wxWidgets 2.4.2, all that is required to build this is a simple make command like you used to build wxWidgets, except this time inside of the contrib/src/stc folder. When you are finished, copy /contrib/include/wx/stc to your MinGW or GCC /include/wx folder and copy the libstc.a file from /lib to your lib folder.

Compiling On Windows

Using Dev-C++

Dev-C++ is no longer supported for compilation. Please use the MinGW command line tools instead to build Turbo Pad. However, since Dev-C++ includes the MinGW tools, you may use the as specified in the Using MinGW section (Note: you may need to type "make" instead of "mingw32-make")

Using MinGW

Note: All of the following information is outdated; please refer to the ReadMe.txt file that comes with the source.

The MinGW command line tools are required to build Turbo Pad. MinGW is a Windows port of GCC along with support for the Windows API, and can be found at www.mingw.org.

Once you sucessfully compiled wxWidgets and wxStyledTextCtrl, you are ready to compile Turbo Pad. First cd to the Turbo Pad source directory.

cd Source

Next do a mingw32-make to compile Turbo Pad. If MinGW, wxWidgets and wxStyledTextCtrl are all installed correctly, you will not have any problems with this step.

mingw32-make -f Makefile.win

This should produce a TurboPad.exe file. Now issue the following command to prepare Turbo Pad for general use.

move TurboPad.exe TurboPad

Now, Turbo Pad is ready for use. To finish the process, simply copy the TurboPad folder to wherever you wish Turbo Pad to be installed and optionally create some shortcuts to the file TurboPad.exe.

Building The Installer

At the current time, Turbo Pad is built with the latest version of NSIS. Since the files are most likely in a different location on your computer, you will need to change some !define lines to match your file locations. After fixing the paths to match your computer, and after NSIS is installed, you can right click on the file in Explorer to compile it.

Compiling On Linux

Note: All of the following information is outdated; please refer to the ReadMe.txt file that comes with the source.

To get Turbo Pad to compile on Linux, first compile and install wxWidgets along with wxStyledTextCtrl, which can be found in the contrib directory of wxWidgets. In the wxWidgets setup.h file, make sure to turn all compatibility settings off and turn all non-obsolete features on (except OpenGL).

Next, cd to the Source folder and do a make to compile Turbo Pad.

cd Source
make -f Makefile.lin

Now, copy the resulting TurboPad binary to somewhere in your path. Also, copy the TurboPad folder to /usr/share/turbopad or /usr/local/share/turbopad. If you do not copy the TurboPad folder to the correct location, Turbo Pad will not work.