Description
What is the use of ToolBox Manager V1.0.1 ? That the main question of the day ! This "Plugin" serves to centralize the general utility codes that are used regularly in the source code of several others projects.
If a function or function group (Example Vector3.pb) is / are used(s) in the source code of many different programs. The first reaction is to place the code of its functions in a separate files and copy them into the directory of each project. But doing this makes their updates particularly painful and indeed we have to do this each time you update for all of the project using them,
Another solution is to create Residents and libraries files using TailBite or Moebius. Unfortunately, this alternate solution is not without bring a lot of different problems, especially when the libraries themselves are under development. We have to recreate them again and again. So often in fact that we spend more time to compile library than we spend to develop projects. And more important fact we have to create Resident/Library files for each platform (Windows, Linux, MacOSX). This put just more job in the current work load.
The solution provided by ToolBox Manager is simple. It is centralized in a directory all the codes that are reused in several programs and make them available both for the compiler to the programmer while avoiding multiple copies of the same source code. Ultimately, the directory ToolBox could be on a shared drive over a computer network so it will be accessible to many programmers at the same time.
You can do the same without even using ToolBox Manager .
However, it can simplify the writing because part of the work is done in background.
Normally, to include one or more external source codes in the source code of a program we have to do this :
IncludeFile "/home/guimauve/codes
purebasic/librairies/maths/vector/vector2.pb"
IncludeFile "/home/guimauve/codes
purebasic/librairies/maths/vector/vector3.pb"
IncludeFile "/home/guimauve/codes
purebasic/librairies/maths/vector/vector4.pb"
There are only three files included and it's very painful so imagine if there are 20, 30, 40 or even more files to include !
ToolBox Manager simplifies the three lines above to one :
ToolBoxFile "vector2.pb",
"vector3.pb", "vector4.pb"
As we can see, it's lighter! Moreover, it is possible to put multiple names on one line, there is no limit, however, we must understand that ToolBox Manager performs the opening, at the request of the programmer, all the codes found after the keyword ToolBoxFile. In the example above, the opening of files command will open in the editor the "vector2.pb", "vector3.pb" and "vector4.pb" even if only the file "vector3.pb" has to be consulted.
Compilation and Installation
To install ToolBox Manager , it is recommended to install in a subdirectory named "plugins/toolbox_manager/" in the installation directory of PureBasic. Furthermore, ToolBox Manager is distributed with it's source code that can be compiled to create the executable.
Configuration
Once installed, simply set it up in the "Tools" menu, submenu "Configure Tools...".
Preferences mode Configuration
- CommandLine : Select the "toolbox_manager" program in the installation folder
- Arguments : "PREFS" (between quotes)
- Working Directory : Select the folder were "toolbox_manager" has been installed.
- Name : ToolBox Manager (Preferences Mode)
The Preferences mode allow you to select the main ToolBox folders and enable / disable them as needed.
Importants Notes !
A selected directory will be traversed recursively including any subdirectories it contains.
Compile mode Configuration
- CommandLine : Select the "toolbox_manager" program in the installation folder.
- Arguments : "COMPILE" "%COMPILEFILE" (each arguments must be between quotes)
- Working Directory : Select the folder were "toolbox_manager" has been installed.
- Name : ToolBox Manager (Compile Mode)
- Event to trigger the tool : Before Compile/Run
- Check : Wait until tool quit
- Check : Hide Tool from the Main Menu
Create executable mode Configuration
- CommandLine : Select the "toolbox_manager" program in the installation folder.
- Arguments : "COMPILE" "%COMPILEFILE" (each arguments must be between quotes)
- Working Directory : Select the folder were "toolbox_manager" has been installed.
- Name : ToolBox Manager (Create executable Mode)
- Event to trigger the tool : Before Create executable
- Check : Wait until tool quit
- Check : Hide Tool from the Main Menu
Loading mode Configuration
- CommandLine : Select the "toolbox_manager" program in the installation folder
- Arguments : "LOAD" "%FILE" "%CURSOR"(each arguments must be between quotes)
- Working Directory : Select the folder were "toolbox_manager" has been installed.
- Name : ToolBox Manager (Loading Mode)
- Event to trigger the tool : Menu Or Shortcut
- Shortcut : Shift + F11
Loading mode to open the source code of ToolBox in the editor. For this
command to work, it is necessary that the cursor is on line of code starting with the keyword
ToolBoxFile.
Importants Notes !
To have the ToolBoxFile keyword to appear like other keywords,
it must be added in the Custom keywords list.
Opening mode Configuration
- CommandLine : Select the "toolbox_manager" program in the installation folder
- Arguments : "OPEN" (each arguments must be between quotes)
- Working Directory : Select the folder were "toolbox_manager" has been installed.
- Name : ToolBox Manager (Opening Mode)
- Event to trigger the tool : Menu Or Shortcut
- Shortcut : Shift + F10
Insert mode Configuration
- CommandLine : Select the "toolbox_manager" program in the installation folder
- Arguments : "INSERT" "%FILE" "%CURSOR" (each arguments must be between quotes)
- Working Directory : Select the folder were "toolbox_manager" has been installed.
- Name : ToolBox Manager (Insert Mode)
- Event to trigger the tool : Menu Or Shortcut
- Shortcut : Shift + F9
- Check : Wait until tool quit
- Check : Reload Sourfe after tool has quit
- Option : into current source
Insert mode allows you to select the desired code and add in the code being edited where the cursor is located. If the line where the cursor starts with the keyword ToolBoxFile then the file names will be added after those already present. If the line is empty, the keyword ToolBoxFile followed by the name of the selected files will be added. If the line contains something else it will be splitted at the cursor position and the keyword ToolBoxFile followed by the name of the selected files will be added between the two parts.