Bare Metal Programming Tool Kit
 All Classes Namespaces Functions Variables Enumerations Enumerator Pages
PSPad
pspad-logo.gif

PSPad (www.pspad.com) is a free code editor that can be configured to work with bmptk. This is done by including a few lines in the .ppr file to attach external commands to two buttons, and by including a build.bat file in the work dircetory that contains just the one line "make build". This .bat file is required because it seems impossible to run make directly from the .ppr file. The examples directories contain the appropriate .ppr and build.bat files.

With this setup in place the "run external compiler" button (or CTRL-F9) can be used to run "make build". The result of this command is captured in the result window, and you can click on an error message to jump to the corresponding scource location. When this has been succesfull the "open active file in external program" button (the one with the lightning bolt, no CTRL shortcut) can be used to run "make run" or "make clean". This button is less usefull for building the application because the command output is not captured by PSPad. For these buttons and commands to work it is required that the active file is one of the source (.h or .cpp) files in the working directory. If another type of file is open the buttons will be inactive (grayed out). If a source file in another directory is active PSPad will run the make commands in that directory.

Watch out when you open a new file in PSPad. The default directory that appears in the file selection menu is the last directory that you used in this way, NOT the directory PSPad was started in. Hence when you switch projects it is very easy to open the wrong source of Makefile and be flabbergasted that your changes seem to have no effect at all.

To open the Makefile you must right-click it and choose "open as text file". Don't forget to switch to a source file when you subsequently want to build or run the application. If things seem to go very wrong it might be an idea to open the .ppr file as text file to check which source files you realy are editing.

On my 64-bit Windows 7 PC PSPad does not show the names of the files in the edit tabs. This worked correctly on my laptop (windows XP).

PSPad will save all changed files before it runs an external command.

By default PSPad will use tab characters to create indendation, which IMHO is very bad because no two programs agree on how much indendation each tab creates. Use Settings => Program Settings => Editor Settings to correct this. I prefer 3 spaces per indentadion level.

pspad-editor-settings.gif

When freshly started with a project directory copied from another PC PSPad will sometimes produce this error:

pspad-error1.gif

I am not sure what causes this problem but it can be fixed by quitting PSPad and restarting it. Apparently it rewrites the .ppr file and in the process removes some problem, maybe with line endings.

Some tips: