gbCodeDropper is an easy-to-use application whose main purpose is to allow a user to quickly select source code from its built-in library and place that code onto the clipboard, into a target application (such as the PBWin IDE), or into a file to be opened by the user's default source code editor. Once the code action is completed, gbCodeDropper can be configured to take an additional action, such as closing, minimizing, or dropping to the system tray.
Download (v1.0, 49K) While the primary role of gbCodeDropper is to "grab-and-close" with code, it also provides a variety of ways to view, edit, search and otherwise manage it's built-in source code library. In particular, a procedure source code preview pane, with syntax highlighting, is provided. Additionally, a library of frequently used PowerBASIC procedures is included in the gbCodeDropper installation. Updates to the library will be made periodically and may be downloaded separately from online updates of the gbCodeDropper application. |
These, and other gbCodeDropper features are discussed in the following sections.
Even though gbCodeDropper defaults to the simplest possible interface options, the images above shows that gbCodeDropper can be configured to display as few, or as many, features as desiried, including a toolbar and procedure preview pane.
The multiple display options are provided to enable the user to work with gbCodeDropper in the most efficient manner. For example, if the main use of gbCodeDropper is to copy code into an IDE, the simple List interface may be most useful. But if the user prefers browsing the code library by category and likes the ready-at-hand toolbar, then the TreeView with toolbar options might be enabled.
The point is that gbCodeDropper allows users to arrange the display to suit their own viewing preferences.
gbCodeDropper was written to provide a particularly fast way of accessing frequently used library code. The term procedure is used in this help file to describe the code in each gbCodeDropper source code library entry. That code can be a simple code fragment, a compilable code example, or just simple text of any kind.
gbCodeDropper's big brother, gbSnippets , is a full-fledged code librarian with a large number of editing, searching, formatting, exporting and compilation features, along with a large library of over 1200+ source code snippets. It's extremely useful, but getting in and out of the application, finding specific code, and then using that code can take more time than someone in a hurry might wish. Hence, gbCodeDropper - a faster way to get to your most important code!
gbCodeDropper GUI
The default GUI of gbCodeDropper reflects the quick and easy theme - it's just a single ListBox
on a dialog. Nothing else. No menu, no toolbar, no statusbar, no other control of any
kind. Open gbCodeDropper and double-click the code of choice to put the code on the
clipboard and gbCodeDropper will automatically close. That's all you do. Then you're free
to use the code that was placed on the clipboard in any way you choose.
As you have seen, however, the GUI content can be significantly enhanced with optional elements to fit the user's specific work environment needs.
Using a Procedure
By default, double-clicking on a procedure title will place the procedure on the clipboard.
In addition, gbCodeDropper can be configured instead to save the procedure to a temporary
*.bas file, and then open that file in the default *.bas editor (such as the PowerBASIC IDE).
gbCodeDropper may also be configured to paste a procedure in any open application of choice. By default, the paste action is directed to the PB/Win IDE.
Procedure Preview Pane
The title of each procedure is intended to clarify what code will be placed on the
clipboard. But for closer review, the complete procedure may be viewed and edited in
a Preview Pane. Syntax highlighting may optionally be applied to the procedure source code.
More information on adding/deleting/editing procedures is provided further down this page.
Multiple Selections
In both List views multiple items may be selected. The Copy to Clipboard, Paste in
Target and Open in IDE actions will act on all selected procedures. The Delete action,
however, will act only on the first selected item.
In TreeView mode, only one procedure may be selected at a time.
The three actions can also be called by pressing the corresponding actions on the (optional) toolbar or by selecting an action from the list context menu.
Only one level of category is supported. Sub-categories of a category are not supported.
As with the Simple List mode, double-clicking on a procedure in the list performs one of three actions, as set by the user:
The three actions can also be called by pressing the corresponding actions on the (optional) toolbar or by selecting an action from the list context menu.
When TreeView mode is displayed, it automatically detects all available categories and creates the parent nodes in the tree. Empty parent nodes are not allowed. The user can create a new category only by adding a new procedure with a new category.
When TreeView display mode is first displayed, category nodes (not procedure nodes) are displayed in sorted order. New procedures may be added which are out of sort order, but will be sorted when the TreeView mode is next displayed. Or, the user can sort the Tree at any time using the Sort menu option.
As with the Simple/Category List modes, double-clicking on a procedure in the list performs one of three actions, as set by the user:
The three actions can also be called by pressing the corresponding actions on the (optional) toolbar or by selecting an action from the list context menu.
By default, double-clicking on the gbCodeDropper caption toggles display of the preview pane. The Preview Pane can also be dislayed by clicking on the appropriate toolbar button or by making the appropriate setting in the Settings dialog.
The gbCodeDropper Edit dialog allows the user to edit both the procedure category and title in the same operation. Simply enter the category followed by ":::" and then the procedure title.
Categories are optional, but if not provided then "
In Simple List mode, the edited category is saved but not displayed.
In Category List mode, the edited category is saved and displayed in the same position
as the procedure being edited.
In TreeView mode, if the category is changed gbCodeDropper will rebuild the display
to include the new category, positioned in alphabetical order.
In any display mode, the user can, at any time, sort the library to reorder the
procedures. Sorting is done by category then title.
When switching to TreeView mode, however, procedure categories are always displayed
in sorted order. Procedures themselves are presented within a category in the same
order as they are found in the library. This means that whereever a user places a new
procedure, it remains in that same location unless the user uses the menu Sort option
to rearrange the procedures.
Even though the TreeView mode displays categories in sorted order, the procedures in
the library are not sorted.
In all display modes, when a new procedure is added it is always placed immediately
following the currently selected procedure.
Here are descriptions of the functions provided by each of the toolbar buttons:
New
Delete
Once selections are made, the filechanges flag is set and the user will be asked to
save the changes when gbCodeDropper is closed.
Title
Copy
Target
IDE
Search
Preview
Display
UserLib
Using the User Library is not required, but does provide the user flexibility in
building/using an additional library for whatever purpose they choose. One use would
be to contain the user's personal procedures, while leaving the default library
intact. That would allow the user to download online updates to the default library
without having to worry about overwriting procedures of their own which they might
have added to the default library.
Font
Settings
Help
Copy
Paste in Target
Open in IDE
Search
A Search always includes the full library of procedures. Additional
searches do not search within the results of a previous search.
Procedures
After making changes to a procedure, the user may save those changes. If there are
any unsaved changes when a user attempts to leave gbCodeDropper, the user will be prompted
to save those changes (unless the AutoSave feature is enabled, in which case changes
will be automatically saved without confirmation by the user.
Library
Preview Pane
User Library
Toolbar
Cycl Display Modes
Expand All Nodesr
Settings
Online Updates
Online Help
Cut
Copy
Copy All
Paste
Delete
Print
Save As (To File)
Indent Code
UnIndent Code
Procedure Action
The default target application is the PB/Win IDE. The default target application
may be changed using the Ctrl-T accelerator key combination. A target is identified
by the application's caption.
App Action
Enable Hotkey (Ctrl-D)
Preview via Caption
Double-clicking on the caption never results in maximizing the gbCodeDropper screen.
System Tray
Right-mouse clicking on the gbCodeDropper icon will popup a context menu, with a menu
selection for exiting gbCodeDropper.
Font
Syntax Highlighting
In the Files subfolder, where gbCodeDropper is installed, is a text file called
powerbasic.syn. It is used to store the keywords that are highlighted (colored blue)
when syntax highlighting is turned on. The words in the list are capitalized according
to the Mixed case option (see below).
Code Case
Colors
These colors are shown as the three label colors. Click on a colored label to
change the corresponding syntax highlighting color.
Formatting
Saving Settings Changes
The line after :::start contains the procedure title and is the text
shown in the procedure list
All lines following the procedure title, until the next :::start or
end of file is reach, are part of the library procedure. There is no
limit to the number of lines a procedure may have.
procedures.bas
powerbasic.syn
gbsynaxhighlight.inc
gbcodeindent.inc
gbcodedropper_temp.bas
ptitles.txt
Here are the titles of the procedures currently in the gbCodeDropper procedure
library. The latest version is v1.0.
Comments and suggestions are welcome!
Procedure Display Order
In both List modes (Simple and Category) the procedures are simply listed in the
order in which they are found in the library. The user may sort the list via menu
commands, but as new procedures are added the list is not automatically sorted.
Toolbar (Optional)
gbCodeDropper does provide an optional toolbar for access to frequently used settings
and actions. But by default, the toolbar is not displayed.
Creates a new procedure. The new procedure is given the same category as the
currently selected procedure and is placed immediately beneath the currently
selected procedure.
The currently selected procedure is deleted. Confirmation is requested. If multiple
selections are made (List views only), only the first selection will be deleted.
Edits the category and title of the selected procedure. See the section above for
additional information on editing the title and category of a procedure.
Immediately copies the entire selected procedure(s) to the clipboard.
Immediately pastes the entire procedure to the edit window of the target application
(PB/Win by default).
Immediately saves the procedure to a temporary file and then opens that file in the
default *.bas editor.
Opens the Search dialog.
Toggles the display of the preview pane. By default, you can also toggle display
of the preview pane by double-clicking on the gbCodeDropper caption.
Toggles between the three displays modes: Simple List, Category List, and Treeview.
gbCodeLib supports two separate source code libraries, the default library and
a user library. The default library is distributed with gbCodeDropper. Updates
are available online.
Opens the font selection dialog.
Opens the settings dialog.
Opens this online Help page.
Context Menu (Procedure List)
Right-clicking on the procedure list will display the following context menu:
The following context menu options are provided:
Immediately copies the entire procedure to the clipboard. This does not change
the setting for an action to take when a procedure title is double-clicked.
Immediately pastes the entire procedure to the edit window of the target application
(PB/Win by default). This does not change the setting for an action to take when a
procedure title is double-clicked. The menu always reflects the chosen application
caption.
This menu option tells gbCodeDropper to immediately place the procedure
in a temporary file and then open that file in the default *.bas editor.
This does not change the setting for an action to take when a procedure
title is double-clicked.
Opens the Search dialog.
When a search finds procedures containing the search string, the
procedure list is replaced with the list of matching procedures.
Display of search results puts gbCodeDropper in a read-only mode,
where menu editing options are disabled.
Opens a sub-menu with the following actions which may be taken with respect to
procedures:
prints the selected procedure
edits only the title of the selected procedure
adds a new, blank procedure, positioned under the currently selected procedure
deletes the selected procedure (confirmation is not requested)
Opens a sub-menu with the following actions which may be taken on the procedure
library:
displays a summary of the procedures in the library
prints a list of all titles in the library
sorts the library in category/title order (case insensitive)
saves all library changes to the library file
backs up the library to a *.bak file
restores the library from the *.bak file
opens the procedures.bas file in the default external editor
Toggles the display of the preview pane. By default, you can also toggle display
of the preview pane by double-clicking on the gbCodeDropper caption.
Toggles the display between the user and default libraries.
Toggles display of the tooblar.
Cycles through the Simple List, Category List, and TreeView modes.
In TreeView mode, expands all parent nodes.
Presents a dialog for changing other gbCodeDropper settings. See the Settings section
below for more details.
This menu option provides to submenus - one to check for a new version of the
gbCodeDropper EXE and one to check for a new version of the default library.
If new versions are available, gbCodeDropper can download the updated files. If
a EXE is downloaded, gbCodeDropper must restart.
Opens this web page in the user's default browser.
Context Menu (Preview Pane)
Right-clicking on the Preview Pane will display the following context menu:
The following context menu options are provided:
Removes the selected text and places the text on the clipboard
Copies selected text to the clipboard
Copies all text from the Preview Pane to the clipboard (does not selected the text)
Pastes text into the Preview Pane as the caret. This does not change the procedure
library text.
Deletes the selected text from the Preview Pane, but does not delete the text from the procedure library.
Prints the currently selected procedure(s), including the title(s)
Saves the content of the Preview Pane to a file designated by
the user.
Applies smart indentation to the code in the Preview Pane
Restores the procedure code to the pre-indented content.
Settings
Most settings are accessed through the Settings Dialog, shown here:
This determines what action is taken when the user double-clicks on an
item in the procedure list:
selected procedure is copied to the clipboard
selected procedure is inserted into the target application
selected procedure is saved, then opened in the default *.bas editor
Once a procedure action has been taken, the application itself can respond with any
of five different actions:
item in the procedure list:
gbCodeDropper shuts down
gbCodeDropper minimizes to the Windows Taskbar
gbCodeDropper "rolls up", meaning the client area is set to zero
gbCodeDropper moves to the system tray
no action is taken
A system level HotKey (Ctrl-D) may be assigned to gbCodeDropper. When gbCodeDropper
is in the system tray or minimized on the Windows Taskbar, the Hotkey restores gbCodeDropper
to its previous position.
When this option is selected, double-clicking on the gbCodeDropper caption will
toggle display of the preview pane. Otherwise, double-clicking on the caption will
rollup the gbCodeDropper window (set client area to zero height).
Select this option to have gbCodeDropper operate out of the system tray. When gbCodeDropper
is in the system tray, just double-click on its icon to restore it for use.
The font dialog used by gbCodeDropper is a modified version of the default Font
Dialog provided by the PowerBASIC Display Font statements.
The customized font dialog is smaller and removes some items normally found
on the default font dialog.
When text is displayed in the preview pane, syntax highlighting may optionally
be applied to the text.
Syntax highlighting capitalizes key words in one of three ways:
upper case
lower case
exactly as entered in the powerbasic.syn text file
Syntax highlighting colors sections of code as one of three colors:
words found in the powerbasic.syn file use this color
text enclose by double quotation marks use this color
text following a ' or on lines starting with REM use this color
When the menu "Indent" action is take, three values are used to determine
formatting of the indented code:
number of spaces per level of indentation
maximum number of contiguous blank lines allowed
exact number of blank lines placed before each procedure
Press the OK button (or use X to exit the settings dialog) to save any setting
changes. Press the Cancel button to ignore any setting changes.
Ascii Table
Here's an image of the popup Ascii table that appears when the "Ascii Table"
option is chosen from the Procedure List context menu.
The table is provided simply for convenience, as Ascii values are often used
in writing source code.
Popup Summary
At this time, the popup summary contains only two items - gbCodeDropper version number
and the library procedure count.
The content
of this popup is likely to grow in future revisions.
Edit in IDE
When configured to do so, gbCodeDropper will open a procedure in the default *.bas
editor, such as the PowerBASIC IDE shown in this image.
The procedure
is first saved to a temporary file and that file is opened in the default
*.bas editor.
Procedure File Format
The gbCodeDropper procedure library uses an extremely simple, text format.
Any line beginning with :::start is considered the start of a new
library procedure, as well as the end of any preceding procedure.
if one exists.
:::start
.IDE Template
'Compilable Example:
#Compile Exe
#Dim All
#Include "Win32API.inc"
Accelerator Keys
These accelerator keys are supported:
Support Files
The following files are found in the Files subfolder where gbCodeDropper is
installed.
This file contains the procedures displayed by gbCodeDropper
This file contains the keywords highlighted when syntax highlighting is enabled.
Words in this file should we capitalized as Mixed case.
This include file is compiled within the gbCodeDropper application. It provides
the syntax highlighting feature.
This include file is compiled within the gbCodeDropper application. It provides
the code indentation feature.
Temporary File/Folders
gbCodeDropper requires a subfolder "tempfiles". If that folder does not
exist, gbCodeDropper will create it. If created by gbCodeDropper, the following
two temporary files are placed in the tempfiles folder:
This files contains the procedure chosen to be opened in the
default *.bas editor. The file is overwritten each time a new procedure is
selected - double-clicked - and when gbCodeDropper is not configured to place
the selected procedure on the clipboard.
List of procedure titles. Created on demand and opened in Notepad.
Procedure Library
You can download the procedure file (procedures.bas) separately from updating the
gbCodeDropper EXE. Download the file
here.
the
Comments