" is automatically assigned by
gbCodeDropper.
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.
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.
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.
Toolbar (Optional)
gbCodeDropper does provide an optional toolbar for access to frequently used settings
and actions. But by default, the toolbar is not displayed.
Here are descriptions of the functions provided by each of the toolbar buttons:
New
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.
Delete
The currently selected procedure is deleted. Confirmation is requested. If multiple
selections are made (List views only), only the first selection will be deleted.
Once selections are made, the filechanges flag is set and the user will be asked to
save the changes when gbCodeDropper is closed.
Title
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.
Copy
Immediately copies the entire selected procedure(s) to the clipboard.
Target
Immediately pastes the entire procedure to the edit window of the target application
(PB/Win by default).
IDE
Immediately saves the procedure to a temporary file and then opens that file in the
default *.bas editor.
Search
Opens the Search dialog.
Preview
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.
Display
Toggles between the three displays modes: Simple List, Category List, and Treeview.
UserLib
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.
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
Opens the font selection dialog.
Settings
Opens the settings dialog.
Help
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:
Copy
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.
Paste in Target
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.
Open in IDE
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.
Search
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.
A Search always includes the full library of procedures. Additional
searches do not search within the results of a previous search.
Procedures
Opens a sub-menu with the following actions which may be taken with respect to
procedures:
- Print
prints the selected procedure
- Edit Title
edits only the title of the selected procedure
- New
adds a new, blank procedure, positioned under the currently selected procedure
- Delete
deletes the selected procedure (confirmation is not requested)
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
Opens a sub-menu with the following actions which may be taken on the procedure
library:
- Summary
displays a summary of the procedures in the library
- Print Title List
prints a list of all titles in the library
- Sort
sorts the library in category/title order (case insensitive)
- Save
saves all library changes to the library file
- Backup
backs up the library to a *.bak file
- Restore
restores the library from the *.bak file
- Edit External
opens the procedures.bas file in the default external editor
Preview Pane
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.
User Library
Toggles the display between the user and default libraries.
Toolbar
Toggles display of the tooblar.
Cycl Display Modes
Cycles through the Simple List, Category List, and TreeView modes.
Expand All Nodesr
In TreeView mode, expands all parent nodes.
Settings
Presents a dialog for changing other gbCodeDropper settings. See the Settings section
below for more details.
Online Updates
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.
Online Help
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:
Cut
Removes the selected text and places the text on the clipboard
Copy
Copies selected text to the clipboard
Copy All
Copies all text from the Preview Pane to the clipboard (does not selected the text)
Paste
Pastes text into the Preview Pane as the caret. This does not change the procedure
library text.
Delete
Deletes the selected text from the Preview Pane, but does not delete the text from the procedure library.
Print
Prints the currently selected procedure(s), including the title(s)
Save As (To File)
Saves the content of the Preview Pane to a file designated by
the user.
Indent Code
Applies smart indentation to the code in the Preview Pane
UnIndent Code
Restores the procedure code to the pre-indented content.
Settings
Most settings are accessed through the Settings Dialog, shown here:
Procedure Action
This determines what action is taken when the user double-clicks on an
item in the procedure list:
- Clipboard
selected procedure is copied to the clipboard
- PB/Win
selected procedure is inserted into the target application
- IDE As File
selected procedure is saved, then opened in the default *.bas editor
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
Once a procedure action has been taken, the application itself can respond with any
of five different actions:
item in the procedure list:
- Close
gbCodeDropper shuts down
- Minimize
gbCodeDropper minimizes to the Windows Taskbar
- Rollup
gbCodeDropper "rolls up", meaning the client area is set to zero
- System Tray
gbCodeDropper moves to the system tray
- No Change
no action is taken
Enable Hotkey (Ctrl-D)
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.
Preview via Caption
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).
Double-clicking on the caption never results in maximizing the gbCodeDropper screen.
System Tray
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.
Right-mouse clicking on the gbCodeDropper icon will popup a context menu, with a menu
selection for exiting gbCodeDropper.
Font
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.
Syntax Highlighting
When text is displayed in the preview pane, syntax highlighting may optionally
be applied to the text.
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
Syntax highlighting capitalizes key words in one of three ways:
- Upper
upper case
- Lower
lower case
- Mixed
exactly as entered in the powerbasic.syn text file
Colors
Syntax highlighting colors sections of code as one of three colors:
- Keyword
words found in the powerbasic.syn file use this color
- Quote
text enclose by double quotation marks use this color
- Comment
text following a ' or on lines starting with REM use this color
These colors are shown as the three label colors. Click on a colored label to
change the corresponding syntax highlighting color.
Formatting
When the menu "Indent" action is take, three values are used to determine
formatting of the indented code:
- Indentation
number of spaces per level of indentation
- Max Blank Lines
maximum number of contiguous blank lines allowed
- Exact Header
exact number of blank lines placed before each procedure
Saving Settings Changes
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.
The line after :::start contains the procedure title and is the text
shown in the procedure list
:::start
.IDE Template
'Compilable Example:
#Compile Exe
#Dim All
#Include "Win32API.inc"
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.
Accelerator Keys
These accelerator keys are supported:
- F1 - Online Help
- F3 - Search
- Ctl-D - Toggles debug mode
- Ctl-F - Toggle syntax highlighting through upper, lower, mixed case formatting
- Ctl-I - Display an Ascii code table
- Ctl-L - Prints the full list of procedure titles
- Ctl-P - Prints the selected procedure
- Ctl-R - Sizes the gbCodeDropper dialog to fit the content of the procedure list
- Ctl-S - Save procedures (confirmation required)
- Ctl-T - Allows the user to edit the target caption setting
- Ctl-V - Toggles display of the preview pane
Support Files
The following files are found in the Files subfolder where gbCodeDropper is
installed.
procedures.bas
This file contains the procedures displayed by gbCodeDropper
powerbasic.syn
This file contains the keywords highlighted when syntax highlighting is enabled.
Words in this file should we capitalized as Mixed case.
gbsynaxhighlight.inc
This include file is compiled within the gbCodeDropper application. It provides
the syntax highlighting feature.
gbcodeindent.inc
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:
gbcodedropper_temp.bas
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.
ptitles.txt
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
Here are the titles of the procedures currently in the gbCodeDropper procedure
library. The latest version is v1.0.
- .IDE Template
- Compiler Directives
- Elapsed Time
- CPrint
- Clear Console
- TextBox Style
- Open Help-Email-URL
- CallBack Template
- SubClass a Control
- Browse For Folder
- Browse For Color
- Browse For File
- Confirm Overwrite
- File Changed On Exit
- Open In DOS/Window/Explorer
- Text File To Array
- Text File To String
- MouseWheel
- Speech Synthesis (Read Text)
- Remove Double Spaces
- Special Folders
Comments
Comments and suggestions are welcome!