AppBuilder Property Sheet Generation
Beta Draft
Author: (Author's Name)
Date Last Updated: (Date)
Scheduled Release: (Release Number)
Revision History
The following revisions have been made to this document:
Date: (date)
Revision: (rev-no)
Developer: (developer)
Summary of Changes: (summary)
Copyright © 2000 by Progress Software Corporation ("PSC"), 14 Oak Park, Bedford, MA 01730, and other contributors as listed below. All Rights Reserved.
The Initial Developer of the Original Code is PSC. The Original Code is Progress IDE code released to open source December 1, 2000.
The contents of this file are subject to the Possenet Public License Version 1.0 (the "License"); you may not use this file except in compliance with the License. A copy of the License is available as of the date of this notice at http://www.possenet.org/license.html
Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. You should refer to the License for the specific language governing rights and limitations under the License.
Contributors
Jane Contributor, Joe Contributor
Contents
1 Overview
2. Architecture
2.1 AppBuilder Database
2.2 Attribute Maintenance
2.3 Sequencing
2.4 Code Generation
3. Primary Data Structures
4. Primary Algorithms and Processes
5. Advanced Topics
6. Dependencies
7. Source Files
8. Build Process and Requirements
9. Execution Methods
10. Test Requirements and Strategies
11. Supplementary Information
12. Related Documentation
A portion of the code that comprises the AppBuilder Property Sheets is generated via data in an AppBuilder database. This database contains information about the GUI attributes that display on the AppBuilder Property Sheets and how those attributes are should display on the Property Sheets.
The process of generating the portions of the AppBuilder property Sheet code that displays GUI attributes consists of the following components:
AppBuilder Database
Attribute maintenance
Sequence Attributes
Code Generation
The following files are available for creating an AppBuilder database:
ab.df ๑ Data definition for the database, it contains a table called abAttribute that
abAttribute.d ๑ Data for the abAttribute table, it holds data for all GUI attributes displayed in various Property Sheets.
An Attribute Maintenance window is available for maintaining the GUI attributes that are displayed in the Property Sheet.
Figure 1: Property Sheet Attributes ๑ Maintaining GUI Attributes
A SmartDataBrowser displays the following data for an attribute:
Attribute Name
Custom
Display Sequence
Class
Character Data
A Default tab folder contains a SmartDataViewer for maintaining the following default attribute data:
Attribute Name
Description
Sequence
Display Sequence
Class radio-set
Datatype radio-set
Advanced toggle
Can Set for Custom toggle
Geometry toggle
Multiple Layout toggle
A Widgets tab folder contains a SmartDataViewer for choosing which widgets the attribute applies to:
Figure 2: Property Sheet Attributes ๑ Widgets
An Actions tab folder existing for maintaining the following for an attribute:
Character Data
Trigger Code
Attribute to U Code
Figure 3: Property Sheet Attributes ๑ Actions
There are two types of sequencing for an attribute:
Sequence ๑ This is the order of the attributes by multi-layout, then alphabetically by name. When entering a new attribute, sequence should not be set and the Re-Sequence button should be chosen to re-sequence all attributes and assign the sequence number of the new attribute appropriately, based on multi-layout and the name.
Display sequence ๑ This is the order in which the attributes appear on the property sheets, the increment of the display sequence is 5. When creating a new attribute enter the display sequence in between the two attributes that the new attribute needs to display. Choosing the Re-Sequence button will re-sequence the display sequences incrementing them by 5. The toggle box attributes that display on the property sheet should display in alphabetical order.
For example, if you were to add an attribute called ์foo๎ to the attribute database and that attribute needed to display as the last fill-in on the upper portion of the property sheet and the attribute is not multi-layout, you would assign the displaySeq to be 132 to put ์foo๎ in between the context-help-file and the color attribute (button) and you would not assign the sq. Then, re-sequencing the attributes assigns the sq to be 64 for foo (in between non-multi-layout attributes flat and format) and assigns the displaySeq to be 135 (after context-help-file which is still 130 and before color which is now 140). If you were to add an attribute called ์bar๎ to the database, and that attribute needed to display as a toggle-box on the property sheet, you would assign the displaySeq to be 257 to put ์bar๎ in between the auto-return and the blank attribute, and you would not assign the sq. Then re-sequencing the attributes assigns the sq to be 37 for bar (in between auto-return and blank) and assigns the displaySeq to be 260 (after auto-return which is still 255 and before blank which is now 265).
The following procedures are generated as part of the Property Sheet:
adeuib/_cr_prop.p ๑ This procedure is called at the initialization of the AppBuilder, it creates and initializes all property temp-table records. A _PROP temp-table record is created and populated with data stored in abAttribute. For example, the code generated in this procedure to create the _PROP record for the NO-AUTO-VALIDATE GUI attribute is:
CREATE _PROP.
ASSIGN _PROP._NAME = "NO-AUTO-VALIDATE"
_PROP._SQ = 112
_PROP._DISP-SEQ = 415
_PROP._CLASS = 1
_PROP._DATA-TYPE = "L"
_PROP._SIZE = "?"
_PROP._ADV = no
_PROP._CUSTOM = yes
_PROP._GEOM = no
_PROP._WIDGETS = "DIALOG-BOX,FRAME,BROWSE".
Figure 4: Property Sheet Code Sample
adeuib/tog-hand.i ๑ This procedure contains handle definitions for the attribute toggle-boxes. This is included in adeuib/_prpobj.p. The handles are the attribute name with ์h_๎ prefix. For example, the code generated in this procedure to define the handle for the EXPANDABLE GUI attribute is:
DEFINE VARIABLE h_EXPANDABLE AS WIDGET-HANDLE NO-UNDO.
Figure 5: Handle Definitions Code Sample
adeuib/tog-disp.i ๑ This procedure contains toggle-box creation and initialization code for the attributes, it is included within a CASE statement in adeuib/_prpobj.p. For example, the code generated in this procedure to create and initialize the STATUS-AREA attribute is:
WHEN "STATUS-AREA" THEN DO:
CREATE TOGGLE-BOX h_STATUS-AREA
ASSIGN FRAME = FRAME prop_sht:HANDLE
ROW = cur-row + ((togcnt - 1) MOD tog-rows) *
tog-spc
COLUMN = IF togcnt <= tog-rows THEN 4.5
ELSE IF togcnt <= tog-rows * 2 THEN tog-col-2
ELSE tog-col-3
LABEL = "Status-Area"
CHECKED = _C._STATUS-AREA
SENSITIVE = TRUE
TRIGGERS:
ON VALUE-CHANGED PERSISTENT RUN STATUS-AREA_proc.
END TRIGGERS.
END.
Figure 6: Toggle Box and Initialization Code Sample
adeuib/tog-proc.i ๑ This procedure contains internal procedures run by the toggle-box trigger code, it is included in adeuib/_prpobj.p. For example, the code generated in this procedure for the MIN-BUTTON attribute is:
PROCEDURE MIN-BUTTON_proc:
C._MIN-BUTTON = SELF:CHECKED.
IF _C._MIN-BUTTON AND _C._CONTEXT-HELP THEN DO:
ASSIGN h_context-help:CHECKED = FALSE.
APPLY "VALUE-CHANGED":U TO h_context-help.
END.
END.
Figure 7: Internal Procedures for Toggle-Box Trigger Code Sample
adeuib/atog-han.i ๑ This procedure contains handle definitions for the attribute toggle-boxes on the Advanced Property Sheet. This is included in adeuib/_advprop.w. The handles are the attribute name with ์h_๎ prefix. For example, the code generated in this procedure to define the handle for the MOVABLE GUI attribute is:
DEFINE VARIABLE h_MOVABLE AS WIDGET-HANDLE NO-UNDO.
adeuib/atog-dis.i ๑ This procedure contains toggle-box creation and initialization code for the attributes for the Advanced Property Sheet, it is included within a CASE statement in adeuib/_advprop.w. For example, the code generated in this procedure to create and initialize the RESIZABLE attribute is:
WHEN "RESIZABLE" THEN DO:
CREATE TOGGLE-BOX h_RESIZABLE
ASSIGN FRAME = FRAME adv-dial:HANDLE
ROW = cur-row + ((togcnt - 1) MOD tog-rows)
* tog-spc
COLUMN = IF togcnt <= tog-rows THEN tog-col-1
ELSE IF togcnt <= tog-rows * 2 THEN tog-col-2
ELSE IF togcnt <= tog-rows * 3 THEN tog-col-3
ELSE tog-col-4
LABEL = "Resizable"
CHECKED = _U._RESIZABLE
SENSITIVE = TRUE
TRIGGERS:
ON VALUE-CHANGED DO:
_U._RESIZABLE = SELF:CHECKED.
END.
END TRIGGERS.
END.
adeuib/custprop.i ๑ This procedure contains code to assign attribute values of universal widget records from Custom widget definitions, it is included within a CASE statement in adeuib/_usecust.p. For example, the code generated for the LIST-ATTRIBUTES is:
WHEN "LIST-ITEMS":U THEN
DO:
/* For Combo-boxes and Selection-lists, we want a CHR(10) delimited list */
IF CAN-DO("COMBO-BOX,SELECTION-LIST", _U._TYPE)
THEN _F._LIST-ITEMS = REPLACE(cValue, ",":U, CHR(10)).
ELSE _F._LIST-ITEMS = cValue.
END.
Figure 8: Assigning Attribute values of Universal Widget Sample Code
adeuib/layout.i ๑ This procedure contains definitions for Multiple Layout Support (_LAYOUT and _L), it is included in adeuib/_prpobj.p and various adeuib procedures.
The Attribute data is store in _PROP temp-table records. These records contain the following data:
Attribute name (_NAME)
Sequence (_SQ)
Display Sequence (_DISP-SEQ)
Class (_CLASS)
Datatype of the attribute value (_DATA-TYPE)
Size (_SIZE)
Advanced (_ADV)
Custom (_CUSTOM)
Geometry (_GEOM)
Widgets (_WIDGETS)
The abAttribute table in the ab database contains the following fields:
sequence ๑ This is the sequence of the attribute, it corresponds to _PROP._SQ.
name ๑ This is the name of the attribute, it corresponds to _PROP._NAME
multiLayout ๑ This is used to determine whether an _L field definition is generated for the attribute in layout.i.
class ๑ This is the class of the attribute, it corresponds to _PROP._CLASS. The following are possible class values:
Class 1 is a property sheet toggle box, code is generated to create the toggle box (tog-disp.i), define the toggle box (tog-hand.i) and for the toggle box VALUE-CHANGED trigger procedure (tog-proc.i).
Class 9 is an advanced property sheet toggle box, code is generated to create the toggle box (atog-dis.i), and to define the toggle box (atog-han.i).
Class 2 ๑ 8 indicates non-toggle box property sheet attributes. These class numbers are not used by any code.
dataType ๑ This is the datatype of the attribute, it corresponds to_ PROP._DATA-TYPE.
chrData ๑ This is the label and checked value of the attribute, delimited with an exclamation mark. This generates code to assign the LABEL and the CHECKED attributes of the toggle box (atog-dis.i and tog-disp.i). It also generates the LABEL for _L field definitions (layout.i).
adv ๑ This corresponds to _PROP._ADV.
geom. ๑ This corresponds to _PROP._GEOM. This is not used by any code.
descrip ๑ This is a description of the attribute.
displaySeq ๑ This determines the order in which the attributes are processed and displayed by the property sheet, it corresponds to _PROP._DISP-SEQ.
widgSize ๑ This corresponds to _PROP._SIZE. This is not used by any code.
trigCode ๑ This is the attributeํs toggle-box VALUE-CHANGED trigger code. This generates the trigger code in an internal procedure in tog-proc.i. And it generates the VALUE-CHANGED trigger code for advanced property sheet toggles-boxes in atog-dis.i.
custom ๑ This determines whether the attribute can be set for custom widgets, it corresponds to _PROP._CUSTOM and it is used to generate custprop.i.
attr2Ucode ๑ This is what the attribute is set to for custom widgets, it is used to generate custprop.i.
The following logical values determine which widgets the attribute applies to:
wind ๑ Window
frm ๑ Frame
brow ๑ Browse
dial ๑ Dialog-Box
butt ๑ Button
comb ๑ Combo-Box
edit ๑ Editor
fil ๑ Fill-In
imag ๑ Image
radi ๑ Radio-Set
rec ๑ Rectangle
sele ๑ Selection-List
slid ๑ Slider
txt ๑ Text
togg ๑ Toggle-Box
proc ๑ Procedures
ocx ๑ ActiveX control
4. Primary Algorithms and Processes
Not Applicable
Not Applicable
Not Applicable
Provide a one-line description for each source file used by the tool. For example:
This tool uses the following source files:
Source File
Description
adeuib/dabattribute.w
Attribute SmartDataObject.
adeuib/dabattribute.i
Attribute SmartDataObject include.
adeuib/dabattribute_cl.w
Attribute SmartDataObject proxy.
adeuib/vabattribute.w
Default attribute SmartDataViewer.
adeuib/vabattraction.w
Action attribute SmartDataViewer.
adeuib/vabattrwidg.w
Widget attribute SmartDataViewer.
adeuib/wabattribute.w
Property Sheet Attribute maintenance SmartWindow.
adeuib/wabattrgencode.w
Property Sheet Generator.
8. Build Process and Requirements
To use the ab database to maintain Property Sheet attributes, follow these steps:
1. Create an empty database called ์ab๎
2. Load adeuib/ab.df into the new empty ab database
3. Load the data into the abAttribute table (adeuib/abAttr.d)
Run adeuib/wabattribute.w to maintain attribute information, re-sequence attributes and generate property sheet code.
Not Applicable
10. Test Requirements and Strategies
Not Applicable
The tog-proc.i include file is generated to hold the toggle-box VALUE-CHANGED trigger code in internal procedures. This was done because including the trigger code in the VALUE-CHANGED triggers within tog-disp.i exceeded the action code segment of adeuib/_prpobj.p. The advanced property sheet, adeuib/_advprop.w does not have this problem so the VALUE-CHANGED trigger code is included in atog-dis.i.
Provide a list of documents that contain additional information about the tool. For example:
The following documents provide additional information about the tool:
<PSC user documentation>
<White papers>
<Other related documents>