home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Media Share 13
/
mediashare_13.zip
/
mediashare_13
/
ZIPPED
/
PROGRAM
/
PBWTD13.ZIP
/
WORKSHOP.ZIP
/
PBW_TD.DOC
< prev
next >
Wrap
Text File
|
1994-03-07
|
139KB
|
3,118 lines
┌───────────────────────────────────────────────────────┐
│ │
│ P B / W O R K S H O P (tm) T E S T D R I V E │
│ Visual Designer for PB/VISION(tm) and PowerBASIC 3.0 │
│ │
│ Documentation │
│ │
│ (c) Copyright 1993-1994 DSE Software Publishing │
│ Licensed Material. All Rights Reserved. │
│ │
│ ┌────────────────────────────────────┐ │
│ │ ▀▀▀▀▀▀▀▀\ ▀▀▀▀▀▀\ ▀▀▀▀▀▀▀▀▀▀\ │ │
│ │ ▀▀▀\ ▀\ ▀▀\ ▀▀\ ▀▀▀\ ▀▀\ │ │
│ │ ▀▀▀\ ▀\ ▀▀\ ▀\ ▀▀▀\ ▀\ │ │
│ │ ▀▀▀\ ▀▀\ ▀▀\ ▀▀▀\ │ │
│ │ ▀▀▀\ ▀▀\ ▀▀▀\ ▀▀▀\ ▀\ │ │
│ │ ▀▀▀\ ▀▀\ ▀▀▀\ ▀▀▀\ ▀\ │ │
│ │ ▀▀▀\ ▀▀\ ▀▀▀\ ▀▀▀▀▀▀\ │ │
│ │ ▀▀▀\ ▀▀\ ▀▀▀\ ▀▀▀\ ▀\ │ │
│ │ ▀▀▀\ ▀▀\ ▀▀▀\ ▀▀▀\ ▀\ │ │
│ │ ▀▀▀\ ▀▀\ ▀▀\ ▀▀▀\ │ │
│ │ ▀▀▀\ ▀\ ▀\ ▀▀\ ▀▀▀\ ▀\ │ │
│ │ ▀▀▀\ ▀\ ▀▀\ ▀▀\ ▀▀▀\ ▀▀\ │ │
│ │ ▀▀▀▀▀▀▀▀\ ▀▀▀▀▀▀\ ▀▀▀▀▀▀▀▀▀▀\ │ │
│ └────────────────────────────────────┘ │
│ │
│ DSE Software Publishing │
│ Post Office Box 96 │
│ Willits, CA 95490-0096 │
│ (707) 459-4358 │
│ │
└───────────────────────────────────────────────────────┘
┌───────────────────────────────────────────────────────┐
│ This program and its accompanying documentation │
│ remain the exclusive property of DSE Software │
│ Publishing. Unauthorized use, duplication, or │
│ distribution is strictly forbidden by federal law │
│ and is subject to criminal prosecution. │
└───────────────────────────────────────────────────────┘
PowerBASIC is a registered trademark of PowerBASIC, Inc.
PB/VISION(tm) and PB/WORKSHOP(tm) are trademarks of DSE
Software Publishing. Other product names are trademarks
or registered trademarks of their respective holders.
Contents
Introduction. . . . . . . . . . . . . . . . . . . 2
Chapter 1 Getting Started. 3
1.1 Installing PB/WORKSHOP. . . . . . . . . . . . 3
1.2 Starting PB/WORKSHOP. . . . . . . . . . . . . 3
1.3 Setting PB/WORKSHOP Preferences. . . . . . . 3
1.4 Exiting PB/WORKSHOP. . . . . . . . . . . . . 4
1.5 Using Online Help in PB/WORKSHOP. . . . . . . 4
Chapter 2 PB/WORKSHOP Basics. 5
2.1 Understanding Resources. . . . . . . . . . . 5
2.2 PB/WORKSHOP Resource Objects. . . . . . . . . 5
2.2.1 Forms. . . . . . . . . . . . . . . . . . 5
2.2.2 Menus. . . . . . . . . . . . . . . . . . 5
2.2.2.1 Popup menus. . . . . . . . . . . . 5
2.2.2.2 Pulldown menus. . . . . . . . . . . 6
2.2.3 Status bars. . . . . . . . . . . . . . . 6
Chapter 3 Working with Projects and Resources. 7
3.1 Creating new projects. . . . . . . . . . . . 7
3.1.1 Project (.PRJ) files. . . . . . . . . . 8
3.1.2 Resource compiler files (.RC) . . . . . 8
3.1.3 Resource files (RES) . . . . . . . . . . 8
3.1.4 Help source files (.TXT) and Help files
(.HLP) . . . . . . . . . . . . . . . . . 9
3.1.5 Include Files (.BI) . . . . . . . . . . 9
3.2 Opening an existing project. . . . . . . . 10
3.3 The Project window. . . . . . . . . . . . . 10
3.4 Adding a resource object. . . . . . . . . . 11
3.5 Editing a resource object. . . . . . . . . 12
3.6 Testing a resource object. . . . . . . . . 12
3.7 Copying a resource object. . . . . . . . . 12
3.8 Renaming a resource object. . . . . . . . . 12
3.9 Deleting a resource object. . . . . . . . . 13
3.10 Compiling a resource. . . . . . . . . . . 13
3.11 The ATTACH.EXE Utility . . . . . . . . . . 14
3.12 The HELPGEN.EXE Utility . . . . . . . . . 14
Chapter 4 The Data Entry Form Editor. 15
4.1 Creating Data Entry Forms. . . . . . . . . 15
4.1.1 The "Properties" dialog. . . . . . . . 15
4.1.2 The "Text Properties" Dialog. . . . . 17
4.1.3 The "Palette" dialog. . . . . . . . . 18
4.1.4 Navigating through the Dialogs. . . . 18
i
4.2 Working with buttons. . . . . . . . . . . . 18
4.2.1 Adding buttons. . . . . . . . . . . . 19
4.2.2 Selecting buttons. . . . . . . . . . . 20
4.2.3 Moving and resizing buttons. . . . . . 20
4.2.3.1 Moving and resizing with the
Properties dialog. . . . . . . . 20
4.2.3.2 Moving and resizing buttons
manually. . . . . . . . . . . . . 21
4.2.4 Duplicating buttons. . . . . . . . . . 21
4.2.5 Editing buttons. . . . . . . . . . . . 21
4.2.6 Editing specific button properties. . 21
4.2.6.1 The String Length property. . . . 22
4.2.6.2 The Event ID property. . . . . . 22
4.2.6.3 The Help ID property. . . . . . . 22
4.2.6.4 The Name property. . . . . . . . 23
4.2.6.5 Grouping related buttons. . . . . 24
4.2.7 Reordering button sequence. . . . . . 24
4.2.8 Creating Custom Input Masks. . . . . . 25
4.2.9 Global Help Assignment. . . . . . . . 27
4.2.10 Form Code Generation. . . . . . . . . 27
4.2.10.1 Form Initialization . . . . . . 28
4.2.10.2 Form Display Options . . . . . . 29
4.2.10.3 Form Flow Control . . . . . . . 29
4.2.10.4 Quick Code . . . . . . . . . . . 29
4.3 Testing a Data Entry Form. . . . . . . . . 30
4.4 Saving a Data Entry Form. . . . . . . . . . 30
4.5 Exiting the Data Entry Form Editor. . . . . 30
4.6 A Sample Data Entry Form. . . . . . . . . . 31
4.6.1 Creating a new data entry form. . . . 31
4.6.1.1 Adding the new form. . . . . . . 32
4.6.1.2 Adding a text button. . . . . . . 33
4.6.1.3 Adding check boxes. . . . . . . . 33
4.6.1.4 Adding command buttons. . . . . . 34
4.6.1.5 Adding some color to the form and
buttons. . . . . . . . . . . . . 34
4.6.1.6 Testing, fixing, and saving the
form. . . . . . . . . . . . . . . 34
Chapter 5 Creating menus. 36
5.1 The Menu editors. . . . . . . . . . . . . . 36
5.1.1 Menu properties. . . . . . . . . . . . 36
5.2 The menu entry list. . . . . . . . . . . . 37
5.3 Menu outlining buttons . . . . . . . . . . 37
5.4 Starting a menu editor. . . . . . . . . . . 37
5.4.1 Adding menu entries. . . . . . . . . . 38
5.4.1.1 Entering menu captions. . . . . . 38
5.4.1.2 Menu entry event id. . . . . . . 38
5.4.1.3 Menu entry help id. . . . . . . . 39
5.4.1.4 Moving menu entries. . . . . . . 39
5.5 Menu palette dialog. . . . . . . . . . . . 39
5.5.1 Menu code generation. . . . . . . . . 40
5.5.1.1 Menu initialization. . . . . . . 41
5.5.1.2 Menu display options. . . . . . . 42
ii
5.5.1.3 Menu flow control. . . . . . . . 42
5.5.1.4 Quick Code . . . . . . . . . . . 42
5.6 Saving a menu . . . . . . . . . . . . . . . 43
Chapter 6 Creating Status bars. 44
6.1 The Status bar editor. . . . . . . . . . . 44
6.1.1 Status bar properties. . . . . . . . . 44
6.2 The status bar entry list. . . . . . . . . 45
6.3 Status bar outlining buttons. . . . . . . . 45
6.4 Starting the status object editor. . . . . 45
6.4.1 Adding Status bar entries. . . . . . . 45
6.4.1.1 Entering Status bar captions. . . 46
6.4.1.2 Status bar entry event id. . . . 46
6.4.1.3 Moving status bar entries. . . . 46
6.5 Status bar Palette Dialog. . . . . . . . . 46
6.6 Status bar Code Generation. . . . . . . . . 47
6.6.1 Status bar Initialization. . . . . . . 48
6.6.2 Status bar display options . . . . . . 48
6.6.3 Quick Code . . . . . . . . . . . . . . 48
6.7 Saving a Status bar. . . . . . . . . . . . 49
Chapter 7 COMMERCIAL RELEASE ONLY 50
iii
Figures
Figure 1.1: The Preferences Dialog. . . . . . . . . . 4
Figure 3.1: New Project Dialog. . . . . . . . . . . . 7
Figure 3.2: Open Project Dialog. . . . . . . . . . .10
Figure 3.3: Project Window . . . . . . . . . . . . .11
Figure 3.4: Create New Object Dialog. . . . . . . . .11
Figure 3.5: Copy Object Dialog. . . . . . . . . . . .12
Figure 3.6: Rename Object Dialog. . . . . . . . . . .13
Figure 4.1: New Form. . . . . . . . . . . . . . . . .15
Figure 4.2: The Properties dialog. . . . . . . . . .16
Figure 4.3: The Text Properties Window. . . . . . . .17
Figure 4.4: The Palette Dialog. . . . . . . . . . . .18
Figure 4.5: The Reorder Buttons Dialog. . . . . . . .25
Figure 4.6: The Custom Input Masks Dialog. . . . . .26
Figure 4.7: Global Help Id Assignment Dialog. . . . .27
Figure 4.8: Form Code Generation Dialog. . . . . . .28
Figure 4.9: Quick Code File Creation Dialog. . . . .30
Figure 4.10: The Project Window for PBWDEMO.PRJ. . .31
Figure 4.11: The Sample Data Entry Form. . . . . . .32
Figure 5.1: Menu Properties. . . . . . . . . . . . .36
Figure 5.2: Menu entry list. . . . . . . . . . . . .37
Figure 5.3: Menu outlining keys. . . . . . . . . . .37
Figure 5.4: The Menu Palette Dialog. . . . . . . . .40
Figure 5.5: Menu Code Generation Dialog. . . . . . .41
Figure 5.6: Quick Code File Creation Dialog. . . . .42
Figure 6.1: Status Bar Properties. . . . . . . . . .44
Figure 6.2: Status bar entry list. . . . . . . . . .45
Figure 6.3: Menu Outlining Keys. . . . . . . . . . .45
Figure 6.4: Status Bar Palette Dialog . . . . . . . .47
Figure 6.5: Status bar Code Generation Dialog. . . .47
Figure 6.6: Quick Code File Creation Dialog. . . . .49
iv
PB/WORKSHOP(tm) - Version 1.03
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
Introduction.
─────────────────────────────────────────────────────────────────
PB/WORKSHOP VISUAL DESIGNER is a development system used for
the design of complex user interfaces and source code
generation. This manual describes PB/WORKSHOP and takes the
user through a step by step tutorial in interface design.
Some of the terms may seem foreign since you do not have the
PB/VISION documentation that provides the details of the
interface tools. More extensive documentation and example
programs are included with the commercial package.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
(c) Copyright 1993-1994 DSE Software Publishing 2
PB/WORKSHOP(tm) - Version 1.03
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
Chapter 1
Getting Started.
█████████████████████████████████████████████████████████████████
This chapter describes the PB/WORKSHOP installation process.
Also described is how to start PB/WORKSHOP, set the program
"Preferences", exit PB/WORKSHOP, and how to call up context
sensitive help at any time.
1.1 Installing PB/WORKSHOP.
─────────────────────────────────────────────────────────────────
PB/WORKSHOP is installed at the same time PB/VISION is
installed. If you have not yet installed PB/VISION, place
the diskette in either drive A: or drive B:, go to that
drive and run INSTALL.EXE.
You will be required to enter the installation directory as
well as the path of PowerBASIC (PB.EXE) itself. The process
is automated and will take a few minutes to complete.
If you have any problem during installation, please contact
DSE Software Publishing for instructions.
1.2 Starting PB/WORKSHOP.
─────────────────────────────────────────────────────────────────
To start PB/WORKSHOP, type in the following at the DOS
prompt:
PBW ' press <CR>
PB/WORKSHOP will then load and execute.
If a project was open during a previous execution of
PB/WORKSHOP, it will be automatically reloaded.
1.3 Setting PB/WORKSHOP Preferences.
─────────────────────────────────────────────────────────────────
When running PB/WORKSHOP for the first time, it is important
that the system preferences be set correctly. To set the
system preferences, select "Project|Preferences" from the
pulldown menu. PB/WORKSHOP will then display the
"Preferences" dialog.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
(c) Copyright 1993-1994 DSE Software Publishing 3
PB/WORKSHOP(tm) - Version 1.03
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
┌──────────── PREFERENCES ───────────┐
│ ┌ Screen Lines────────┐ ╔════════╗ │
│ │ (*) 25 Lines │ ║ Ok ║ │
│ │ ( ) 28 Lines │ ╚════════╝ │
│ │ ( ) 43 Lines │ ┌────────┐ │
│ │ ( ) 50 Lines │ │ Cancel │ │
│ └─────────────────────┘ └────────┘ │
│ ┌ Screen Mode─────────┐ ┌────────┐ │
│ │ ( ) Text Mode │ │ Help │ │
│ │ (*) Graphic Mapping │ └────────┘ │
│ └─────────────────────┘ │
└────────────────────────────────────┘
Figure 1.1: The Preferences Dialog.
The "Screen Lines" box tells PB/WORKSHOP what screen
resolution to use. For normal use, 28 lines provides the
best results when developing standard 25 line mode
applications. This mode is only available on EGA/VGA
equipped systems.
"Screen Mode" is used to select between generic text mode or
the graphics mapped text mode. "Graphics Mapping" provides
the crisp look of a graphics program, but the speed and low
overhead of text mode. When run on MDA/CGA equipped system,
graphics mapping is automatically disabled and the generic
text mode is used. This is automatic for PB/WORKSHOP and
the programs you create with it.
To make the Preference changes permanent, select the "OK"
button and the dialog will close.
1.4 Exiting PB/WORKSHOP.
─────────────────────────────────────────────────────────────────
To exit PB/WORKSHOP, select "Project|Exit" from the pulldown
menu. There is no need to select "Project|Close" first as
PB/WORKSHOP always saves your work before exiting.
1.5 Using Online Help in PB/WORKSHOP.
─────────────────────────────────────────────────────────────────
If you are unsure of what any PB/WORKSHOP menu or dialog is
requesting, pressing <F1> will bring forward context
sensitive help for that item. Many dialogs may also have a
separate "Help" button. Help returned by the "Help" button
is usually more generic than the help returned by pressing
<F1> at a specific button or menu entry.
To close a help window, select the "Quit".
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
(c) Copyright 1993-1994 DSE Software Publishing 4
PB/WORKSHOP(tm) - Version 1.03
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
Chapter 2
PB/WORKSHOP Basics.
█████████████████████████████████████████████████████████████████
This chapter describes PB/WORKSHOP resource files and
individual resource objects.
2.1 Understanding Resources.
─────────────────────────────────────────────────────────────────
Resources are all of the objects that belong to a particular
project. Resources are made of of any combination of forms,
menus, and status bars.
2.2 PB/WORKSHOP Resource Objects.
─────────────────────────────────────────────────────────────────
The individual components of a PB/WORKSHOP project are
called "resource objects". At the present time, PB/WORKSHOP
supports 4 kinds of resource objects:
2.2.1 Forms.
─────────────────────────────────────────────────────────────────
In PB/VISION forms are windows that provide a mechanism for
entering specific information.
Data entry forms are made up of any combination of text
buttons, command buttons, check boxes, and such. All
objects placed in a form are referred to as "buttons".
Using PB/WORKSHOP's form editor, you can add, customize, and
move buttons around until you have what you are looking for.
At any time during the process, you can test the form or
save it for later editing.
2.2.2 Menus.
─────────────────────────────────────────────────────────────────
PB/WORKSHOP supports two very distinct menu styles:
2.2.2.1 Popup menus.
─────────────────────────────────────────────────────────────────
Popup menus are windows that present a list of possible
choices to select.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
(c) Copyright 1993-1994 DSE Software Publishing 5
PB/WORKSHOP(tm) - Version 1.03
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
Using PB/WORKSHOP's popup menu editor, you can add menu
entries, change the position of an entry, and customize the
coloring scheme of the popup menu.
2.2.2.2 Pulldown menus.
─────────────────────────────────────────────────────────────────
Pulldown menus are menus that can display child menus that
drop from a horizontal menu bar at the top of the screen.
PB/VISION's pulldown menu editor is nearly identical to the
popup menu editor. The difference is that the pulldown menu
editor has extra features that let you define the hierarchy
of the menu entries.
2.2.3 Status bars.
─────────────────────────────────────────────────────────────────
Status bars are visual accelerators. If your program will
allow events to occur when the user presses a particular key
combination, the status bar would be used to not only
provide a mechanism of trapping the key but also provide a
visual reference to that key. The user then has the option
of either pressing the key or clicking on the visual
indicator with the mouse.
PB/VISION's status bar editor is quite similar to the popup
menu editor all ready described.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
(c) Copyright 1993-1994 DSE Software Publishing 6
PB/WORKSHOP(tm) - Version 1.03
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
Chapter 3
Working with Projects and Resources.
█████████████████████████████████████████████████████████████████
This chapter describes what projects are and how to create
them. Also discussed are what additional files are created
when a new project is created.
3.1 Creating new projects.
─────────────────────────────────────────────────────────────────
To create a new PB/WORKSHOP project, select "Project|New"
from the pulldown menu. PB/WORKSHOP will then display the
New Project dialog:
┌─────────────── NEW PROJECT ──────────────┐
│ │
│┌────────────────────────────────────────┐│
││ ││
│└────────────────────────────────────────┘│
│ ╔════════╗ ┌────────┐ │
│ ║ Ok ║ │ Cancel │ │
│ ╚════════╝ └────────┘ │
└──────────────────────────────────────────┘
Figure 3.1: New Project Dialog.
Enter the file name of the project to create. Do not enter
any path information. The extension ".PRJ" will
automatically appended to the file name if it is not
supplied. To proceed, select the "Ok" button.
For each project that you create, PB/WORKSHOP creates a
subdirectory to place the project component files in. If
you were to create a project call "HELLO", your directory
tree wouud look like this:
\ (ROOT)
└─ WORKSHOP
├─ HELLO
├─ PBWDEMO
└─ RC
Each project gets its own subdirectory.
At the of creation, PB/WORKSHOP builds a stub $INCLUDE file
and a starter help source file and places them in the
projects subdirectory. As PB/WORKSHOP and its utilities
build other files, they too are placed in the subdirectory.
Each one of these files begin with the projects name, but
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
(c) Copyright 1993-1994 DSE Software Publishing 7
PB/WORKSHOP(tm) - Version 1.03
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
have different file extensions depending on the purpose of
the file.
The next few sections will describe the files that
PB/WORKSHOP will create.
3.1.1 Project (.PRJ) files.
─────────────────────────────────────────────────────────────────
For each project created, PB/WORKSHOP creates and maintains
a project management file. This is the file that keeps
track of all of the other component files belonging to a
project. Project files always have a .PRJ extension.
Inside the project file are sections that define what
resource object files belong to what resource objects.
Other sections maintain a list of the custom event codes and
help screens defined in the individual resource objects.
Unlike the rest of the files PB/WORKSHOP creates, this file
is placed in the same directory as PB/WORKSHOP itself.
3.1.2 Resource compiler files (.RC)
──────────────────────────────────────────────────────────────────
Each time you create a new resource object, PB/WORKSHOP
creates a "resource component" file to place the object in.
These files all end with an ".RC" file extension and they are
all placed into the ".\RC" subdirectory, a subdirectory off
of the main PB/WORKSHOP directory.
If you look into the ".\RC" subdirectory you will note that
they all have strange names. All "RC" files are given a
completely random file name. Since PB/WORKSHOP manages these
files itself, you should never have to worry about the names
of these files.
3.1.3 Resource files (RES)
──────────────────────────────────────────────────────────────────
These are the files that PB/WORKSHOP creates when you select
the "Project|Resource Compiler" option from the main menu.
When selected, PB/WORKSHOP collects all of the resource
objects you have created and puts them into a single
compressed file. This file is then placed in the
subdirectory assigned to your project.
For more information on compiling resource files, see section
3.10.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
(c) Copyright 1993-1994 DSE Software Publishing 8
PB/WORKSHOP(tm) - Version 1.03
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
3.1.4 Help source files (.TXT) and Help files (.HLP)
──────────────────────────────────────────────────────────────────
The "Help source file" is simply a specially formatted plain
text file that has the source for all of your help screens.
If you want to have context sensitive help screens for all of
your menu and data entry form entries, you must put the text
for each entry in this file.
You can create and edit this file with any editor capable of
loading and saving ASCII files (such as EDIT.COM).
PB/WORKSHOP only creates the stub file. It is up to you to
add the text for each help screen.
PB/VISION came with a utility named "PBVHC.EXE" (which for
stands for PB/VISION Help Compiler". This utility reads in
your original help source files and outputs a compressed .HLP
version of the same file. When the user requests help, it is
from this file that the screen is loaded.
3.1.5 Include Files (.BI)
──────────────────────────────────────────────────────────────────
These files are managed by PB/WORKSHOP _and_ PBVHC.EXE.
When "Project|Resource Compiler" is selected from the main
menu, not only does PB/WORKSHOP create a resource file (RES),
it also updates this $INCLUDE file with references to all of
the objects and help screens defined in your project. If you
have form objects in your project, complete "TYPE" variable
definitions for each form will also be added.
You are permitted to add your own information to the project
$INCLUDE file but you _must_ add it _below_ the line that
reads:
REM [USER DATA]
Everything below this line is preserved between resource
compiles. Everything else is subject to the whims of the
compiler and will probably be deleted.
What can you put in the "[USER DATA]" area? You can put your
own "DECLARE" statements, "TYPE" variables, anything really.
Just keep it below that line.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
(c) Copyright 1993-1994 DSE Software Publishing 9
PB/WORKSHOP(tm) - Version 1.03
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
3.2 Opening an existing project.
─────────────────────────────────────────────────────────────────
To open an existing PB/WORKSHOP project, select
"Project|Open Project" from the main menu. PB/WORKSHOP will
then display the "Open Project" dialog:
┌─────────────────── OPEN PROJECT ───────────────────┐
│ │
│ ┌────────────────────────┐ ╔════════╗ │
│ File Name │F:\PB\*.PRJ │ ║ Ok ║ │
│ └────────────────────────┘ ╚════════╝ │
│ Files Drives ┌────────┐ │
│ ┌────────────────┐ ┌────────────────┐ │ Cancel │ │
│ │BOG.PRJ █ │ F: │ └────────┘ │
│ │COWBASE.PRJ ■ └────────────────┘ │
│ │FAX.PRJ ░ Directories │
│ │FIRST.PRJ ░ ┌────────────────┐ │
│ │FONTVIEW.PRJ ░ │F:\ █ │
│ │HELPDEMO.PRJ ░ │ PB ■ │
│ │HELPGEN.PRJ ░ │ FONTS ░ │
│ │PBMORSE.PRJ ░ │ INCLUDE ░ │
│ │PBW.PRJ █ │ LIB █ │
│ └────────────────┘ └────────────────┘ │
└────────────────────────────────────────────────────┘
Figure 3.2: Open Project Dialog.
Assuming you are familiar with how this dialog works, choose
a project to load and select "Ok".
3.3 The Project window.
─────────────────────────────────────────────────────────────────
When you open a new or existing project, PB/WORKSHOP will
display the Project window. For new projects, the window is
empty except for the labels showing what kinds of objects
can be added. For existing projects you will also see a
categorized list of all the resource objects belonging to
the project.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
(c) Copyright 1993-1994 DSE Software Publishing 10
PB/WORKSHOP(tm) - Version 1.03
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
┌─── COWBASE.PRJ ───┐
│[FORM] █
│ CowList ░
│ NewCow ■
│ EditCow ░
│ SearchCow ░
│[POPMENU] ░
│[PULLMENU] ░
│[STATUS] ░
│ CowKeys ░
│ ░
│ █
└───────────────────┘
Figure 3.3: Project Window
From the Project window, you can create new resource objects
or select existing resource objects to edit.
3.4 Adding a resource object.
─────────────────────────────────────────────────────────────────
Adding a new resource object to a project can be
accomplished using several methods. The easiest way is to
simply press the <INSert> key on the keyboard cursor pad.
PB/WORKSHOP will then display the "Create New Object"
dialog:
┌──────────── CREATE NEW OBJECT ────────────┐
│ │
│ ┌───────────────┐ ╔════════╗ │
│ New Object: │ │ ║ Ok ║ │
│ └───────────────┘ ╚════════╝ │
│ ┌───────────────┐ ┌────────┐ │
│ │ (*) FORM │ │ Cancel │ │
│ │ ( ) POPMENU │ └────────┘ │
│ │ ( ) PULLMENU │ ┌────────┐ │
│ │ ( ) STATUS │ │ Help │ │
│ └───────────────┘ └────────┘ │
└───────────────────────────────────────────┘
Figure 3.4: Create New Object Dialog.
Enter a unique name for the object. Without using spaces or
punctuation, enter a descriptive name such as "MainMenu" or
"BobsForm". This name will not appear where anyone else can
see. You must also choose what class of resource object to
create. When satisfied, select "Ok".
Two other methods of creating a new object are to select one
of the object labels (in brackets) from the Project window,
or to select "Object|New Object" from the main menu. All
three methods yield the same net result.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
(c) Copyright 1993-1994 DSE Software Publishing 11
PB/WORKSHOP(tm) - Version 1.03
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
3.5 Editing a resource object.
─────────────────────────────────────────────────────────────────
To edit a resource object, select one from the Project
window by positioning the highlight bar over the object name
and press <CR> or selecting "Object|Edit" from the main
menu. PB/WORKSHOP will then load and display the editor
that is appropriate for that particular kind of object.
3.6 Testing a resource object.
─────────────────────────────────────────────────────────────────
PB/WORKSHOP allows you to test any object at any time. To
test an object, position the highlight bar in the Project
window over the intended object and either press <F5> or
select "Object:Test Object" from the main menu.
3.7 Copying a resource object.
─────────────────────────────────────────────────────────────────
To copy an existing resource object to a new resource
object, position the highlight bar in the Project window
over the intended object and select "Object|Copy Object"
from the main menu. PB/WORKSHOP will then display the "Copy
Object" dialog:
┌─────────────── COPY OBJECT ───────────────┐
│ │
│ ┌───────────────┐ ╔════════╗ │
│ Object Name: │CowList │ ║ Ok ║ │
│ └───────────────┘ ╚════════╝ │
│ ┌───────────────┐ ┌────────┐ │
│ New Object: │ │ │ Cancel │ │
│ └───────────────┘ └────────┘ │
│ ┌────────┐ │
│ │ Help │ │
│ └────────┘ │
└───────────────────────────────────────────┘
Figure 3.5: Copy Object Dialog.
As when creating a new resource object, enter a unique name
for the object. Omit spaces and punctuation, and use a
descriptive name. When satisfied, select "Ok" to create the
copy.
3.8 Renaming a resource object.
─────────────────────────────────────────────────────────────────
For those occasions when you mistakenly enter a wrong name
that, PB/WORKSHOP allows you to rename a resource object.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
(c) Copyright 1993-1994 DSE Software Publishing 12
PB/WORKSHOP(tm) - Version 1.03
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
To rename an existing object, position the highlight bar in
the Project window over the intended object and select
"Object|Copy Rename" from the main menu. PB/WORKSHOP will
then display the "Copy Object" dialog:
┌─────────────── RENAME OBJECT ──────────────┐
│ │
│ ┌───────────────┐ ╔════════╗ │
│ Object Name: │CowList │ ║ Ok ║ │
│ └───────────────┘ ╚════════╝ │
│ ┌───────────────┐ ┌────────┐ │
│ New Name: │ │ │ Cancel │ │
│ └───────────────┘ └────────┘ │
│ ┌────────┐ │
│ │ Help │ │
│ └────────┘ │
└────────────────────────────────────────────┘
Figure 3.6: Rename Object Dialog.
The "Object Name" box displays the current name. Enter a
label in the "New Name" box and select "Ok".
3.9 Deleting a resource object.
─────────────────────────────────────────────────────────────────
To delete a resource object from a project, position the
highlight bar in the Project window over the intended object
and press the <DELete> key or select "Object|Delete" from
the main menu.
A dialog will appear requesting that you verify the
operation. Choose well.
3.10 Compiling a resource.
─────────────────────────────────────────────────────────────────
To include any PB/WORKSHOP resource objects in your own
programs, you are required to build a stand-alone resource
(RES) file. Selecting "Project|Resource Compiler" will
perform this task.
Resource compiling involves collecting all of the objects
you have created for a particular project, converting them
to a "memory image" format, and compressing them to take
take less disk space. All of the objects are placed into a
single file in your project subdirectory. This file has the
same name as your project, but with an "RES" extension.
In your own programs, you execute commands to retrieve
specific objects from the file and display them on the
screen.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
(c) Copyright 1993-1994 DSE Software Publishing 13
PB/WORKSHOP(tm) - Version 1.03
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
Also during the resource compilation process, PB/WORKSHOP
updates the project's $INCLUDE file by adding references for
any new objects and event code id's. Anything unused is
purged.
3.11 The ATTACH.EXE Utility
─────────────────────────────────────────────────────────────────
After you have created both an executable (EXE) file and a
resource (RES) file, you can combine them using the provided
ATTACH.EXE utility.
From your project subdirectory, run ATTACH.EXE with the name
of your project:
ATTACH hello
The ATTACH utility will then append the resource file
directly to the end of your program so that you need only
distribute file.
3.12 The HELPGEN.EXE Utility
─────────────────────────────────────────────────────────────────
Creating help screens is usually one of the last priorities
of product development. The HELPGEN.EXE utility provided
with PB/WORKSHOP keeps it that way.
As you create menus and data entry forms in PB/WORKSHOP, you
will be asked to enter a "Help Context Id" for each of the
various menu entries and form buttons. Were it not for
HELPGEN, you would have been required to plan your help
screens long before creating any interface objects.
When requested by PB/WORKSHOP to enter a Help Context Id for
a particular item, it is completely safe to enter a help
context Id that does not yet appear in the help source file.
HELPGEN will add these Id's after the fact.
To use HELPGEN, from your project subdirectory, enter:
HELPGEN project.
The HELPGEN utility will then scan your existing help source
file (project.TXT) and resource objects, and will then add
any contexts referenced in the objects but do not yet appear
in the help source. Nothing will be removed from your
original file at any time.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
(c) Copyright 1993-1994 DSE Software Publishing 14
PB/WORKSHOP(tm) - Version 1.03
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
Chapter 4
The Data Entry Form Editor.
█████████████████████████████████████████████████████████████████
This chapter describes the PB/WORKSHOP form editor.
4.1 Creating Data Entry Forms.
─────────────────────────────────────────────────────────────────
As described in section 3.4, create a new "FORM" object.
PB/VISION will load the Data Entry Form editor and display a
blank form in the center of the screen:
┌───────────────── NEW FORM ─────────────────────┐
│················································│
│················································│
│················································│
│················································│
│················································│
│················································│
│················································│
└────────────────────────────────────────────────┘
Figure 4.1: New Form.
You are now in the form editing mode.
From within the form editor, you can add, change, group,
move, reorder, resize, or delete buttons. You have total
control over what the form looks like and how it operates.
4.1.1 The "Properties" dialog.
─────────────────────────────────────────────────────────────────
Much of the customizing of forms and buttons will be
performed through the Properties dialog. This is the dialog
that also appears when a form object is created or edited.
From the Properties dialog you can control every aspect of
the form window and all of the buttons within it. There are
other, easier methods of changing certain properties and
they will be discussed at length in subsequent sections.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
(c) Copyright 1993-1994 DSE Software Publishing 15
PB/WORKSHOP(tm) - Version 1.03
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
┌┤■├─── BUTTON PROPERTIES ────┐
│┌───────────────────────────┐│
││ Object Box ││
│└───────────────────────────┘│
│┌───────────────────────────┐│
││ Settings Box ││
│└───────────────────────────┘│
│┌───────────────────────────┐│
││ Property 1___: █│
││ Property 2___: ■│
││ Property 3___: ░│
││ Property 4___: ░│
││ Property 5___: ░│
││ Property 6___: █│
│└───────────────────────────┘│
└─────────────────────────────┘
Figure 4.2: The Properties dialog.
The Properties window consists of three parts:
Object Box - Displays the name of each button in the
current form. Click on this box to select the button
to be edited.
Settings Box - This button lets you edit the setting
for the property selected in the Properties List. With
some properties, an arrow will appear indicating you
can make a selection from a list of possible values for
that property.
Properties List - This list displays all of the current
settings for the selected button.
Navigating through the Properties dialog with the mouse is
straightforward and merits no special advice. Navigating
via the keyboard, however, may seem a little cumbersome
until you teach your fingers the correct motions:
While at the Object Box, pressing <CR> will drop you to
the Properties List. Using the cursor keys you can
then move up or down the list until you find what you
are looking for.
Pressing <CR> again will move you to the Settings Box
where you can edit the property you just selected.
Press <CR> again and the property is made permanent and
you're back at the Properties List.
From here, press <TAB> and you are back at the Object
Box again.
Once you get the hang of it, it is quite efficient.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
(c) Copyright 1993-1994 DSE Software Publishing 16
PB/WORKSHOP(tm) - Version 1.03
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
4.1.2 The "Text Properties" Dialog.
─────────────────────────────────────────────────────────────────
The Text Properties dialog is one of the easier methods of
changing certain properties. Through the Text Properties
dialog, you can change one or more of 4 specific text
oriented properties. To display the Text Properties dialog,
press any alphanumeric key while the form is in focus:
┌────────────────── TEXT PROPERTIES ───────────────────┐
│ ┌──────────────────────────────┐ │
│ Caption: │ │ │
│ └──────────────────────────────┘ │
│ ┌────────────────────┐ │
│ Name: │ │ │
│ └────────────────────┘ │
│ ┌───────────────┐ ╔════════╗ │
│ Event ID:│ │ ║ Ok ║ │
│ └───────────────┘ ╚════════╝ │
│ ┌───────────────┐ ┌────────┐ │
│ Help ID: │ │ │ Cancel │ │
│ └───────────────┘ └────────┘ │
└──────────────────────────────────────────────────────┘
Figure 4.3: The Text Properties Window.
The Text Properties dialog allows you to modify any of the
following properties (if applicable):
Caption property - This is the caption displayed with
each button. It can also set the title of the current
form. Not all buttons have a caption.
Name property - This will be the name of the type
variable element PB/WORKSHOP will create when it
generates source code for your program. When used with
Command Buttons, this will be the "Group id" that
interconnects them. More on this later.
Event ID property - When PB/WORKSHOP generates source
code for your program, it uses this property as a label
to create custom event codes for command buttons. More
on this later.
Help ID property - This is the context name of the help
screen to bring up when <F1> is pressed in your
program. More on this later.
Depending on the type of button, some of the fields may not
appear in the Text Properties dialog.
After you have made any changes, select the "Ok" button to
make the changes take effect.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
(c) Copyright 1993-1994 DSE Software Publishing 17
PB/WORKSHOP(tm) - Version 1.03
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
4.1.3 The "Palette" dialog.
─────────────────────────────────────────────────────────────────
While editing a form or button in the form editor, you can
open the Palette dialog. This is a floating dialog (multi-
threading in PB/VISION) and can be left displayed
continuously.
┌┤■├──────────────── PALETTE ──────────────────┐
│┌────────────────────────────────────────────┐│
││Foreground: ░░▓▓░░▓▓░░▓▓■■▓▓░░▓▓░░▓▓░░▓▓░░▓▓││
││Background: ■■░░▓▓░░▓▓░░▓▓░░▓▓░░▓▓░░▓▓░░▓▓░░││
││ Ext. Fore: ░░▓▓░░▓▓░░▓▓░░▓▓░░▓▓░░▓▓░░▓▓░░■■││
││ Ext. Back: ■■░░▓▓░░▓▓░░▓▓░░▓▓░░▓▓░░▓▓░░▓▓░░││
│└────────────────────────────────────────────┘│
│ ┌───────────────────────────┐ ╔═══════════╗ │
│ │ Settings Box │ ║ Apply All ║ │
│ └───────────────────────────┘ ╚═══════════╝ │
│ ┌───────────────────────────┐ ┌───────────┐ │
│ │Color Property 1: █ │┌─────────┐│ │
│ │Color Property 2: ■ ││ Color ││ │
│ │Color Property 3: █ │└─────────┘│ │
│ └───────────────────────────┘ └───────────┘ │
└──────────────────────────────────────────────┘
Figure 4.4: The Palette Dialog.
From the Palette dialog you may modify any color related
property for the form or button in focus.
When coloring a button, the "Apply All" feature can be used
to color all similar buttons (of the same kind) at a single
pass. Color the current button as you normally would, and
then select "Apply All".
4.1.4 Navigating through the Dialogs.
─────────────────────────────────────────────────────────────────
With the potential of having three dialogs displayed
simultaneously, the screen may seem cluttered. You may
close the Properties or Palette Dialog without affecting the
ability to create buttons.
To switch between the different dialogs, press the <F6> key
or click the right mouse button. Each methods has the
effect of switching to the next logical window.
4.2 Working with buttons.
─────────────────────────────────────────────────────────────────
PB/WORKSHOP supports all of the button styles supported by
the PB/VISION library. These include:
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
(c) Copyright 1993-1994 DSE Software Publishing 18
PB/WORKSHOP(tm) - Version 1.03
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
■ Area Button ■ Creates an invisible "hot" area on a
form.
■ Check Box ■ Toggles the selection of an option On
or Off.
■ Combo Button ■ Allows user to select from a drop down
list.
■ Command Button ■ Invokes an event when selected.
■ Dir List ■ Allows selection of a directory path.
■ Drive List ■ Allows selection of a disk drive.
■ File List ■ Allows selection of a file.
■ HScrollbar ■ Allows selection of a value from a
scroll bar.
■ List Button ■ Allows selection from a list.
■ Option Button ■ Allows selection of an item in a
group.
■ Text button ■ Displays text that the user can edit.
■ VScrollbar ■ Allows selection of a value from a
scroll bar.
Also supported are two static buttons available only in
PB/WORKSHOP.
■ Label ■ Displays text that the user cannot
edit.
■ Box/Line ■ Displays a box that the user cannot
select.
The only equivalent they have in PB/VISION is the WINPRINT()
and WINDRAWBOX() subroutines. These objects cannot be
selected in a program.
4.2.1 Adding buttons.
─────────────────────────────────────────────────────────────────
To add a new button to a form, select a button type from the
"Button" pulldown menu in the form editor. PB/VISION will
then place a blank button of that type in the center of the
form being edited.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
(c) Copyright 1993-1994 DSE Software Publishing 19
PB/WORKSHOP(tm) - Version 1.03
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
4.2.2 Selecting buttons.
─────────────────────────────────────────────────────────────────
Pressing <TAB> or <SHIFT><TAB> in the form editor will move
you forward or backward through the list of buttons. You
may also move through the buttons by selecting the Object
Box in the Properties dialog and then use the cursor keys to
move up or down the list.
If you have a mouse, simply clicking on a particular button
will bring it into focus.
In some cases it may not be possible for you to click on a
particular button. If you have placed a static label or
frame box over a button, selection of that button can only
be made by using the <TAB> or <SHIFT><TAB> key, or by moving
the static object out of the way first.
You also have the option of reordering the sequence of the
buttons so that the static buttons are placed below the
dynamic buttons. This will be discussed in section 4.2.7.
4.2.3 Moving and resizing buttons.
─────────────────────────────────────────────────────────────────
To move or resize a button, you have the option of entering
the exact coordinates in the Properties dialog, or you can
move them manually using the keyboard or mouse.
4.2.3.1 Moving and resizing with the Properties dialog.
─────────────────────────────────────────────────────────────────
To move or resize one using the Properties dialog, you must
enter valid numbers into the following properties:
Row_______: vertical position
Column____: horizontal position
Rows______: vertical dimension
Columns___: horizontal dimension
Each property value is automatically verified. You cannot
change a button so that it would fall off the edge of
virtual of the form size or so that will be larger than the
preset size limits. Also, depending on the button type,
some of these properties may not be available.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
(c) Copyright 1993-1994 DSE Software Publishing 20
PB/WORKSHOP(tm) - Version 1.03
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
4.2.3.2 Moving and resizing buttons manually.
─────────────────────────────────────────────────────────────────
Using the mouse, you can change the width of a button
holding the left mouse button while the mouse cursor is
hovering above the lower right edge of the button.
When using the keyboard, holding down the <CTRL> key while
pressing any of the four directional cursor keys will allow
you to change the size of a button. Pressing any of the
four directional cursor keys without holding the <CTRL> key
will allow you to move it around the form.
With Command buttons, Combo buttons, and Text buttons,
changing the vertical dimension has the effect of changing
the button style between one of three styles, those being
Single line, shadowed, and box. Whatever the style chosen,
it will have no effect on the overall function of these
buttons.
4.2.4 Duplicating buttons.
─────────────────────────────────────────────────────────────────
When creating a series of similar buttons, it may be easier
to copy the "master" button into the Paste buffer and then
paste multiple copies.
To copy a button into the Paste buffer, select the button
you want to copy and press <CTRL><INS>. To paste a copy of
that button to the form, press <SHIFT><INS>.
You may also perform these operations by selecting
"Edit|Copy" and "Edit|Paste" from the pulldown menu.
4.2.5 Editing buttons.
─────────────────────────────────────────────────────────────────
After you have created a button, you may still go back and
edit any aspect of by using the Properties dialog (see
section 4.1.1), Text Properties dialog (section 4.1.2), or
the Palette dialog (section 4.1.3).
Each one of these property editing dialogs has its merits
when it comes to ease of use.
4.2.6 Editing specific button properties.
─────────────────────────────────────────────────────────────────
Some of the button properties shown in the Properties dialog
have no counterpart to the parameters passed to the same
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
(c) Copyright 1993-1994 DSE Software Publishing 21
PB/WORKSHOP(tm) - Version 1.03
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
routines in PB/VISION. Others are somewhat vague in their
representation of PB/VISION function call parameters. Let's
discuss a few.
4.2.6.1 The String Length property.
─────────────────────────────────────────────────────────────────
The "String Length" property defines the overall string
length of a Text button and should not be confused with the
"Cols" (columns) property. The maximum string length is set
to 255 characters, while the columns are set to the maximum
width of the form.
4.2.6.2 The Event ID property.
─────────────────────────────────────────────────────────────────
In PB/VISION, you are required to assign a unique event code
to each command button so that when one is pressed, the
event id code is returned by GETEVENT(). The assignment is
usually performed by creating a series of constants such as
"%cmOk", "%cmHelp", etc.
To assign an event code in PB/WORKSHOP, you must enter a
unique string label for the Event Id property. This id will
be used as the event code.
When PB/WORKSHOP compiles your project (see section 3.10),
it will add these labels to the project's $INCLUDE file and
reference them in your code where needed. Event code id's
like "Ok" or "Hello" will be added to the file as "%cmOk"
and "%cmHello".
Several event code id's are already defined by PB/WORKSHOP.
When PB/WORKSHOP generates your program, it adds code to
respond to these predefined events.
OK Closes the current form or menu.
CANCEL Closes the current form or menu.
HELP Displays a generic help screen.
EXIT Terminates execution of the program.
4.2.6.3 The Help ID property.
─────────────────────────────────────────────────────────────────
To add context sensitive help to your program, you must
enter the help context id's for each button in the form.
For the help context id, enter the name of a help context
defined in the help screen source file [project.TXT].
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
(c) Copyright 1993-1994 DSE Software Publishing 22
PB/WORKSHOP(tm) - Version 1.03
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
As an example, if your help screen source file has a context
that reads:
.context MyHelp
You would then enter the text "MyHelp" as the help context
id.
If you have not yet defined any help screens, you are still
permitted to enter help context id's, but you will have to
re-compile the resource file later. Until that time, the
default help screen will be displayed in its place.
To quickly assign help context id's to every button in the
form, you may select the "Global Help Id Assignment" dialog.
This feature is described at length in section 4.2.9.
As an added bonus PB/WORKSHOP includes a utility called
HELPGEN.EXE that can go through your project to find out
what help screens are referenced but do not actually exist.
It will then add labels for those screens to the help source
file.
4.2.6.4 The Name property.
─────────────────────────────────────────────────────────────────
The "Name" property (not to be confused with the "caption"
property) serves several purposes in PB/WORKSHOP.
The primary purpose of the Name property is to label the
type variable element for the form's type variable. If you
have a form object called "MyForm" and in it is a single
check box with the name "CheckMe", when PB/WORKSHOP compiles
the resource file it will add the following type variable
definition to the project's $INCLUDE file:
TYPE MyFormTYPE
checkme AS BYTE
END TYPE
If you were to add a List Button to that same form and give
it the name "MyList", PB/WORKSHOP would add this to the
project's $INCLUDE file:
TYPE MyFormTYPE
checkme AS BYTE
MyList AS INTEGER
END TYPE
DIM MyList$(1) AS SHARED STRING
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
(c) Copyright 1993-1994 DSE Software Publishing 23
PB/WORKSHOP(tm) - Version 1.03
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
The "MyList$()" array is the string array that will hold the
information being displayed in the list, and the "MyList%"
element in the type variable will refer to the current list
position.
The second use of the Name property will be discussed next.
4.2.6.5 Grouping related buttons.
─────────────────────────────────────────────────────────────────
Two button classes in PB/VISION, command buttons and option
buttons, can be grouped together so that when one button in
the group is selected, the other buttons in the group become
deselected.
To identify a button with a group, the "Name" property is
used. When two or more command buttons or option buttons
share the same Name property, they become linked together.
You can only group buttons of the same class. Command
buttons cannot be grouped with option buttons or vice-versa.
You may have up to 255 buttons in a single group.
It is important that all buttons within a group be in
logical sequence. You must not have non-grouped buttons
between a series of grouped buttons. Please read the next
section for information on how to correct any that are out
of sequence.
4.2.7 Reordering button sequence.
─────────────────────────────────────────────────────────────────
So that you are able to create buttons out of sequence and
be able to fix it later, PR/WORKSHOP provides the "Reorder
Buttons" dialog. To display this dialog, select
"Options|Reorder" from the pulldown menu:
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
(c) Copyright 1993-1994 DSE Software Publishing 24
PB/WORKSHOP(tm) - Version 1.03
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
┌──────────── REORDER BUTTONS ─────────────┐
│ │
│ ┌───────────────────────────┐ ┌────────┐ │
│ │form1 - FORM █ │ Done │ │
│ │FAXLIST - FILE ░ └────────┘ │
│ │Low Resolution - OPTION ░ ┌────────┐ │
│ │Normal Resolution - OPTION ░ │ Help │ │
│ │High Resolution - OPTION ░ └────────┘ │
│ │9 Pin Printer - OPTION ■ │
│ │24 Pin Printer - OPTION ░ │
│ │Laser Printer - OPTION ░ │
│ │Print Actual Size - CHECK ░ │
│ │Suppress Errors - CHECK ░ │
│ │View Fax - COMMAND █ │
│ └───────────────────────────┘ │
│ ┌───┐ ┌───┐ ╔════════════╗ │
│ │ U │ │ D │ ║ Smart Sort ║ │
│ └───┘ └───┘ ╚════════════╝ │
└──────────────────────────────────────────┘
Figure 4.5: The Reorder Buttons Dialog.
To move a button, position the highlight bar over the
desired button and press one of the up or down pointing
direction buttons. The button will be moved in direction
you requested.
To facilitate the quick organization of groups of command
buttons and option buttons, the "Smart Sort" feature is
provided. The feature will put all of the buttons belonging
to a group in logical sequence.
When you are satisfied with the ordering of the buttons,
select "Done".
4.2.8 Creating Custom Input Masks.
─────────────────────────────────────────────────────────────────
PB/WORKSHOP allows for the creation of custom input masks
for Text buttons. To create or edit a custom input mask,
select "Options|Edit Custom Input Mask" from the pulldown
menu. PB/WORKSHOP will then display the "Edit Custom Input
Masks" dialog:
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
(c) Copyright 1993-1994 DSE Software Publishing 25
PB/WORKSHOP(tm) - Version 1.03
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
┌───────────── EDIT CUSTOM INPUT MASKS ─────────────┐
│ ┌───┐┌──────────────────────────────────────────┐ │
│ │ 1││99-99-9999 │ │
│ └───┘└──────────────────────────────────────────┘ │
│ ┌───────────────────────────────────────────────┐ │
│ │99-99-9999 █ │
│ │(999) 999-9999 ░ │
│ │AA-999 ■ │
│ │ ░ │
│ │ ░ │
│ │ ░ │
│ │ ░ │
│ │ ░ │
│ │ █ │
│ └───────────────────────────────────────────────┘ │
│ ╔════════╗ ┌────────┐ ┌────────┐ │
│ ║ Ok ║ │ Cancel │ │ Help │ │
│ ╚════════╝ └────────┘ └────────┘ │
└───────────────────────────────────────────────────┘
Figure 4.6: The Custom Input Masks Dialog.
To create a custom input mask, position the highlight bar
over a blank entry and press <CR>. You may then begin
entering valid mask characters. Valid characters include:
Code Description
───── ─────────────────────────────────
A Alphabetic (a-z, A-Z).
9 Decimal digit.
# Digit, sign, or blank.
N Alphanumeric.
L Logical (Y,y,N,n).
X Any character.
! Convert to upper case.
Some examples are:
Mask Valid input
──────────── ─────────────────────────────────────
"99/99/9999" 11/21/1962
"!!-NNNN" ZZ-543S
"AAAAAAAAAA" PB/VISION or pb/vision
"A!A!A!A!A!" pB/ViSiOn
"L" Y or N
In PB/WORKSHOP, you may define up to 32 custom masks per
project.
To reference a custom input mask in a PB/WORKSHOP Text
button, select the "Masks" property from the Properties
list. Next, select the mask from the settings combo button.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
(c) Copyright 1993-1994 DSE Software Publishing 26
PB/WORKSHOP(tm) - Version 1.03
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
When PB/WORKSHOP generates the source code for your program,
it will add a TEXTBUTTONMASK() call for each custom input
mask defined.
4.2.9 Global Help Assignment.
─────────────────────────────────────────────────────────────────
The "Global Help Id Assignment" dialog allows you to set the
help context id property for all of the buttons in the
current form at one time. To display this dialog, select
"Options|"Global Help Id Assignment" from the pulldown menu:
┌────────── GLOBAL HELP ID ASSIGNMENT ──────────┐
│ ┌──────────────────┐ │
│ Help Context ID Text: │ │ │
│ └──────────────────┘ │
│╔══════════════╗┌─────────────┐┌──────────────┐│
│║ Use Text ║│ Auto Assign ││ Cancel ││
│╚══════════════╝└─────────────┘└──────────────┘│
└───────────────────────────────────────────────┘
Figure 4.7: Global Help Id Assignment Dialog.
To set all of the help context id properties to a single
common help context id, enter a Help context id into the
text button and select the "Use Text" button.
The "Auto Assign" button will perform an intelligent auto
assignment of each help context id property. For command
buttons, the Help context id property will be set to match
the Event Id property. With all other types of buttons, the
Help context id property will be set to match the Name
property.
4.2.10 Form Code Generation.
─────────────────────────────────────────────────────────────────
Before PB/WORKSHOP can generate source code for a form, the
"Source Code Generation" dialog must be filled in properly.
To display this dialog, select "Options|Form Code
Generation" from the pulldown menu:
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
(c) Copyright 1993-1994 DSE Software Publishing 27
PB/WORKSHOP(tm) - Version 1.03
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
┌──────── SOURCE CODE GENERATION ─────────┐
│ │
│ ┌ SUB/FUNCTION────────┐ ╔════════════╗ │
│ │MyForm │ ║ Ok ║ │
│ └─────────────────────┘ ╚════════════╝ │
│ ┌ Initialization──────┐ ┌────────────┐ │
│ │ ( ) Create Inline │ │ Cancel │ │
│ │ (*) Load Resource │ └────────────┘ │
│ └─────────────────────┘ ┌────────────┐ │
│ ┌ Display ────────────┐ │ Help │ │
│ │ [ ] Show at Runtime │ └────────────┘ │
│ │ [X] Show on Event │ ┌────────────┐ │
│ │ [MyForm ] │ │ Quick Code │ │
│ └─────────────────────┘ └────────────┘ │
│ ┌ Flow Control ───────┐ │
│ │ (*) Modal │ │
│ │ ( ) Multi-Threading │ │
│ │ [X] Lock Window │ │
│ │ [X] Close on <CR> │ │
│ │ [X] Close on <ESC> │ │
│ └─────────────────────┘ │
└─────────────────────────────────────────┘
Figure 4.8: Form Code Generation Dialog.
In the Sub/Function box, PB/WORKSHOP displays the name of
the current form object. When PB/WORKSHOP generates source
code, the function or sub names will begin with the form
object name and end with either ".INIT" and/or ".ROUTINE":
SUB MyForm.INIT ()
FUNCTION MyForm.ROUTINE% ()
The type variable definition created for this form will also
use the same key word:
TYPE MyFormTYPE
...
END TYPE
When loading a data entry form in a program, the form object
will be referred to as "%rc" + the form object name, e.g.
"%rcMyForm".
4.2.10.1 Form Initialization
─────────────────────────────────────────────────────────────────
The Initialization box in the Source Code Generation dialog
determines how the form will be created.
When "Create Inline" is selected, PB/WORKSHOP generates a
function call for each button. If your program has more
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
(c) Copyright 1993-1994 DSE Software Publishing 28
PB/WORKSHOP(tm) - Version 1.03
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
than one form, this will increase the size of your
executable file and memory usage substantially.
The "Load Resource" generates a single line of code that
loads the entire form from a compiled resource (.RES) file.
It is fast, memory efficient, and the recommended method of
loading forms.
4.2.10.2 Form Display Options
─────────────────────────────────────────────────────────────────
The "Form Display Options" box in the Source Code Generation
dialog determines when the form will be displayed.
To have the form displayed when the program begins, enable
the "Show at Runtime" check box.
The "Show on Event" option will add code to allow the form
to be displayed whenever a particular event is returned by
GETEVENT(). Enter the name of that Event code id in the
text button below.
4.2.10.3 Form Flow Control
─────────────────────────────────────────────────────────────────
PB/VISION can create forms that are either Modal or Multi-
Threading. Either selection will generate code appropriate
for that style.
"Modal" means that the user cannot select any other
interface object until the form is closed. "Multi-Threading"
means the form can run concurrently with other multi-
threading objects. These topics are discussed thoroughly in
the PB/VISION tutorial.
To lock the form in place when it is displayed, enable the
"Lock Window" check box. This is the default mode for modal
forms. Enabling the "Close on <CR>" or "Close on <ESC>
check boxes will add code to close the form when either of
those keys is pressed.
4.2.10.4 Quick Code
─────────────────────────────────────────────────────────────────
To create code only for the current form, select the "Quick
Code" button in the Source Code Generation dialog.
PB/VISION will then request the name of the file to create:
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
(c) Copyright 1993-1994 DSE Software Publishing 29
PB/WORKSHOP(tm) - Version 1.03
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
┌─────────── FILENAME TO CREATE ───────────┐
│ │
│┌────────────────────────────────────────┐│
││ ││
│└────────────────────────────────────────┘│
│ ╔════════╗ ┌────────┐ │
│ ║ Ok ║ │ Cancel │ │
│ ╚════════╝ └────────┘ │
└──────────────────────────────────────────┘
Figure 4.9: Quick Code File Creation Dialog.
Enter a valid filename and select "Ok". If the file already
exists, you will have the option of appending the form to
the existing file or overwrite the file completely.
4.3 Testing a Data Entry Form.
─────────────────────────────────────────────────────────────────
The form editor makes it easy to test your data entry form
at any time. This way you can see the effects of any
changes that were made. To test your form, select
"Object:Test Form" from the pulldown menu or press <F5>.
You can use <TAB> and <SHIFT><TAB>, or the defined
accelerator keys to move around the form. Use the test mode
to make sure that your buttons are in the proper order.
To leave the test mode, press <ESC> or click the right mouse
button.
4.4 Saving a Data Entry Form.
─────────────────────────────────────────────────────────────────
To save a form that has been edited, select "Form|Save Form"
from the pulldown menu, or press <F2>.
As a precaution against power loss, you should save your
work often.
4.5 Exiting the Data Entry Form Editor.
─────────────────────────────────────────────────────────────────
To exit the form editor, select "Form:Exit Form Editor" from
the pulldown menu, or press <F10>. You will have the
opportunity to save your work if it has not yet been saved.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
(c) Copyright 1993-1994 DSE Software Publishing 30
PB/WORKSHOP(tm) - Version 1.03
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
4.6 A Sample Data Entry Form.
─────────────────────────────────────────────────────────────────
PB/WORKSHOP includes a starter project that will give you an
idea what it is like to work with data entry forms. If you
haven't yet loaded PB/WORKSHOP, please load it now and
follow these steps:
1. Select "Project|Open Project".
2. Using the "Project Open" dialog, locate and open the
"PBWDEMO.PRJ" file. Upon opening the project, the
Project window will appear.
┌─── PBWDEMO.PRJ ───┐
│[FORM] █
│ EditMember ░
│[POPMENU] ■
│[PULLMENU] ░
│[STATUS] ░
│ ░
│ ░
│ ░
│ █
└───────────────────┘
Figure 4.10: The Project Window for PBWDEMO.PRJ.
3. In the Project window, select the "EditMember" form.
The form editor will be displayed, and the selected
form will load.
Now is the time to experiment a little. Select each of the
buttons in the form and see what properties each has. See
how the command buttons and option buttons use the "Name"
property to group them together. See how the Text button
"Mask" property controls input to the Text button.
You can also test this form to see how it will run in a
compiled program. Select "Options|Test", or press <F5>. To
exit the test mode, press the <ESC> button or click the
right mouse button.
To exit this form, select "Form|Exit" or press <F10>.
4.6.1 Creating a new data entry form.
─────────────────────────────────────────────────────────────────
You have already experimented with working with existing
forms. Now you will get to create one of your own. Before
creating any form, however, there are several things you
will have to take into consideration.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
(c) Copyright 1993-1994 DSE Software Publishing 31
PB/WORKSHOP(tm) - Version 1.03
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
1. What should the form window look like? What colors and
border styles will you use? Will it be modal or
multi-threading?
2. What kinds of buttons will be used in the form?
Some queries are mutually exclusive and will require a
group of Option buttons. What if you need to accept a
file name, will you use a Text button or a File list,
or maybe even both.
Let's create a form that allows the user to enter some text
and make a couple of printing choices. This is how it
should look:
┌──── Print a String ────┐
│ ┌────────────────────┐ │
│ │ │ │
│ └────────────────────┘ │
│ ┌ Format ────────────┐ │
│ │ [ ] Bold │ │
│ │ [ ] Underlined │ │
│ │ [ ] Italic │ │
│ └────────────────────┘ │
│ ╔════════╗ ┌────────┐ │
│ ║ Ok ║ │ Cancel │ │
│ ╚════════╝ └────────┘ │
└────────────────────────┘
Figure 4.11: The Sample Data Entry Form.
From the top down, let's talk about what this form has.
1. This form has a caption that reads "Print a String".
2. There is a text button where the user can enter some
text.
3. There are three check boxes to choose a formatting
style.
4. Around the check boxes is a single frame.
5. There are two grouped command buttons that the user can
press.
4.6.1.1 Adding the new form.
─────────────────────────────────────────────────────────────────
Now let's test your skills at creating this same form.
1. Select "Object|New".
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
(c) Copyright 1993-1994 DSE Software Publishing 32
PB/WORKSHOP(tm) - Version 1.03
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
2. In the "Create New Object" dialog, enter "PrintIt".
Select the "FORM" option button, and then "Ok".
You are now in the form editor and should have a blank
form sitting before your eyes.
3. Bring the form into focus by clicking on the form with
the mouse, or by cycling though the windows by pressing
the right mouse button. You can also press <F6>.
4. Press the <SPACE> bar to bring up the Text Properties
dialog. Enter "Print a String" and select "OK".
4.6.1.2 Adding a text button.
─────────────────────────────────────────────────────────────────
Let's add a Text button.
1. Select "Buttons|Text button". A text button will
appear in the center of the form.
2. Using the mouse or cursor keys, move the text button to
the top left edge of the border.
3. Again, using the mouse or cursor keys (while holding
down the <CTRL> key), resize the Text button so that it
is 20 characters wide and 3 rows deep.
4. Press the <SPACE> bar again to bring up the Text
Properties dialog. For the Name property, enter "Text"
and for Help context Id property enter anything you
want. Select "Ok" to close the Text Properties dialog.
4.6.1.3 Adding check boxes.
─────────────────────────────────────────────────────────────────
And now for three check boxes and a box frame:
1. Select "Buttons|Check Box". Position the check box
below the text button while leaving room for the box
frame.
2. Press <CTRL><INS> to copy the check box button into the
paste buffer. Press <SHIFT><INS> to paste two copies
of the check box button. Move both buttons to
positions below the first check box.
3. Add Captions and Names to each button by selecting the
Text Properties dialog for each one. Label them
"~B~old", "~U~nderlined", and "~I~talic". The tilde
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
(c) Copyright 1993-1994 DSE Software Publishing 33
PB/WORKSHOP(tm) - Version 1.03
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
(~) character will give the enclosed characters a
different color when the color properties are added.
For the button names, use "Bold", "Underline", and
"Italic" respectively.
4. Add the frame by selecting "Buttons|Frame" and place it
around the check boxes. Using the Text Properties
dialog, give it the caption "Format".
4.6.1.4 Adding command buttons.
─────────────────────────────────────────────────────────────────
With the Check boxes added, you're now ready to add a couple
of Command buttons.
1. Select "Buttons|Command Button". Move it below the box
frame surrounding the Check boxes. Add another Command
button just to the right of the first.
2. Using the Text Properties dialog, add "Ok" and "Cancel"
captions to each button. Use "Ok" and Cancel" for the
Names property also. For the Event Id properties in
each button, use the word "Action".
4.6.1.5 Adding some color to the form and buttons.
─────────────────────────────────────────────────────────────────
To customize the color of the buttons and form, follow these
instructions:
1. Select "Window|Color Palette" or press <F7> to display
the Palette dialog.
2. Click the right mouse button or press <F6> until the
form window comes into focus. Select a button and then
bring the Palette dialog back into focus.
3. Click on the color tiles of the Palette window to
change the button color. When coloring the check boxes
or command buttons, select "Apply All" to color them
similarly.
4.6.1.6 Testing, fixing, and saving the form.
─────────────────────────────────────────────────────────────────
After adding buttons to the form, you should should test it
to make sure that the colors are correct and that the
buttons are in proper order.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
(c) Copyright 1993-1994 DSE Software Publishing 34
PB/WORKSHOP(tm) - Version 1.03
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
If any buttons are out of order, select "Options|Reorder"
and place them in the proper sequence.
When finished, save the form and exit the form editor.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
(c) Copyright 1993-1994 DSE Software Publishing 35
PB/WORKSHOP(tm) - Version 1.03
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
Chapter 5
Creating menus.
█████████████████████████████████████████████████████████████████
This chapter describes the PB/WORKSHOP Pulldown and Popup
Menu Editors. Since both editors are nearly identical in
operation, this chapter will describe them as a whole, only
noting the differences.
5.1 The Menu editors.
─────────────────────────────────────────────────────────────────
Each menu editor consists of the menu entry property boxes,
menu entry list, outlining buttons, and several command
buttons:
5.1.1 Menu properties.
─────────────────────────────────────────────────────────────────
Much of the customizing of menus is performed by editing the
menu entry properties. Properties that can be set are the
menu entry caption, help context id, event id, and state.
┌──────────────────────────────────────────────────────┐
│ ┌──────────────────────┐ │
│ Caption: │ │ ┌ State ────────┐ │
│ └──────────────────────┘ │ ( ) Cross Bar │ │
│ ┌──────────────────┐ │ ( ) Grid │ │
│ Event ID:│ │ │ ( ) Disabled │ │
│ └──────────────────┘ │ (*) Enabled │ │
│ ┌──────────────────┐ │ ( ) Checked │ │
│ Help ID: │ │ └───────────────┘ │
│ └──────────────────┘ │
└──────────────────────────────────────────────────────┘
Figure 5.1: Menu Properties.
Menu Caption property - This is the caption displayed with
each menu entry. Menu entries to be used as a separating
cross bar will not have a caption.
Menu Event ID property - When PB/WORKSHOP generates source
code for your program, it uses this property as a label to
create custom event codes for each menu entry.
Menu Help ID property - This is the context name of the help
screen to bring up when <F1> is pressed while at a specific
menu entry.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
(c) Copyright 1993-1994 DSE Software Publishing 36
PB/WORKSHOP(tm) - Version 1.03
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
Menu State property - Sets visual and physical attributes
for the menu entry.
5.2 The menu entry list.
─────────────────────────────────────────────────────────────────
The menu entry list shows all of the menu entries added to a
menu.
┌───────────────────────────────────────────────────┐
│Project █
│ New project... ■
│ Open project... ░
│ Close project ░
│ ── ░
│ Resource compiler ░
│ ── █
└───────────────────────────────────────────────────┘
Figure 5.2: Menu entry list.
If the menu is a pulldown menu, the menu entry list will
also show the hierarchy of the menu entries. Menu bar
entries are flush left and sub menu entries are indented.
If the menu is a popup menu, the first entry will be used as
the caption for the menu. The indented entries are the
actual menu entry captions.
5.3 Menu outlining buttons
─────────────────────────────────────────────────────────────────
The menu outlining buttons allow for the selection,
insertion, deletion, setting of hierarchy, and reordering of
menu entries.
┌───────────────────────────────────────────────────────┐
│ ╔════════╗ ┌────────┐ ┌────────┐ ┌───┐┌───┐┌───┐┌───┐ │
│ ║ Next ║ │ Insert │ │ Delete │ │ L ││ R ││ U ││ D │ │
│ ╚════════╝ └────────┘ └────────┘ └───┘└───┘└───┘└───┘ │
└───────────────────────────────────────────────────────┘
Figure 5.3: Menu outlining keys.
5.4 Starting a menu editor.
─────────────────────────────────────────────────────────────────
Creating a menu is accomplished by selecting "Object|New"
from the pulldown menu. When the "Create New Object" dialog
appears, select the appropriate menu type, enter an object
name and select "Ok". PB/VISION will then display the
appropriate menu editor.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
(c) Copyright 1993-1994 DSE Software Publishing 37
PB/WORKSHOP(tm) - Version 1.03
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
5.4.1 Adding menu entries.
─────────────────────────────────────────────────────────────────
To add a new entry to a menu, double-click one of the
entries in the list, or position the highlight bar over an
entry and press <CR>. This will advance you to the caption
property box.
5.4.1.1 Entering menu captions.
─────────────────────────────────────────────────────────────────
Text entered into the caption property is the text that will
be displayed in the menu.
By enclosing a single letter of a caption between two tilde
(~) characters, that letter will become the accelerator key
for that menu entry. The letter used as the accelerator
will also be colored differently from the rest of the text.
It is permissible to enclose other parts of the same menu
entry caption between tile character so as to color them
differently, but only the first letter after the first tilde
will be used as an accelerator.
For the caption to take effect, you must either press <CR>
or select another menu entry.
5.4.1.2 Menu entry event id.
─────────────────────────────────────────────────────────────────
With the exception of a menu bar entry (pulldown menus
only), each menu entry must have an event id assigned to it.
When PB/WORKSHOP compiles your project (see chapter 3.10),
it will add each event id to the project's $INCLUDE file.
It will also add references to each event in a "SELECT CASE"
structure when it generates the program source code.
Several event code id's are already defined by PB/WORKSHOP.
When PB/WORKSHOP generates your program, it adds code to
respond to these predefined events.
OK Closes the current form or menu.
CANCEL Closes the current form or menu.
HELP Displays a generic help screen.
EXIT Terminates execution of the program.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
(c) Copyright 1993-1994 DSE Software Publishing 38
PB/WORKSHOP(tm) - Version 1.03
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
5.4.1.3 Menu entry help id.
─────────────────────────────────────────────────────────────────
To add context sensitive help to a menu entry, for the help
id property, enter the name of a help screen context as it
appears in the help source file.
If you have not yet added screens to the help source file,
you may still enter a help id, but you will need to re-
compile the project resource file once the screens are
added.
5.4.1.4 Moving menu entries.
─────────────────────────────────────────────────────────────────
To move menu entries around or to change the menu hierarchy,
the menu outlining buttons are provided.
To change the position of an entry, highlight an entry from
the list and then press the up or down outlining buttons.
The entry will move incrementally each time an outlining
button is pressed.
If the menu is a pulldown menu, the left outlining button
will make the entry a menu bar entry. The right outlining
button will make the entry a sub menu entry.
5.5 Menu palette dialog.
─────────────────────────────────────────────────────────────────
To customize menu colors, select the "Palette" button.
PB/WORKSHOP will then display the "Menu Palette" dialog.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
(c) Copyright 1993-1994 DSE Software Publishing 39
PB/WORKSHOP(tm) - Version 1.03
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
┌───────────────────── MENU PALETTE ──────────────────────┐
│┌────────────────────────────────────────────┐ ╔════════╗│
││Foreground: ■■▒▒░░▒▒░░▒▒░░▒▒░░▒▒░░▒▒░░▒▒░░▒▒│ ║ Ok ║│
││Background: ▒▒░░▒▒░░▒▒░░▒▒░░■■░░▒▒░░▒▒░░▒▒░░│ ╚════════╝│
││ Ext. Fore: ░░▒▒░░▒▒░░▒▒░░▒▒░░▒▒░░▒▒░░▒▒░░■■│ ┌────────┐│
││ Ext. Back: ▒▒░░▒▒░░▒▒░░▒▒░░■■░░▒▒░░▒▒░░▒▒░░│ │ Cancel ││
│└────────────────────────────────────────────┘ └────────┘│
│┌───────────────────────────────┐┌──────────────────────┐│
││ Settings box ││ File Edit Window ││
│└───────────────────────────────┘│ ┌──────────────────┐ ││
│┌ Property──────────────────────┐│ │ New File │ ││
││ ( ) Color ││ │ Open File │ ││
││ ( ) Highlight Color ││ │──────────────────│ ││
││ ( ) Border Color ││ │ Save File │ ││
││ ( ) Caption Color ││ │──────────────────│ ││
││ ( ) Cross Bar ││ │ Exit Program │ ││
│└───────────────────────────────┘│ └──────────────────┘ ││
│┌ Flags & Icons─────────────────┐│ ││
││ [ ] %AUTOCLOSE [ ] %NOBORDER ││ ││
││ [ ] %BOTTOMBAR [ ] %NOHIDE ││ ││
││ [ ] %CONTROL [ ] %NOSELECT ││ ││
││ [ ] %DRAGBAR [X] %SHADOW ││ ││
│└───────────────────────────────┘└──────────────────────┘│
└─────────────────────────────────────────────────────────┘
Figure 5.4: The Menu Palette Dialog.
From the Menu Palette dialog you may modify the color
properties for the menu. If the menu is a popup menu, you
can also toggle various visual icons. The purpose of these
icons are described in the PB/VISION documentation.
As you modify the color and visual properties, the sample
menu in the lower right corner will provide a visual
representation of the current settings.
To close the Menu Palette dialog, select "Ok".
5.5.1 Menu code generation.
─────────────────────────────────────────────────────────────────
Before PB/WORKSHOP can generate source code for a menu, the
Source Code Generation dialog for the menu must be filled in
properly. To display this dialog, select the "Code" button
located at the bottom right corner of the menu editor
dialog.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
(c) Copyright 1993-1994 DSE Software Publishing 40
PB/WORKSHOP(tm) - Version 1.03
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
┌──────── SOURCE CODE GENERATION ─────────┐
│ │
│ ┌ SUB/FUNCTION────────┐ ╔════════════╗ │
│ │MyMenu │ ║ Ok ║ │
│ └─────────────────────┘ ╚════════════╝ │
│ ┌ Initialization──────┐ ┌────────────┐ │
│ │ ( ) Create Inline │ │ Cancel │ │
│ │ (*) Load Resource │ └────────────┘ │
│ └─────────────────────┘ ┌────────────┐ │
│ ┌ Display ────────────┐ │ Help │ │
│ │ [ ] Show at Runtime │ └────────────┘ │
│ │ [X] Show on Event │ ┌────────────┐ │
│ │ [MyForm ] │ │ Quick Code │ │
│ └─────────────────────┘ └────────────┘ │
│ ┌ Flow Control ───────┐ │
│ │ (*) Modal │ │
│ │ ( ) Multi-Threading │ │
│ │ [X] Lock Window │ │
│ │ [X] Close on <CR> │ │
│ │ [X] Close on <ESC> │ │
│ └─────────────────────┘ │
└─────────────────────────────────────────┘
Figure 5.5: Menu Code Generation Dialog.
In the Sub/Function box, PB/WORKSHOP displays the name of
the current menu object. When PB/WORKSHOP generates source
code, the function and sub names it creates will begin with
the menu object name and end with either ".INIT" and/or
".ROUTINE":
When loading the menu in a program, the menu object will be
referred to as "%rc" + the menu object name, e.g.
"%rcMyMenu".
5.5.1.1 Menu initialization.
─────────────────────────────────────────────────────────────────
The Initialization box in the Source Code Generation dialog
determines how the menu will be created.
When "Create Inline" is selected, PB/WORKSHOP will generate
POPMENUADD() or PULLMENUADD() function calls for each menu
entry. If your menu has more than a few entries, this will
increase the size of your executable file and memory usage
substantially.
The "Load Resource" generates a single line of code that
loads the entire menu from a compiled resource (.RES) file.
It is fast, memory efficient, and the recommended method of
loading menus.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
(c) Copyright 1993-1994 DSE Software Publishing 41
PB/WORKSHOP(tm) - Version 1.03
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
5.5.1.2 Menu display options.
─────────────────────────────────────────────────────────────────
The Menu Display Options box in the Source Code Generation
dialog determines when the menu will be displayed.
To have the menu displayed when the program begins, enable
the "Show at Runtime" check box.
The "Show on Event" check box will add code to have the menu
displayed whenever a particular event is returned by
GETEVENT(). You must enter the event code id to respond to
in the text field below.
5.5.1.3 Menu flow control.
─────────────────────────────────────────────────────────────────
When generating popup menus, PB/VISION can create menus that
are either Modal or Multi-Threading.
"Modal" means that the user cannot select any other
interface object until the popup menu is closed. "Multi-
Threading" means the menu can run concurrently with other
multi-threading objects. These topics are discussed
thoroughly in the PB/VISION tutorial.
To lock the popup menu in place when it is displayed, enable
the "Lock Window" check box. This is the default mode for
modal menus. Enabling the "Close on <CR>" or "Close on
<ESC>" check boxes will add code to close the menu when a
menu entry is selected or when the <ESC> key is pressed.
5.5.1.4 Quick Code
─────────────────────────────────────────────────────────────────
To create code only for the current menu, select the "Quick
Code" button in the Source Code Generation dialog.
PB/VISION will then request the name of the file to create:
┌─────────── FILENAME TO CREATE ───────────┐
│ │
│┌────────────────────────────────────────┐│
││ ││
│└────────────────────────────────────────┘│
│ ╔════════╗ ┌────────┐ │
│ ║ Ok ║ │ Cancel │ │
│ ╚════════╝ └────────┘ │
└──────────────────────────────────────────┘
Figure 5.6: Quick Code File Creation Dialog.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
(c) Copyright 1993-1994 DSE Software Publishing 42
PB/WORKSHOP(tm) - Version 1.03
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
Enter a valid filename and select "Ok". If the file already
exists, you will have the option of appending it to the
existing file or overwriting the file completely.
5.6 Saving a menu
─────────────────────────────────────────────────────────────────
To save a menu that you have created, select the "Ok" button
in Source Code Generation dialog.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
(c) Copyright 1993-1994 DSE Software Publishing 43
PB/WORKSHOP(tm) - Version 1.03
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
Chapter 6
Creating Status bars.
█████████████████████████████████████████████████████████████████
This chapter describes the PB/WORKSHOP Status bar Editor.
6.1 The Status bar editor.
─────────────────────────────────────────────────────────────────
The Status bar editor consists of the status entry
properties boxes, status entry list, outlining buttons, and
several command buttons:
6.1.1 Status bar properties.
─────────────────────────────────────────────────────────────────
Much of the customizing of menus is performed by editing the
status bar entry properties. Properties that can be defined
are the caption, event code id, accelerator key, and state.
┌─────────────────────────────────┐
│ ┌────────────────────┐ │
│ Caption: │~F1~=Help │ │
│ └────────────────────┘ │
│ ┌────────────────────┐ │
│ Event ID:│Help │ │
│ └────────────────────┘ │
│ │
│ ┌ State ───────┐ │
│ │ (*) Disabled │ │
│ │ ( ) Enabled │ │
│ └──────────────┘ │
└─────────────────────────────────┘
Figure 6.1: Status Bar Properties.
Status bar caption property - This is the caption displayed
at each Status bar entry.
Status bar event id property - When PB/WORKSHOP generates
source code for your program, it uses this property as a
label to create custom event codes for each Status bar
entry.
Status bar state property - Sets visual and physical
attributes for the Status bar entry. Status bar entries can
be either enabled or disabled.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
(c) Copyright 1993-1994 DSE Software Publishing 44
PB/WORKSHOP(tm) - Version 1.03
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
6.2 The status bar entry list.
─────────────────────────────────────────────────────────────────
The status bar entry list shows all of the entries added to
a status bar.
┌───────────────────────────────────────────────┐
│F1=Help █
│F2=Save ■
│F5=Test ░
│F7=Palette ░
│F10=Done ░
│ ░
│ ░
│ █
└───────────────────────────────────────────────┘
Figure 6.2: Status bar entry list.
6.3 Status bar outlining buttons.
─────────────────────────────────────────────────────────────────
The status bar outlining buttons allow for the selection,
insertion, deletion, and reordering of status bar entries.
┌──────────────────────────────────────────────┐
│ ╔════════╗ ┌────────┐ ┌────────┐ ┌───┐┌───┐ │
│ ║ Next ║ │ Insert │ │ Delete │ │ U ││ D │ │
│ ╚════════╝ └────────┘ └────────┘ └───┘└───┘ │
└──────────────────────────────────────────────┘
Figure 6.3: Menu Outlining Keys.
6.4 Starting the status object editor.
─────────────────────────────────────────────────────────────────
Creating a status bar object is accomplished by selecting
"Object|New" from the pulldown menu. When the "Create New
Object" dialog appears, enter an object name, select the
"STATUS" option, and press "Ok". PB/VISION will then
display the status object editor.
6.4.1 Adding Status bar entries.
─────────────────────────────────────────────────────────────────
To add a new entry to a status bar, double-click one of he
entries in the list, or position the highlight bar over and
entry and press <CR>. This will advance you to the caption
property box.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
(c) Copyright 1993-1994 DSE Software Publishing 45
PB/WORKSHOP(tm) - Version 1.03
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
6.4.1.1 Entering Status bar captions.
─────────────────────────────────────────────────────────────────
Text entered into the caption property is the text that will
be displayed in the menu.
By enclosing portions of a caption between two tilde (~)
characters, those portions will be colored differently from
the rest of the text. This has no effect on the operation
of the Status bar entry.
For the caption to take effect, you must either press <CR>
or select another entry.
6.4.1.2 Status bar entry event id.
─────────────────────────────────────────────────────────────────
When PB/WORKSHOP compiles your project (see chapter 3.10),
it will add each event code id to the project's $INCLUDE
file. It will also add references to each event in a
"SELECT CASE" structure when it generates the program source
code.
Several event code id's are already defined by PB/WORKSHOP.
When PB/WORKSHOP generates your program, it adds code to
respond to these predefined events.
HELP Displays a generic help screen.
EXIT Terminates execution of the program.
6.4.1.3 Moving status bar entries.
─────────────────────────────────────────────────────────────────
To move Status bar entries around, the outlining buttons are
provided.
To change the position of an entry, highlight an entry from
the list and then press the up or down outlining buttons.
The entry will move incrementally each time an outlining
button is pressed.
6.5 Status bar Palette Dialog.
─────────────────────────────────────────────────────────────────
To customize the colors in a status bar, select the
"Palette" button. PB/WORKSHOP will then display the "Status
Bar Palette" dialog.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
(c) Copyright 1993-1994 DSE Software Publishing 46
PB/WORKSHOP(tm) - Version 1.03
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
┌─────────────────── STATUSBAR PALETTE ───────────────────┐
│┌────────────────────────────────────────────┐ ╔════════╗│
││Foreground: ■■▒▒░░▒▒░░▒▒░░▒▒░░▒▒░░▒▒░░▒▒░░▒▒│ ║ Ok ║│
││Background: ▒▒░░▒▒░░▒▒░░▒▒░░■■░░▒▒░░▒▒░░▒▒░░│ ╚════════╝│
││ Ext. Fore: ░░▒▒░░▒▒░░▒▒░░▒▒░░▒▒░░▒▒░░▒▒░░■■│ ┌────────┐│
││ Ext. Back: ▒▒░░▒▒░░▒▒░░▒▒░░■■░░▒▒░░▒▒░░▒▒░░│ │ Cancel ││
│└────────────────────────────────────────────┘ └────────┘│
│┌───────────────────────────┐┌──────────────────────────┐│
││ Settings box ││ ││
│└───────────────────────────┘│ ││
│┌ Properties ───────────────┐│ ││
││ (*) Color ││ ││
││ ( ) Highlight Color ││ ││
││ ( ) Disabled Color ││ F1=Help F2=Save F3=End ││
│└───────────────────────────┘└──────────────────────────┘│
└─────────────────────────────────────────────────────────┘
Figure 6.4: Status Bar Palette Dialog
From the status bar palette dialog you may modify the color
properties for the Status bar.
As you modify the color and visual properties, the sample
status bar in the lower right corner will provide a visual
representation of the current settings.
To close the Status Bar Palette dialog, select "Ok".
6.6 Status bar Code Generation.
─────────────────────────────────────────────────────────────────
Before PB/WORKSHOP can generate source code for a status
bar, the Source Code Generation dialog must be filled in
properly. To display this dialog, select the "Code" button
located at the bottom right corner of the Status bar editor
dialog.
┌──────── SOURCE CODE GENERATION ─────────┐
│ │
│ ┌ SUB/FUNCTION────────┐ ╔════════════╗ │
│ │MyStatusBar │ ║ Ok ║ │
│ └─────────────────────┘ ╚════════════╝ │
│ ┌ Initialization──────┐ ┌────────────┐ │
│ │ ( ) Create Inline │ │ Cancel │ │
│ │ (*) Load Resource │ └────────────┘ │
│ └─────────────────────┘ ┌────────────┐ │
│ ┌ Display ────────────┐ │ Help │ │
│ │ [X] Show at Runtime │ └────────────┘ │
│ │ [X] Show on Event │ ┌────────────┐ │
│ │ [MyStatusBar ] │ │ Quick Code │ │
│ └─────────────────────┘ └────────────┘ │
└─────────────────────────────────────────┘
Figure 6.5: Status bar Code Generation Dialog.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
(c) Copyright 1993-1994 DSE Software Publishing 47
PB/WORKSHOP(tm) - Version 1.03
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
In the Sub/Function box, PB/WORKSHOP displays the name of
the current status bar object. When PB/WORKSHOP generates
source code, the function or sub names will begin with the
status bar object name and end with ".INIT".
When loading a status bar in a program, the status bar
object will be referred to as "%rc" + the status bar object
name, e.g. "%rcMyStatusBar".
6.6.1 Status bar Initialization.
─────────────────────────────────────────────────────────────────
The Initialization box in the Source Code Generation dialog
determines how the status bat will be created.
When "Create Inline" is selected, PB/WORKSHOP will generate
STATUSUADD() function calls for each entry. If your program
has more than one status bar, this will increase the size of
your executable file and memory usage substantially.
The "Load Resource" generates a single line of code that
loads the entire status bar from a compiled resource (.RES)
file. It is fast, memory efficient, and the recommended
method of loading status bars.
6.6.2 Status bar display options
─────────────────────────────────────────────────────────────────
The Display Options box in the Source Code Generation dialog
determines when the status bar will be displayed.
To have the status bar displayed when the program begins,
enable the "Show at Runtime" check box.
The "Show on Event" will add code to have the status bar
displayed whenever a particular event is returned by
GETEVENT(). You must enter the event code id to respond to
in the text field below.
6.6.3 Quick Code
─────────────────────────────────────────────────────────────────
To create the code only for the current status bar, select
the "Quick Code" button in the Source Code Generation
dialog. PB/VISION will then request the name of the file to
create:
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
(c) Copyright 1993-1994 DSE Software Publishing 48
PB/WORKSHOP(tm) - Version 1.03
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
┌─────────── FILENAME TO CREATE ───────────┐
│ │
│┌────────────────────────────────────────┐│
││ ││
│└────────────────────────────────────────┘│
│ ╔════════╗ ┌────────┐ │
│ ║ Ok ║ │ Cancel │ │
│ ╚════════╝ └────────┘ │
└──────────────────────────────────────────┘
Figure 6.6: Quick Code File Creation Dialog.
Enter a valid filename and select "Ok". If the file already
exists, you will have the option of appending it to the
existing file or overwriting the file completely.
6.7 Saving a Status bar.
─────────────────────────────────────────────────────────────────
To save a menu that you have created, select the "Ok"
button.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
(c) Copyright 1993-1994 DSE Software Publishing 49