gbProcedureLibrary scans source code files from one or more specified folders (and it's subfolders), extracting user-specified structures and procedures into a Procedure Library. Folders to be excluded from the search may be specified. Procedure content is indexed for easy browsing, searching and viewing. Libraries (such as for a specific folder) may be saved and reopened. Duplicate procedures may be identified. Duplicates may also be bookmarked for subsequent retrieval.
As used in this Help document, the term Procedures is used to mean any of the following PowerBASIC coding structures:
Sub, Function, Callback, Thread, Macro, FastProc, Class, Type, Enum, Union, Declare, Interface, Method, and Property.
gbProcedureLibrary displays a list of all procedures in a ListView control, including a variety of properties which include the procedure title, parent file, date, line count, and others. Selecting a procedure from the list displays the procedure code in the embedded source code editor. Alternately, the parent file of the procedure may be displayed in the source code editor.
A second code editor is available for split screen viewing of a long procedure or for viewing two different procedures at the same time.
The embedded source editors offer advanced features. Syntax highlighting, call tips, autocompletion, brace highlighting, code folding, code formatting and indentation guidelines are just some of the features provided.
In addition to browsing, the user may search the Procedure Library. Searches can be limited to any combination of properties (name, date, ...) up to and including the entire procedure code content. Results of searches are displayed in a "Results" list, located above the list of all procedures.
The Results list is used to contain the results of a search, a list of all bookmarked procedures, and a list of all unique (no duplicates) procedures in the library.
Procedures may also be sent to an editor/IDE of the user's choice, such as the PowerBASIC IDE, for further editing or compilation.
Finally, gbProcedureLibrary can be used as the editor for an external source code file - such as the parent file of a procedure or any other file on the user's PC. The file can be opened, edited, and then saved to disk.
Download (v2.0, 1.0MB) |
To install, just unzip the contents of the distribution file into a folder of its own!
Advanced Editor Features
Build
To build a procedure library, specify the properties which define the library content:
Browse
The procedure list can be scrolled. Clicking on column headers will sort the list in
ascending or descending order. List columns may be hidden from view if not required by
the user.
When an item on the list is selected, the full content of the procedure is shown in the source code editor to the right.
Search
A secondary list of procedures may be generated in any of four ways,
and is displayed in the "Results" list (top left part of the gbProcedureLibrary screen).
To run a search, enter a search term in the dropdown combobox and press Enter (or the toolbar Search button). Case sensitive searching is supported. Also, the search may be limited to content of the displayed properties, or to the full content of the procedures' source code.
The Bookmark, Unique, and ASM lists are essentially pre-defined search criteria which the user can execute at any time.
Edit
The user may edit any code displayed in the source code editors. See a later section
on the advanced editing features provided by gbProcedureLibrary.
However the edits do not change the content of the Library. While the library is just a text file and could be edited by the user, gbProcedureLibrary provides no capability of directly editing the Procedure Library. The intent is for the Library content to always match the corresponding content from the user's source code files.
Two source code editors are provided. The main editor (on the left) is used to display procedures when a procedures is clicked in either the Main or Results lists. The secondary editor (on the right) is used to display a copy of the main editor (split screen editing) or a completely different procedure (dual view editing).
In addition to displaying procedures from the Procedure Library, external files may be opened in the source code editors, modified, and then saved to disk. This same capability can be used to save edited procedures to other files.
Pressing "Display" (leftmost button on the toolbar) will toggle through 3 displays:
When the Start/Exclude folder lists are shown, the context menu for each list can be used to add or remove folders from each list.
Minimal Toolbar
A minimal toolbar mode is available which removes several toolbar buttons, placing them
on dropdown menus. This significantly reduces the width of the gbProcedureLibrary interface.
Toolbar Without Text
When first using gbProcedureLibrary users may find the text labels on the toolbar
buttons useful. But displaying the text significantly increases the width of the
toolbar. For users who no longer need the text labels, they may be removed:
Optional Source Code Editor
By default gbProcedureLibrary displays a single source editor, whose content is
generated when the user clicks on a procedure in either the Main or Results list.
A second, optional source code editor may also be displayed. It is used for split
screen viewing of the Main procedure, to view a second procedure, or simply to view
an external source code file.
Start/Exclude Folders
The area where the Main/Results lists are shown can also be used to display the list of
Start Folders and Exclude folders. A dropdown menu item is available to toggle display
of the Main/Results and Start Folders/Exclude Folders pairs of lists.
List Views
When the Main/Results lists are shown, the user can toggle whether one, or both, of the lists
are displayed. This provides the user as much screen area as possible to view the targeted
list.
Hidden Lists
All lists (Main, Result, Include and Exclude) may be hidden from view, allowing the entire
area of gbProcedureLibrary to be used for source code editing.
Syntax Highlighting
Colors are used to distinguish keywords, strings, and comments from the rest
of the snippet content. User may select all highlighting colors.
The list of PowerBASIC keywords is kept in the file keywords.txt in the support_files subfolder. That file may be edited as desired.
Unlimited Undo/Redo
The text editor supports undo/redo actions, limited only by the amount of memory
available on your PC. Undo/redo actions are taken by pressing the appropriate toolbar
button. If an action is not available, the toolbar button will be grayed out.
Code Formatting
gbProcedureLibrary can apply indentation to code, according to settings made by
the user. Settings are available for managing how blank lines, comments, indentation
and TABs are handled during formatting.
Before And After Formatting:
Brace Highlighting
This feature highlights the matching parenthesis, ( or ), when the cursor is placed
in front one of the character. An alternate highlighting is also applied if no matching
parenthesis is found.
Indentation Guidelines
The code editor can display vertical lines that correspond to a standard indentation,
which by default is 3 spaces. The vertical lines can help you align code, or it can
help you scan code to find starting and ending lines of code pairs, such as If/End If.
Greenbar Effect
In the early days of computing, source code was printed on wide paper whose
lines were alternately given white and green background colors. The alternating
background colors made it easier for the eye to track across lines of code.
The greenbar display provides a similar effect by alternating (every 3 lines) between white and gray line backgrounds.
AutoIndentation
When the user presses enter, the cursor will be placed at the same level of indentation
as the line where enter was pressed. However, if the line begins with one of several
code constructs, indentation will be made one level lower than the current line.
Code constructs which result in extra indentation include:
If For Else Do Select Loop Case While
Call Tips
When a PowerBASIC function is typed in by the user, the text editor can display
a popup label containing a list of the arguments allowed by the function.
Some examples of call tips are shown in the image to the right.
When the popup label is displayed, the user continues typing, filling in the argument list per the displayed syntax. Pressing a space bar will remove the display.
If the user enables Persistent Call Tips. the keyword sequence and the call tip text are displayed permanently in the StatusBar, until the user takes another action which reports status to the StatusBar.
The user may modify the list of recognized functions and the corresponding argument syntax/list that is displayed. See the three files words1.txt, words2.txt, and words3.txt in the support_files subfolder for more information.
Persistent Call Tips
Places a copy of the Call Tip into the StatusBar that persists even when the
Call Tip disappears from the screen.
AutoCompletion
PowerBASIC keywords are often used in combination with one another, such as
"Control Add" or "Thread Get Priority". When the user types in a PowerBASIC
keyword that is part of a combination, a popup list of allowed keywords
needed to finish the combination, is displayed. The user can select from
that list (press TAB) or simply continue typing.
The user may modify the list of recognized keyword combinations. See the two files members1.txt and members2.txt in the support_files subfolder for more information.
Code Folding
When reviewing code it can be convenient to hide the code within procedures and
other code constructs. This is called folding and is demonstrated in the image below.
Code constructs may be folded by clicking on the minus symbol in the margin,
or unfolded by clicking on the plus symbol in the margin. The toolbar provides buttons
for folding/unfolding all constructs in a snippet.
The code constructs which gbProcedureLibrary recognizes are:
Type End Type Class End Class Macro End Macro Interface End Interface Sub End Sub Method End Method Function End Function Property End Property Callback End Function Union End Union
In general, folding can also be applied to lesser structures, such as Select/End Select, but that level of folding is not currently supported by gbProcedureLibrary.
Open Help to Highlighted Word
Once a word is selected, the PowerBASIC Help file may be opened to the corresponding
Help file topic.
Line Numbers
The text editor supports the display of line numbers, contained in a left margin that
is separate from the text.
Active Links
gbProcedureLibrary supports hypertext links. Just as in a browser, the links are highlighted
and underlined, needing only to be clicked to open the link location. Simply type
in an HTTP address and click on the link to open the URL in your default browser.
Here's a description of the functions provided by the toolbar.
Library | Displays the Procedure Library and Search controls | |
View | Toggles display of the Main, Results, or Main+Results lists | |
New | Creates a new, empty library | |
Open | Open an existing library | |
SaveAs | Saves the current library to a new file | |
Folder | Selects the start folder for a build | |
Build | Builds a new library | |
Build | Cancels any active procedure library build | |
Cancel Search | Search the Main list for procedures matching the search criteria | |
Single View | Displays only the Left editor | |
Split Screen | Displays both editors, with the same procedure in each editor. Changes to one editor are reflected in the other. | |
Dual View | Displays both editors, with a different procedure in each editor. | |
Undo | Removes the latest change made in the text editor | |
Redo | Reverses the last Undo action. | |
Fold | Folds all procedures in the procedure's Compilable Example | |
UnFold | UnFolds all procedures in the procedure's Compilable Example | |
Indent | Indent the selected lines | |
Outdent | Un-indent (outdent) the selected lines | |
Comment | Comment the selected lines | |
UnComment | UnComment the selected lines | |
Open In IDE | Opens snippet's Compilable Example (uses default BAS editor) | |
Prints the content of the Left editor | ||
Settings | Displays summary information about the Procedure Library and gbProcedureLibrary settings | |
Help | Opens this online Help page |
Build Procedure Library
Build - Select Structures
Search
Searches can be made on any combination of the Main list columns, as well as
including the full content of procedures. Just select the column names and/or "content"
to include the properties in a search.
Additionally, there are 3 Reports which allow the user to retrieve procedure lists in way not possible when using the standard search.
Edit
This button is shown only when the minimal toolbar is shown. It contains the
editing functions which are hidden with the minimal toolbar.
Open in IDE
Settings
Settings - Editor
These includes individual settings plus four second level menu groups:
Settings - Colors
Settings - Code Case
These set the code case that will be used with syntax highlighting:
Settings - Formatting
These are used to control various aspects of formatting source code:
Settings - Columns
Check the columns you wish see in the Main and Results lists. The columns are not
removed, just set to zero width.
Help
Main ListView (Entire Procedure Library)
Results ListView (Search, Unique, Bookmarks or ASM Procedures)
Source Code Editors