home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 14
/
CD_ASCQ_14_0694.iso
/
news
/
4547
/
pgx122
/
ptg_ref.doc
< prev
next >
Wrap
Text File
|
1994-02-16
|
46KB
|
1,771 lines
▀▀▀▀▀ ▀ ▀▀▀▀▀
▀▀ ▀▀ ▀▄ ▀▀ ▀▀ ▀ ▀
▀▀▀▀▀▀ ▄▀ ▀▀▀ ▀▀▀▀ ▀▄▄▀ ▀ ▀ ▀
▀▀ ▀ ▀▀ ▀▀ ▀ ▀ ▀▀ 1.20
▀▀ ▀▀ ▀▀▀▀▀ ▀▀ ▀ ▀
(c) Copyright 1991, 1993 by Nederware, a dutch software company
Reference Guide
written by Berend de Boer
PtGen reference manual - page 1
TABLE OF CONTENTS
OBJECT APPLICATION . . . . . . . . . . . . . . . . . . . . . 1
Creating a new application . . . . . . . . . . . . . . . 1
Loading an application . . . . . . . . . . . . . . . . . 1
Application configuration . . . . . . . . . . . . . . . 1
Editing an application . . . . . . . . . . . . . . . . . 1
Saving an application . . . . . . . . . . . . . . . . . 2
OBJECT MENUBAR . . . . . . . . . . . . . . . . . . . . . . . 3
Creating a Line . . . . . . . . . . . . . . . . . . . . 3
Creating a Submenu . . . . . . . . . . . . . . . . . . . 3
Creating a Menu entry . . . . . . . . . . . . . . . . . 3
Editing menuitems . . . . . . . . . . . . . . . . . . . 3
Deleting menuitems . . . . . . . . . . . . . . . . . . . 3
Creating Links . . . . . . . . . . . . . . . . . . . . . 4
Deleting Links . . . . . . . . . . . . . . . . . . . . . 4
OBJECT STATUSLINE . . . . . . . . . . . . . . . . . . . . . . 5
OBJECT DESKTOP . . . . . . . . . . . . . . . . . . . . . . . 6
Desktop Local Menu . . . . . . . . . . . . . . . . . . . 6
COMMANDS . . . . . . . . . . . . . . . . . . . . . . . . . . 7
HELPTEXTS . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Helpconstants . . . . . . . . . . . . . . . . . . . . . 8
Statusline helptext . . . . . . . . . . . . . . . . . . 8
HelpWindow text . . . . . . . . . . . . . . . . . . . . 8
Help dialog box . . . . . . . . . . . . . . . . . . . . 9
OBJECTS DIALOG BOX . . . . . . . . . . . . . . . . . . . . . 10
Creating objects . . . . . . . . . . . . . . . . . . . . 10
Editing objects . . . . . . . . . . . . . . . . . . . . 10
Deleting objects . . . . . . . . . . . . . . . . . . . . 10
Cloning objects . . . . . . . . . . . . . . . . . . . . 10
OBJECT DIALOG BOX . . . . . . . . . . . . . . . . . . . . . . 11
The Dialog Local Menu . . . . . . . . . . . . . . . . . 11
Dialog settings . . . . . . . . . . . . . . . . . . . . 11
The Dialog subviews . . . . . . . . . . . . . . . . . . 11
Button . . . . . . . . . . . . . . . . . . . . . . 12
Static text . . . . . . . . . . . . . . . . . . . . 12
Label . . . . . . . . . . . . . . . . . . . . . . . 12
Inputline . . . . . . . . . . . . . . . . . . . . . 12
Memo . . . . . . . . . . . . . . . . . . . . . . . 13
Checkboxes . . . . . . . . . . . . . . . . . . . . 13
Radiobuttons . . . . . . . . . . . . . . . . . . . 13
Spinbuttons . . . . . . . . . . . . . . . . . . . . 13
ListViewer . . . . . . . . . . . . . . . . . . . . 13
PtGen reference manual - page i
Moving and Resizing subviews . . . . . . . . . . . . . . 14
Changing the Tab-order of the subviews . . . . . . . . . 14
Creating a record . . . . . . . . . . . . . . . . . . . 14
Code button . . . . . . . . . . . . . . . . . . . . . . 15
OBJECT POPUP . . . . . . . . . . . . . . . . . . . . . . . . 16
UNIT BBDLG . . . . . . . . . . . . . . . . . . . . . . . . . 17
UNIT BBERROR . . . . . . . . . . . . . . . . . . . . . . . . 18
UNIT BBFILE . . . . . . . . . . . . . . . . . . . . . . . . . 19
UNIT BBSTRRES . . . . . . . . . . . . . . . . . . . . . . . . 21
UNIT BBUTIL . . . . . . . . . . . . . . . . . . . . . . . . . 22
UNIT BBVALIDATE . . . . . . . . . . . . . . . . . . . . . . . 24
PTGEN TECHNICAL INFORMATION . . . . . . . . . . . . . . . . . 25
ERROR CODES . . . . . . . . . . . . . . . . . . . . . . . . . 26
INDEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
PtGen reference manual - page ii
OBJECT APPLICATION
PtGen is application oriented, that it: it assumes that you
develop complete applications with PtGen. Although it is possible
just to use the dialog box editing features alone, you won't take
full advantage of PtGen. This chapter discusses the application
object you create.
Creating a new application
If you want to create a new application, select File|New from the
menubar. The application configuration dialog box pops up. See
the section about Application configuration for further details.
Next you can edit your application.
Loading an application
Select File|Open to load a previous saved application. From the
File dialog box choose the file with the application you want to
load.
Application configuration
For every application you have to specify:
1. its name. PtGen will automatically prefix the name (and any
name) with a 'T'
2. the language to use: English or Dutch.
3. If it uses a helpfile and if yes, the name of the ascii
version of that helpfile. Do not specify the TVHC compiled
file, with extension .HLP, but the text file, usually .TXT.
4. If it uses the editor. If yes, than the commands from
EDITORS.PAS are added to the standard available commands
which can be used when creating menus. Added are:
cmNew
cmOpen
cmSave
cmSaveAs
cmPrint
5. If it uses the background printing unit.
Editing an application
Press Edit (Ctrl-F8) or select Edit from the menubar to edit your
application. You can now edit the menubar (see chapter Object
MenuBar) and statusline (see chapter Object Statusline) and
create various objects (see chapter Creating Objects).
After you have edited an application, pressing Alt-X brings you
PtGen reference manual - page 1
back in PtGen. You can now save your application, see chapter
Saving an application.
Saving an application
Select File|Save or File|Save as to save your application. If you
don't specify an extension, .PAS will be added.
PtGen reference manual - page 2
OBJECT MENUBAR
PtGen allows you to quickly define menuitems. The parameters you
can give to a menuitem are the same as the TMenuItem type, which
is described in the Turbo Vision manual plus some more. The
following sections describe the various menuitems you can create.
See the section Creating Links to read about linking an object to
a certain menuitem.
Creating a Line
Select the menubar and press Ins. Leave the popped up dialog box
blank and press Enter. A selectable line appears, indicating the
line your users will see.
The reason that you do not get the normal line as you would
expect is that such lines are not selectable so you won't be able
to delete such lines. When saving your application as source
code, PtGen puts this right.
Creating a Submenu
Select the menubar and press Ins. You create a submenu by only
specifying a Name and leave the Command and Param fields empty.
Helptexts can be defined. See chapter Helptexts for a full
explanation.
Creating a Menu entry
Select the menubar and press Ins. You must specify a Name and a
Command. The other fields can be empty. To a normal menuitem code
can be linked. This code will be executed when you select this
menuitem. This code is linked to the Command you specify. PtGen
will assign a unique value to every command you will create. This
is different from handcoding Turbo Vision applications. You don't
have to assign/remember values for your names nor be aware of
them. Just specify a name. You can specify helptexts if you want.
See chapter Helptexts for a full explanation.
Editing menuitems
All menu entries can be edited by selecting them and pressing
Edit (Ctrl-F8).
Deleting menuitems
All menu entries can be deleted by selecting them and pressing
PtGen reference manual - page 3
Del.
Creating Links
If you press Link (Ctrl-F9) the Objects Menu popups up. Select
the kind of object you want to link to this menuitem. This object
will be executed when this menuitem is selected. See the chapter
Objects Dialog box, section creating objects, for all the objects
you can link to a menuitem.
If you specified a new object (for example a Dialog box) you can
edit that object before returning to your menuitem.
Deleting Links
Pressing Link (Ctrl-F9) again will delete the link, but the
associated object is *not* deleted. To delete an object: see
chapter Object DeskTop, section DeskTop Local Menu.
PtGen reference manual - page 4
OBJECT STATUSLINE
Change the global statusline by pressing the DeskTop Local Menu
(Alt-F10) or just clicking on the background with the left mouse
button. Then select Statusline.
Mouse users:
Use the New, Edit and Delete buttons to insert, edit and delete
statusline items.
Keyboard users:
You can insert items by pressing Ins, delete items by pressing
Del and edit items by pressing Ctrl-F8.
PtGen reference manual - page 5
OBJECT DESKTOP
Desktop Local Menu
Pressing the mouse button when the mouse cursor is on the desktop
will popup the Desktop Local Menu. From this popup you can gain
acces to the statusline edit dialog box, the Objects Dialog box,
the helptexts menu and the Units Dialog box.
PtGen reference manual - page 6
COMMANDS
PtGen assigns numbers to the commands you specify when creating
or editing menuitems, statusbaritems and dialogbuttons. They
range from 2000..2999. Their number is not important and can
change. So refer not to the number but to the command itself as
usual in Turbo Vision programming.
PtGen reference manual - page 7
HELPTEXTS
Theere are three things of interest when discussing helptext
within PtGen:
1. hcConstant, the identifier name of a certain helptext
2. Statusline helptext, the text which will appear on the
statusline when this context is selected
3. HelpWindow text, the help text that will appear when you
press F1.
All three types of information are discussed below.
Helpconstants
PtGen assigns numbers to the helptexts you create. Numbers range
from 2000..2999. They are not static but change whenever needed.
If you have to refer to a helpconstant specify a name in the
hcConstant field. When PtGen writes the text file to be compiled
with TVHC, a proceeding 'hc' if any will be stripped, because
TVHC will output a .PAS file with the names you specify prefixed
with `hc'.
For menuitems the default hcConstant is equal to the specified
command except that the preceeding `cm' is replaced by 'hc'. So
if the command in your menuitem was cmFile the hcConstant will be
hcFile.
All hcConstants are listed in the interface section of the unit
PtGen creates.
Statusline helptext
All the helptext which you've specified are saved in the string
resource file STRINGS.TVR. The Hint method of the PtGen created
statusline object uses the current HelpCtx to search and displays
the text in STRINGS.TVR.
HelpWindow text
If you want to use HelpWindows you have enable the option in the
Options section of the Application settings dialog box. You can
change the settings of your application by selecting App from the
menubar. You also have to specify a helpfile which will be used
to save the HelpWindow text in.
This helpfile is a plain ascii text file, formatted in topics,
that you can edit yourself. You can even add text by hand to
this file although you might find the Help dialog box more
convenient to do this.
To convert the helptexts in this file to a .HLP file you need
TVHC, the helpfile compiler that came with your package.
PtGen reference manual - page 8
Help dialog box
The Help dialog box can be accessed by popping up the Desktop
Local Menu and selecting Helptext. The Helptext dialog box comes
up. You can now add, edit or delete helptexts. You can even
change the values PtGen has assigned although this is not
recommended. If you change a value to an already existing one,
your input is ignored.
If you delete a helptext that is used by PtGen (numbers
2000..2999) and that helptext is still used by a certain view be
aware that PtGen will complain about this when you for example
acces that view or write it to disk. Doing this is therefore not
recommended too.
PtGen reference manual - page 9
OBJECTS DIALOG BOX
The Objects Dialog Box appears when you select Objects from the
Desktop Local Menu. See chapter Object Desktop, section Local
Menu for how to popup the Desktop Local Menu.
From this dialog box you can create, edit, delete or clone
objects. All created objects will be shown in this dialog box.
Creating objects
You always create objects by selecting an object type from the
Available Objects Popup. This popup can appear in two ways: when
you press Link (Ctrl-F9) to link an object to a menuitem or
button, or when you press the New button from the Objects Dialog
Box. Anyway, all objects you create will appear in the Objects
Dialog Box where they are available for editing and deleting.
When the Available Objects Popup has appeared you can select
between predefined and user defined objects.
The predefined objects are: calculator, change directory dialog
box and editor. (REMARK: not all predefined objects may currently
be implemented or included).
The user defined objects are: dialog box and popup menu. See the
chapters Dialog box and Popup for details.
Editing objects
Select an object and press the Edit button to edit it. You an
also press the right mouse button on a visible object to edit it.
Keyboard users may press Edit (Ctrl-F8) to edit the currently
selected object.
Deleting objects
Select an object and press the Del button to delete it. You're
asked for confirmation, just to be sure.
Cloning objects
Select the object to be cloned and press Clone. Currently only
dialog boxes can be cloned. Every attribute of the subviews in
the dialog box is cloned, except helptexts.
PtGen reference manual - page 10
OBJECT DIALOG BOX
Dialog box objects can be created when creating an application.
It is possible to create a standalone dialog box too.
To create a standalone dialog box object choose Dialog|New from
PtGen's main menu. Choose Dialog|Open to read a previously saved
standalone dialog box. After the standalone dialog box is
created, you are prompted to specify a filename to save the code
for this dialog box to.
Dialog box objects for use within a complete application are
created when you select Define|Dialog box from the Available
Objects Popup.
This chapter describes how a dialog box object can be
constructed.
The Dialog Local Menu
You can place objects on the dialog box by pressing Local Menu
(Alt-F10 and selecting an object. Or, for mouse users, click with
the left mouse button on the background in the location where you
want your object to appear. The local menu will popup at that
location.
From this local menu you can either place an object into the
dialog box or acces the settings for this dialog box. See the
next sections for details.
If you popped up the local menu with the mouse, after selecting
an object, that object will be put at the position your mouse was
before the dialog box local menu popped up.
Dialog settings
Select settings from the Dialog Local Menu to edit the dialog
box. The same dialog box pops up as when first creating a dialog
box. You can change the name of the dialog box, its title and set
the helptexts for this dialog box.
The Dialog subviews
The next sections comment on the objects you can place on a
dialog box. Select the appropriate subview from the Dialog Local
Menu to place that subview on the dialog box. See the section
titled Moving and Resing subviews on how to change the position
of a subview.
PtGen reference manual - page 11
Button
Some buttons you use so often that they are predefined. Select
predefined from the Local Menu and select the button you want.
For other buttons select Button from the Local Menu. You can
specify its Title and the Command it generates when it is
selected. You can also specify various button flags. The default
is bfNormal (no options selected) but you can make a certain
button the Default one if you click on the default option. All
bfXXXX constants are supported.
You can create a helpconstant (see the chapter Helptexts, section
helpconstants, you don't have to specify this one), a helptext
which should be displayed on the statusline when this object is
selected, and a window help text which is displayed when a user
presses Help (F1). The last three items don't have to be
specified.
Static text
Select Static Text from the Local Menu and enter the text.
Specify the control characters ^M (new line) and ^C (center text)
by entering first a '^' and then a 'M' or 'C'. PtGen replaces
them with the appropriate control characters.
If you leave the text empty and press OK the text view will be
deleted.
Label
You can place a label only if there is some object/view which can
be labeled. So you insert the view to be labeled first, then the
Label.
To create a label Select label from the Dialog Local Menu, enter
some text and next select an object to link to this label by
either using the arrow keys and/or Tab/Shift-Tab or by clicking
on the to-be-labeled view/object with your mouse.
If you leave the label text empty and press OK the label view
will be deleted.
When you label a view, the record identifier (see the subsection
Creating a record below) will change to the label you specified.
Note that once a label is attached to a view, it can't be
attached to another view. If you want a label to reference
another view, first delete it, then insert a new label with the
same name.
Inputline
The Inputline menu option shows many InputLines. Each of these
has different characteristics. The online help will tell you
more. In this section only the standard InputLine is covered.
After you've selected Inputline, you're prompted to specify the
maximum length of the inputline, if this inputline is selectable
or not (not selectable inputlines can be used to display
PtGen reference manual - page 12
information a user may not change) and if you want to validate
the contents of the inputline before the inputline looses its
focus.
If you want to use a validator for this inputline select the
validator you want from the SpinButtons. Press Edit (Ctrl-F8) to
edit the validator if the Validator spinbuttons are selected. You
can specify the parameters for the validator and (optionally) the
string resource identifer which this identifier should use when
Error is called. If you don't specify an identifier the default
sFilterError, sRangeError, sRealError and sPictureError are used
for TFilterValidator, TRangeValidator, TRealValidator and
TPXPictureValidator respectively.
You can also specify the usual helpconstant (see the section
helpconstants in the chapter about helptexts, you don't have to
specify one), the helptext which should be displayed on the
statusline when this object is selected and the help window text
which should be displayed when a user presses Help (F1). The last
three items don't have to be specified.
Memo
The Memo view is the TMemo object as found in the EDITORS.PAS
unit. You can specify the same parameters as with InputLine
except that you can specify a Horizontal or Vertical ScrollBar
too.
Checkboxes
After selecting checkboxes you have to specify a list of strings.
In the dialog box you will see, press Ins to insert an item, Del
to delete one and Ctrl-F8 to edit an item.
For every text you can specify a different statusline helptext.
Radiobuttons
See Checkboxes.
Spinbuttons
Spinbuttons are one line radiobuttons. Press left or right to
change to display a different text in a spinbutton. See
Checkboxes for how to enter a list of strings for Spinbuttons.
ListViewer
A dummy ListViewer object is placed on the dialog box. This
object is only for layout. Press the code button to specify the
descendent of ListViewer which you want to insert in the dialog
box.
PtGen reference manual - page 13
Moving and Resizing subviews
The subviews in a dialog box can be moved and resized. Keyboard
users should press Local resize (Shift-F5) to move and resize the
currently selected subview.
If you want to center the subview horizontally or vertically
press Alt-F5 to popup the Keyboard positioning menu and choose X-
Center of Y-Center respectivily.
Mouse users should press the Right mouse button on the to be
resized subview and hold that button down. The Mouse Local Popup
pops up. Choose Move or Resize to move or resize the subview.
If you want to center the subview horizontally or vertically
choose X-Center of Y-Center respectivily from the Mouse Local
Popup.
Changing the Tab-order of the subviews
The Tab-order or Z-order of the subviews can be changed. Keyboard
users should press Alt-F5 to popup the Keyboard Position menu.
Choose First to make this subview the first view in the dialog
box. Choose Next when you want to specify the next subview from
this subview. After choosing Next you should select the subview
that should be the next one by tabbing to that subview and
pressing Enter.
Mouse users should press the Right mouse button on the to be
repositioned subview and hold that button down. The Mouse Local
Popup pops up. Choose now First to make this subview the first
view in the Tab-order sequence. Choose Next to specify the next
subview after this one. If you choose Next you can now select the
subvew that should be the next one by clicking on it with either
mouse button.
REMARK 1: Esc cancels the operation of choosing the next subview
for both mouse and keyboard users.
REMARK 2: Labels can't be repositioned. They insert themselves
always after their link, so you don't have to worry about them.
Creating a record
For each dialog box a record can be created. Enable the Record
option in the dialog settings dialog box (popup the Dialog Local
Menu and select settings). The created record will have the name
of the dialog box prefixed by 'T' and suffixed by 'Rec'.
Each subview (except of course subviews like TStaticText) has its
own entry in the record for the dialog box. Each subview defaults
to some suitable variable name and type.
The variable will be equal to the label of that subview. If the
subview has no label you have to manually specify the variable
PtGen reference manual - page 14
name.
To change the record entry of a subview, see the section Code
button below.
Code button
Most subview dialog boxes have a Code button. PtGen lets you
change the generated code. The Code Dialog box shows you the
variable the allocated subview is assigned to (usually P), which
subview to allocate (PInputLine for example), the parameters for
this subview (except R, the first parameter which can't be
changed), and the entry in the record for this dialog box.
You can change the variable name and the type of the variable.
PtGen reference manual - page 15
OBJECT POPUP
The popup object can be edited in the same way as the menubar
object. See chapter Menubar for all the details on editing.
Press Resize (Ctrl-F5) to move the popup to a different location.
Press Local Menu (Alt-F10) to change the name of this popup.
PtGen reference manual - page 16
UNIT BBDLG
Unit BBDlg contains dialog boxes for displaying or getting
information. Most of them have a parameter which sets the HelpCtx
of the displayed dialog box.
Most of the procedures/functions can be used with or without
Turbo Vision. If Turbo Vision is not active (Application = nil)
text is written to the standard output file.
See also PTGEN.TPH, the online manual for references to all
functions, variables and types declard in the BBDlg unit.
This is an overview of the most important functions/procedures:
procedure PrintError(s : string; lm : Languages);
Prints an errorbox on the screen with text s. Writes s to the
errorlog file if you had installed the exithandler.
function PromptUser(s : string; lm : Languages) : AnswerType;
Asks a question like "Do you want to delete this file?" and
returns Yes, No or Cancel.
function UserAnswer(s : string; lm : Languages) : AnswerType;
Gives the user some information. He has to select the OK button
before proceeding. Returned is Yes or Cancel if the users
wishes to cancel to process.
function InputString(Header : string; var s : string;
len : word; AllowedChars : string; lm : Languages) : word;
Prompts user for input and returns OK if user selected the OK
button or Cancel if the user canceled the process. Header is
the Title which appears on the dialog. Len are the numbers of
characters allowed and AllowedChars the chars that can be used
like numbers or uppercase characters.
function ExecDialog(P: PDialog; Data: Pointer): Word;
Executes a dialog. Same as found in sample code for Turbo
Vision.
function PassWord(s : string; lm : Languages) : Boolean;
Prompts the user to enter a password and returns TRUE if the
password equals s.
PtGen reference manual - page 17
UNIT BBERROR
The unit BBERROR contains the error handling for your programs.
Exit handling is installed with a call to InstallExitHandler. To
include error handling in your programs, include a statement like
the following in the beginning of your program:
InstallExitHandler('MYERR.LOG', MyApp);
The definition of this procedure is:
procedure InstallExitHandler(AFileName : PathStr);
AFileName is the name of the log file where you want error
information be written to. Error information is written to this
file when your program crashes. Procedure PrintError from unit
BBDLG writes errors to this file too as may lots of other units.
The error file is exported as ferr. Your units may write to the
error file too by including ExitHandler in your uses clause and
simply write to it. Example:
writeln(ferr, 'Write to error file');
PtGen reference manual - page 18
UNIT BBFILE
This unit contains file oriented primitives. The following
procedures/methods are supplied:
procedure DosDel (Path : PathStr);
Delete a file. Full wildcard support.
Example:
DosDel('*.BAK');
procedure DosCopy(Source, Destination : PathStr; HelpCtx : word);
Copies one or more files to destination. Full wildcard support.
Example:
DosCopy('A:\*.TXT', 'C:\TMP', hcNocontext);
procedure DosMove(Source, Destination : PathStr; HelpCtx : word);
Moves dos files to their destionation. Already existing
destination files they are removed before the move of the source
file takes place.
procedure DosWipe(Path : PathStr);
Deletes files according to Department of Defense standard DOD
5220.22-M. Even the CIA won't be able to read such a file after
it has been deleted!
Example:
DosWipe('SECRETS.TXT');
procedure DosTouch(Path : PathStr);
Set the date and time of the files (full wildcard support) to the
current day and time.
Example:
Touch('F:\DB4\*.DBF');
function FileExist(FileName : PathStr) : Boolean;
Returns true if the specified file exists.
Example:
if FileExist('MYFILE') then ..
function CreateBAK(FileName : PathStr) : PathStr;
Renames FileName to same name and extension .BAK. Returns the
PtGen reference manual - page 19
expanded filename of the created .BAK file. Previous .BAK file is
deleted.
Example:
CreateBAK('USER.TXT');
function FileOpen(var f) : Boolean;
Returns true if the specified filename is open for Input/Output,
Output or Input. Only valid after a filename has been assigned to
f.
Example:
Assign(f, 'TEST.$$$');
if FileOpen(f) then ..
function FForceExtension(FileName : PathStr; Ext : ExtStr) :
string;
Returns a filename with the supplied extension A '.' has to be
part of Ext.
Example:
OpenSquish(FForceExtension('\ECHO\COMPMISC', '.SQD'));
function FDefaultExtension(FileName : PathStr; Ext : ExtStr) :
string;
Returns a filename with the supplied extension is the filename
didn't have one. A '.' has to be part of Ext.
Example:
ShowPascalSourceFile(FDefaultExtensions('MYFILE', '.PAS'));
PtGen reference manual - page 20
UNIT BBSTRRES
See the online help.
PtGen reference manual - page 21
UNIT BBUTIL
Unit BBUTIL contains various constants, types, procedures,
functions and variables I found handy during several years. This
unit is likely to change over the years. Most of the functions
and procedures are string handling routines. The most important
are described.
There are various string handling units. The Str? are function
equivalents of the procedure
Str(n, s);
useful for one-liners.
function StrI(n : integer) : string;
function StrW (n : word) : string;
function StrL(n : longint) : string;
function StrR(n : real; width, decimals : word) : string;
function LeadingZero(value : word) : string;
function HexStr(w : word) : string;
StrI converts integers, StrW words, StrL longint, StrR reals for
a given width and decimals. LeadingZero returns value as string
with a leading zero if value consists of only one digits. Mainly
used for formatting time or day units. HexStr returns a word in
base 16.
The Val? functions are equivalent to the procedure Val.
function ValB(s : string) : byte;
function ValI(s : string) : integer;
function ValW(s : string) : word;
function ValL(s : string) : longint;
Uppercase and lowercase a string.
function UpStr(s : string) : string;
function LowStr(s : string) : string;
Various string routines
function Spc (number : integer) : string;
Returns a given amount of spaces. If number <= 0 Spc returns an
empty string.
function RepChar(c : char; len : word) : string;
Returns a string of char c repeated len times.
function StripSpc(s : string) : string;
PtGen reference manual - page 22
Strips spaces before and after a string. Nice for getting
information from .DBF files.
function LeftJustify(s : string; f_len : word) : string;
Leftjustifies a string.
function CPos(c : char; s : string) : byte;
Same as Pos except substr is a char so search procedure could be
optimized for speed.
function Empty(s : string) : Boolean;
Returns TRUE if a string is Empty or consists only of spaces.
function GetDateStr : string;
Returns the current date in format yyyy-mm-dd
function GetTimeStr : string;
Returns the current time in format hh:mm:ss
Routines dealing with dynamic strings
function GetStr(p : PString) : string;
Returns an empty string if P = nil or else P^
procedure FreeStr(p : PString);
If P = NIL nothing happens else a call is made to DisposeStr(p).
procedure ReplaceStr(var p : PString; s : string);
Kind of assignment for dynamic strings. First p is disposed by
calling FreeStr then s is assigned to p by a call to NewStr
Various
procedure Beep;
Produces a short beep.
function Rnd(r : real) : real;
The Round function of Turbo Pascal contains serious errors. This
is especially bad for money arithmetic. This function returns a
flawless 2 digit rounded number.
procedure DisposeSItem(PS : PSItem);
Disposes a PSItem variable.
PtGen reference manual - page 23
UNIT BBVALIDATE
See BBVALIDATE.PAS for more details.
PtGen reference manual - page 24
PTGEN TECHNICAL INFORMATION
This section contains information about PtGen internals,
especially about the source file it outputs.
When you view the source file PtGen creates, you will frequently
see the {@#..#@} structure. The information inside this comment
is used by PtGen to speed up file reading and to distinguish
between certain parts of the created application.
You can edit the source file PtGen creates, but you should
conform to the format PtGen outputs and expects when reading such
a file. If you want to change code parts, copy them to a unit or
program of your own and change them their. Leave the PtGen
created code intact.
PtGen reference manual - page 25
ERROR CODES
PtGen will sometimes give strange error messages. Usually the to
be readed file is corrupt or an internal error in PtGen occured.
PtGen does a lot of checking mainly for speeding up development
by catching errors early. They are generally not meaningfull for
ordinary users. Send your log file (PTGERR.LOG) to the author if
you think an internal error occured.
PtGen reference manual - page 26
INDEX
Application
configuration . . . . . . . . . . . . . . . . . . . . . . 1
creating . . . . . . . . . . . . . . . . . . . . . . . . . 1
editing . . . . . . . . . . . . . . . . . . . . . . . . . 1
loading . . . . . . . . . . . . . . . . . . . . . . . . . 1
saving . . . . . . . . . . . . . . . . . . . . . . . . . . 2
saving as . . . . . . . . . . . . . . . . . . . . . . . . 2
Available Objects Popup . . . . . . . . . . . . . . . . . . . 10
Button . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Center subviews . . . . . . . . . . . . . . . . . . . . . . . 14
Changing the Tab-order . . . . . . . . . . . . . . . . . . . 14
Checkboxes . . . . . . . . . . . . . . . . . . . . . . . . . 13
Creating a record
dialog settings dialog box . . . . . . . . . . . . . . . 14
Labeling a view . . . . . . . . . . . . . . . . . . . . 12
Record option . . . . . . . . . . . . . . . . . . . . . 14
Desktop Local Menu . . . . . . . . . . . . . . . . . . . . . . 6
Dialog box . . . . . . . . . . . . . . . . . . . . . . . . . 11
Dialog box Local Menu . . . . . . . . . . . . . . . . . . . . 11
Inputline . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Label . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Links
creating . . . . . . . . . . . . . . . . . . . . . . . . . 4
deleting . . . . . . . . . . . . . . . . . . . . . . . . . 4
ListViewer . . . . . . . . . . . . . . . . . . . . . . . . . 13
Memo . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Menubar
creating a line . . . . . . . . . . . . . . . . . . . . . 3
creating a submenu . . . . . . . . . . . . . . . . . . . . 3
creating new entries . . . . . . . . . . . . . . . . . . . 3
deleting entries . . . . . . . . . . . . . . . . . . . . . 3
editing entries . . . . . . . . . . . . . . . . . . . . . 3
Moving subviews . . . . . . . . . . . . . . . . . . . . . . . 14
Objects Dialog box . . . . . . . . . . . . . . . . . . . . 6, 10
cloning objects . . . . . . . . . . . . . . . . . . . . 10
creating objects . . . . . . . . . . . . . . . . . . . . 10
deleting objects . . . . . . . . . . . . . . . . . . . . 10
editing objects . . . . . . . . . . . . . . . . . . . . 10
Radiobuttons . . . . . . . . . . . . . . . . . . . . . . . . 13
Resizing subviews . . . . . . . . . . . . . . . . . . . . . . 14
Spinbuttons . . . . . . . . . . . . . . . . . . . . . . . . . 13
Static text . . . . . . . . . . . . . . . . . . . . . . . . . 12
Tab-order changing
subviews . . . . . . . . . . . . . . . . . . . . . . . . 14
Units Dialog box . . . . . . . . . . . . . . . . . . . . . . . 6
Validators . . . . . . . . . . . . . . . . . . . . . . . . . 13
PtGen reference manual - page 27