|
General
The general purpose of PBL Peeper is to view, analyze and manipulate the exports of
PowerBuilder objects. This was built as a tool for PowerBuilder developers. Its features have
been driven by my requirements to do my work as a PowerBuilder consultant. I’ve released it
with the hope that it will help other PowerBuilder developers complete their work more
effectively.
Warnings
Important: PBL Peeper is provided as is. No guarantees or warrantees accompany
it. Users of this tool accept responsibility for any damage it does to their source code
and/or computer system and any other potential impacts. Users should be aware that
parts of the tool are intended to modify and/or create source code and/or other files
on the computer system. Computer systems and connected devices should be backed
up before using this tool.
Historically, a version of PBL Peeper was tied to a specific version of PowerBuilder. As of PBL
Peeper v4, that tie no longer exists. Efforts have been made to not only be compatible with all
past versions of PowerBuilder, but also with future versions of PowerBuilder. Compatibility with
Pocket PowerBuilder, PocketBuilder and DataWindow.NET also exists.
Step By Step Quick Start Tutorial
• Launch PBL Peeper.
• Expand the Workspaces item below PowerBuilder X Apps, then expand the first
workspace beneath this and select the first target in this workspace. This is your current
application. Current is defined as the last target that was run within the current
workspace. Drag it over to the listview on the right. The PBLs in your application appear
on the right and all the tabpages become enabled.
• Select the Find page.
• In the field labeled Containing:, type
update
• Beneath this:
• select Character By Character
• ensure Case Insensitive is checked.
• ensure Whole Word Only is checked.
• uncheck Include Quotes
• uncheck Include Comments
• From the menu, select Edit / Add Row.
• In the new row, in the field labeled Containing:, type
commit
• Beneath this:
• select Character By Character
• ensure Case Insensitive is checked.
• ensure Whole Word Only is checked.
• uncheck Include Quotes
• uncheck Include Comments
• In the bottom portion of the Find Page:
• check Context Lines and make the corresponding value 0
• set Portion Types to Scripts
• set Page Breaks to None
• uncheck DataWindow Output
• check Bold Matches
• Press the toolbar button for Go (with the VCR style play icon).
• Review the list of places where your application does updates and commits.
• Close the results page and return to the Find Page.
• On the Find Page, check the DataWindow Output and press Go, repeating the search
• Select a row on the output
• Find the button on the toolbar with the same icon os the Browse Page, and click it (or
press Ctrl-Shift-B) to be moved to the Browse Page, looking at the same script as the
matched item.
• Press Ctrl-Q (also the binoculars with the lightening bolt on the toolbar) to activate
QuickFind, and enter the first few characters in a DataWindow name. Press Enter.
• From the menu, select View / Expand.
• Select a DataWindow column within this DataWindow and see the object’s attributes in
the right panel.
• Find a window and drill down to select a script.
• Click into the right panel, noticing the available toolbar buttons changing.
• Press Ctrl-Shift-G and enter a line number to select.
• Select a script you know has an ancestor; when you do, the button with the up arrow in
the lower right will appear enabled.
• Press the up arrow button to view the ancestor; notice the change in position in the
treeview on the left.
• Press the down arrow to return to the original script.
• Press the Print icon.
• Select Print Object’s / Portion’s Contents from the supplied list.
• In the Scripts/Variables section of the Print Options Dialog, check the Print
Ancestors option, select the Rich Text Output, and press OK.
User Interface Clues
There are some general principles to the user interface that help in navigating around the tool:
• Watch for microhelp to determine the purpose of a given control. Microhelp is dependent
on the control which has focus.
• Watch for enabled/disabled menu and toolbar items to identify available functionality.
Menu and toolbar items are enabled/disabled depending on which control has focus.
• Watch the stop/go light on the microhelp bar to watch for process completion.
• There is not usually an opportunity to cancel a process once it is started.
• Watch the progress meter for process progress.
Universal Control Behaviour
Several controls have functionality that is consistent throughout the tool. This functionality is
documented here only.
General
New
|
Opens a new sheet. Options are:
• PBL Peeper sheet
• PSR Viewer
• RTF Viewer
|
Close
|
Closes the current sheet.
|
Exit
|
Closes PBL Peeper.
|
Refresh App [Ctrl-Shift-R]
|
PBL Peeper parses apart object syntax, and caches the offsets
of parts of each object to improve performance when
subsequently using that object. It also caches relationships
between objects. When objects are changed in PowerBuilder
after the object is indexed, PBL Peeper will fail to recognize
the change and will make mistakes processing that object.
When an object changes, you have the option of refreshing the
indexing in the entire application.
|
Go [Ctrl-G]
|
Initiates action on the current sheet and tab page.
|
Browser [Ctrl-Shift-B]
|
Switches to the Browse page, moving to the current item if
one can be identified on the current page.
|
Object Filter
|
Allows a definition of a subset of objects within the application
to be processed. This definition is with a DataWindow filter
expression. Fields available for the filter are the same as
initially available from the Object List. When an object filter
is active, the menu item will be checked and the toolbar button
will be depressed. Not all functionality is sensitive to the
Object Filter.
|
Preferences
|
Opens a window to set user preferences that determine the
behaviour of PBL Peeper.
|
File/Directory fields
|
Accept drag and drop from Windows Explorer.
|
Documentation
|
Launches Adobe Acrobat with the PBL Peeper documentation.
|
Option selection
|
Most options are saved between runs of PBL Peeper, so they
are persistent.
|
Microhelp
Line Number
|
Where appropriate (e.g. a script viewer), indicates the line
number, row number or page number.
|
Progress
|
Indicates current task progress as an estimated percentage.
(This does not necessarily represent a percentage of actual time
for task completion.)
|
Busy Indicator
|
Shows a red light when PBL Peeper is busy. Shows a green
light at other times.
|
Treeview
Copy [Ctrl-C]
|
Copies the text of the currently selected treeview item onto the
clipboard.
|
Expand
|
Expands the sub-tree of the currently selected item, including
all contained sub-trees.
|
Collapse
|
Collapse every expanded treeview item in the treeview,
returning the treeview to its original state.
|
Up
|
Move up one level in the treeview to the currently selected
item’s parent.
|
Back
Forward
|
A history of movements among treeview items is maintained.
These move back and forward along this history list in the
same way these work in an Internet browser.
|
QuickFind
|
An edit field opens in the upper right corner of the treeview.
Based on what is typed in this field, current selection moves to
an already populated treeview item that matches the entered
string. The search looks through labels with the following
priority:
• exact match
• prefix match
• substring match
Pressing Enter or losing focus from the edit field will leave
focus on the found item. Pressing Esc will return to the original
treeview item.
|
First
|
Moves to and selects the first item in the tree.
|
Prior
|
Moves to and selects the previous item in the tree.
|
Next
|
Moves to and selects the next item in the tree.
|
Last
|
Moves to and selects the last item in the tree.
|
Save As
|
Saves the visible portion of the treeview to an text file, with
tabs indenting the levels.
|
Enter
|
Expands/collapses current selection.
|
Listview
Clear
|
Deletes all items in the listview.
|
Select All [Ctrl-A]
|
Selects all items in the listview.
|
Headings
|
Click on listview heading to sort by that data element.
|
Script/Portion Viewer
Save As
|
Saves the script/portion as a file.
|
Copy [Ctrl-C]
|
Copies the selected part of the script or portion to the clipboard
|
Select All [Ctrl-A]
|
Selects all of the script or portion
|
Find [Ctrl-F]
|
Finds a string in the script/portion.
|
Find Next [F3]
|
Resumes the previous find from the current position using the
previous settings.
|
Go To Line [Ctrl-Shift-G]
|
Moves to and selects a specified line.
|
Wrap text
|
Wraps the displayed text to the size of the viewer.
|
DataWindow
Save As
|
Saves DataWindow data contents to file.
|
Import
|
Imports a previously saved set of data into the current
DataWindow (only DataWindows used for data entry).
|
Save Syntax
|
Saves the current DataWindow syntax to a file so that the
DataWindow can be reproduced and saved DataWindow
contents can be imported. Note that some commands change
the structure of the DataWindow, so a saved syntax from a
DataWindow may not be able to import all data exported from
that DataWindow at other times.
|
Print [Ctrl-P]
|
Prints DataWindow contents.
|
Print Preview
|
Toggles the print preview mode of the DataWindow.
|
Page Setup
|
Displays the page setup dialog to select settings for printing.
|
Undo [Ctrl-Z]
|
Reverses the last data editing, when applicable.
|
Cut [Ctrl-X]
|
Cuts the currently selected text or data to the clipboard.
|
Copy [Ctrl-C]
|
Copies the currently selected text or data to the clipboard.
|
Paste [Ctrl-V]
|
Pastes into the current field.
|
Clear
|
Removes selected text from the current field.
|
Select All [Ctrl-A]
|
Selects all the text in the current field.
|
Back
Forward
|
A history of movements among rows is maintained. These
move back and forward along this history list in the same way
these work in an Internet browser.
|
QuickFind
|
An edit field opens over the header above the column that
currently has focus. Based on what is typed in this field, current
selection moves to the first row where that column matches the
entered string. The search looks with the following priority:
• exact match
• prefix match
• substring match
Pressing Enter or losing focus from the edit field will leave
focus on the found row. Pressing Esc will return to the original
row.
|
QuickFilter
|
A filter is created based on the current column and the value in
it. For example, if a row on the Object List is selected with the
cursor in the Type column, QuickFilter might create a filter
“type=’window’”.
|
Go To Line [Ctrl-Shift-G]
|
Prompts for a row number, and scrolls to the entered row.
|
Zoom
|
Magnification control.
|
Headings
|
Click on DataWindow heading to sort by that data element.
(While not always implemented, it is usually implemented in
grid DataWindows with 3D raised borders on the headings.)
|
Rich Text Window
Save As
|
Saves rich text window contents to file as either text or rich
text, depending on the file extension.
|
Print [Ctrl-P]
|
Prints the rich text window contents.
|
Print Preview
|
Displays a preview of the print.
|
Undo [Ctrl-Z]
|
Reverses the last data editing, when applicable.
|
Cut [Ctrl-X]
|
Cuts the currently selected text or data to the clipboard.
|
Copy [Ctrl-C]
|
Copies the currently selected text or data to the clipboard.
|
Paste [Ctrl-V]
|
Pastes into the document.
|
Clear
|
Removes selected text from the document.
|
Select All [Ctrl-A]
|
Selects all the text in the document.
|
Find [Ctrl-F]
|
Finds a string in the rich text window contents.
|
Find Next [F3]
|
Resumes the previous find from the current position using the
previous settings.
|
First
|
Moves to the first page.
|
Prior
|
Moves to the previous page.
|
Next
|
Moves to the next page.
|
Last
|
Moves to the last page.
|
Technical Information
With the exception of a DLL for some string functions written in C for performance, the
application is entirely written in PowerBuilder, using native PowerBuilder controls. A COM
object built in PowerBuilder 9 is deployed to handle reading of ANSI/DBCS PBLs. PBL Peeper
was built using PowerBuilder Foundation Classes as the cornerstone
Acknowledgments
Tony Cook has supplied C code for string parsing. This has speeded some processes up
significantly. Roy Kiesler has also helped me through C code issues and has been a source for
much WinAPI information.
|