#include “appforms.p”
Standard Form Widths | |
FORM_WID_SML | Use for Application Forms and forms where a SINGLE column of widgets is desired. |
FORM_WID_MED | Use for forms where a DOUBLE column of widgets is desired or where wide widgets are needed. |
FORM_WID_LRG | Use for forms where a TRIPLE column of widgets is desired or where extra wide widgets are needed. |
Special Form Width | |
FORM_WID_SPL | Use for forms that are 1.5 times a normal or small form width. This form size is good for file forms and forms that include a color bar. |
Standard Form Heights | |
FORM_HGT_TALL | FULL height is for forms that extend from the top menu to the bottom of the screen and Application Forms. |
FORM_HGT_3_QTRS | 3_QTRS height is for forms 3/4 of a full height form. |
FORM_HGT_5_8THS | 5_8THS height is for forms 5/8 of a full height form. |
FORM_HGT_HALF | HALF height is for forms half of a full height form. |
FORM_HGT_3_8THS | 3_8THS height is for forms 3/8 of a full height form. |
FORM_HGT_QTR | QTR height is for forms one quarter of a full height form. |
Important: | Other form heights may be obtained by adding heights together. |
Form Margins | |
FORM_L_MARGIN | Left margin for placing frame widgets. |
FORM_R_MARGIN | Right margin between frame and right side of form. |
FORM_T_MARGIN | Top margin for placing widgets on form. |
FORM_B_MARGIN | Bottom margin for placing widgets on form. |
Form Placement X Locations | |
FORM_X_LOC | Normal form x location. |
FORM_X_LOC_SML | Normal form x location (same as FORM_X_LOC). |
FORM_X_LOC_SPL | Normal special (1.5 times small) form x location. |
FORM_X_LOC_MED | Normal medium width form location. |
FORM _X_LOC_LRG | Normal large width form location. |
FORM_X_LOC_SML_NX2_SML | Place a small form next to a small form. |
FORM_X_LOC_2ND_SML_NX2_SML | Place a second small form next to a small form (result is three small forms). |
FORM_X_LOC_SPL_NX2_SML | Place a special (1.5 times small) form next to a small form. |
FORM_X_LOC_MED_NX2_SML | Place a medium form next to a small form. |
FORM_X_LOC_LRG_NX2_SML | Place a large form next to a small form. |
FORM_X_LOC_SML_NX2_MED | Place a small form next to a medium form. |
FORM_X_LOC_SPL_NX2_MED | Place a special (1.5 times small) form next to a medium form. |
FORM_X_LOC_MED_NX2_MED | Place a medium form next to a medium form. |
FORM_X_LOC_SML_NX2_LRG | Place a small form next to a large form. |
FORM_X_LOC_SML_CEN | Center a small form. |
FORM_X_LOC_SPL_CEN | Center a special (1.5 times small) form. |
FORM_X_LOC_MED_CEN | Center a medium form. |
FORM_X_LOC_LRG_CEN | Center a large form. |
Form Placement Y Locations | |
FORM_Y_LOC | Place a form under the main menu bar. |
FORM_Y_LOC_HALF_CEN | Center a half of full height form between the main menu bar and the command line. |
FORM_Y_LOC_3_8THS_CEN | Center a 3/8 of full height form between the main menu bar and the command line. |
FORM_Y_LOC_QTR_CEN | Center a quarter of full height form between the main menu bar and the command line. |
Other Form Variables | |
The following variables are the widths of the colored areas outside the form. | |
FORM_L_BORDER | The width of the dark border at the left side of the form. |
FORM_R_BORDER | The width of the dark border at the right side of the form. |
FORM_T_BORDER | The width of the dark border at the top of the form. |
FORM_B_BORDER | The width of the dark border at the bottom of the form. |
Spacing Between Widgets | |
Spacing is based on the height of the font being used for widget labels. Try to use at least a HALF_SPACE between widgets. The spacing variables listed below are listed in order of size. | |
QTR_SPACE | 1/4 of a single font height. |
HALF_SPACE | 1/2 of a single font height. |
INTER_WIDGET_SPACE | 3/4 of a font height. |
FONT_HGT | Font height in inches. |
SINGLE_SPACE | A font height in inches. |
ONE_AND_HALF_SPACE | 1.5 times a font height. |
DOUBLE_SPACE | 2.0 times a font height. |
TEXT_FONT_HEIGHT | Font height of Text Widget in inches. |
Create spacing variables by multiplying any of the variables above by other variables or by numbers (i.e., 2 * DOUBLE_SPACE). |
REAL | y_loc |
y_loc = | y_loc + INTER_WIDGET_SPACE |
Select Frames | Select frames are used to group select databoxes. |
Buttons | Buttons may be used to bring up additional forms or to select an action such as Go, Cancel, Reset, Abort, etc. Buttons that bring up forms should have an ellipsis, (...), included with the button label. |
Label | Labels are not selectable; they provide information. |
Functions | Select frames are thicker and shadowed compared to ordinary frames. They are used to visually and functionally group select databoxes. The command to create a select frame has an option to place a toggle over the select frame. This is an Automatic Execute toggle. When the toggle is selected, Patran will automatically traverse to the “next” select databox and will optionally execute a button callback after the last select databox is satisfied. The select frame is used to contain select databoxes. Select databoxes are databoxes that offer the ability to filter the types of entities that may be processed. Select databoxes may have input focus cycled by setting the logical parameter recycle to TRUE. When “recycle” is set to TRUE, the first databox in the select frame regains input focus after the last databox in the select frame loses input focus. When “recycle” is set to FALSE, the default button is activated after the last databox in the select frame loses input focus. |
Restrictions | • There should be margins separating the select frame from the parent form. • Only select databoxes may be contained within a select frame. • Select databoxes inside the select frame are positioned relative to the upper left corner of the select frame. |
Placement | Select frames are placed with respect to the upper left hand corner of their parent form. The following variables have been provided to help place select frames. |
Select Frame Widths: | |
SFRAME_WID_SINGLE | Use for small forms and for select frames in single columns of larger forms. |
SFRAME_WID_SPECIAL | Use for special forms (1.5 times small) and for select frames that span 1.5 columns of larger forms. |
SFRAME_WID_DOUBLE | Use for medium forms and for double width select frames that span 2 columns of a medium or a large form. |
SFRAME _WID_TRIPLE | Use for large forms for select frames that span 3 columns of a large form. |
Select Frame Height | |
Select frames contain only select databoxes. The following variables have been provided to determine the height needed for a select frame depending upon the number of select databoxes it contains and whether the select databoxes have labels or not. | |
SFRAME_nSDB_HGT_LABOVE | Height of a select frame that contains n labeled select databoxes.* |
SFRAME_nSDB_HGT_NO_LABOVE | Height of a select frame that contains n select databoxes without labels.* |
SFRAME_HGT_LABOVE_INCR | Increment for computing the height of a select frame with more than 5 labeled select databoxes in it. |
SFRAME_HGT_NO_LABOVE_INCR | Increment for computing the height of a select frame with more than 5 unlabeled select databoxes in it. |
Select Frame X Locations | |
SFRAME_X_LOC_COL1 | Location of a select frame that starts in the leftmost column of any size form. |
SFRAME_X_LOC_COL2 | Location of a select frame that starts in the second column from the left of a medium or large form. |
SFRAME_X_LOC_COL3 | Location of a select frame that starts in the third column from the left of a large form. |
Select Frame Label | |
Select frames may have a toggle above the select frame. | |
SFRAME_LABEL_HGT | Height of the Label and its associated toggle above a select frame. |
Select Frame Margins | |
SFRAME_L_MARGIN | Distance between select frame and left side of select databox. |
SFRAME_R_MARGIN | Distance between select frame and right side of select databox. |
SFRAME_T_MARGIN | Distance between select frame and top of first select databox inside select frame. |
SFRAME_B_MARGIN | Distance between select frame and last select databox inside select frame. |
Select Frame Thickness | |
SFRAME_1EDGE | Thickness of a select frame edge. |
SFRAME_2EDGE | Thickness of two select frame edges (i.e., top and bottom or left and right). |
*For select frames with additional select databoxes, add increments, n (from 1 to 5 only), select databoxes within a select frame. |
ui_selectframe_create( parent_id, “go_button_callback”, @
SFRAME_X_LOC_COL1, y_loc, @
SFRAME_WID_SIZE, SFRAME_nSDB_LABOVE, @
“Auto Execute”, logical_recycle)
y_loc = y_loc + SFRAME_LABEL_HGT + @
SFRAME_nSDB_LABOVE + @
SFRAME_2EDGE + @
INTER_WIDGET_SPACE
Function | A Label widget is used to supply information to the user. |
Restrictions | • The first letter should be in upper case; rules for titles should be observed, that is, important words should be capitalized. • Label text is left justified. • Label widgets do not have callbacks. Use a blank ““ or EMPTY_STR for this parameter. |
Placement | Label widgets are placed with respect to the upper left corner of their parent form. The following variables have been provided to help place labels. The x location for an unframed label widget is: UNFRAMED_L_MARGIN Use the variable: LABEL_HGT and a spacing variable such as INTER_WIDGET_SPACE or SINGLE_SPACE to calculate the y location for the next widget. |
label = ui_label_create( @
/* parent */ parent_form, @
/* callback */ EMPTY_STR, @
/* x */ UNFRAMED_MARGIN, @
/* y */ y_loc, @
/* label */ “label_text” )
/* Calculate the y location for the next widget */
y_loc = y_loc + LABEL_HGT + INTER_WIDGET_SPACE
Functions | The Button widget is used to: • Bring up another form. • Put away a form. • Perform an action. |
Restrictions | • Height of the buttons should be the letter height, i.e., when the button is created, let the height = 0.0 or ZERO to default to font height. • The width of buttons should be the same for all buttons on a line, except for default buttons, which have a border around them. • Buttons should be arranged from the most used to the least used, or “positive” to “negative,” or sequence of use. • Default buttons. When there is only one button on a form, that button should be set to be the default one. For example: When a button is used frequently (or most likely to be used), then it should be defaulted. If there is just “Apply” and “Cancel,” then “Apply” should be the default one. For example: Try to have a default, usually the left-most button. |
• Combinations. “Update” buttons should have “Reset” buttons on the same form. Follow the sequence: “Create,” “Rename,” and “Delete” on a form that has such buttons. • Buttons that bring up forms should have an ellipsis (...) after the label. • Labels for buttons: Yes indicates a positive response and closes form. No indicates a negative response and closes form. Update updates any changes made to the form. Reset resets any changes to the form when the form was last saved. OK updates and closes the form. Cancel resets the form and closes; this should not undo the update. Apply performs the action specified by the label. Keep labels for buttons to 1 word, usually a verb. | |
Placement | • Buttons are placed with respect to their parent form. |
Button Width: | |
BUTTON_WID_FULL | This button is as wide as a single column databox. It is good for items with large labels and for buttons that bring up additional forms. |
BUTTON_WID_HALF | Use this size for each button when two buttons are placed in a column. |
BUTTON_WID_THIRD | Use this size for each button when three buttons are placed in a column. |
Button Height: | |
BUTTON_HGT | Use for calculating y_loc for placement of next widget. Use 0.0 or ZERO for the button height in the PCL call so that the button height defaults to the font height of the button label. |
BUTTON_DEFAULT_HGT | Total height of the button including the height of the highlight border above and below. |
BUTTON_DEFAULT_BORDER_WID | The width of the highlight border at the left or right side of a default button. |
BUTTON_DEFAULT_BORDER_HGT | The height of the highlight border at the top or bottom of a default button. |
Button Locations for First Column: | |
BUTTON_FULL_X_LOC1 | Locates a full size button at left side of form. |
BUTTON_HALF_X_LOC1 | Locates the first half size button at left side of form. |
BUTTON_HALF_X_LOC2 | Locates the second half size button on the form. |
BUTTON_THIRD_X_LOC1 | Locates the first one third size button at left side of form. |
BUTTON_THIRD_X_LOC2 | Locates the second one third size button on the form. |
BUTTON_THIRD_X_LOC3 | Locates the third one third size button on the form. |
Button Locations for Second Column: | |
BUTTON_FULL_X_LOC1_COL2 | Locates a full size button at left side of column two on form. |
BUTTON_HALF_X_LOC1_COL2 | Locates a half size button at left side of column two on form. |
BUTTON_HALF_X_LOC2_COL2 | Locates a second half size button in column two on form. |
BUTTON_THIRD_X_LOC1_COL2 | Locates a one third size button at the first location of column two on form. |
BUTTON_THIRD_X_LOC2_COL2 | Locates a second one third size button at the second location of column two on form.on form. |
BUTTON_THIRD_X_LOC3_COL2 | Locates a third one third size button in position 3 of column two on form. |
Button Locations for Third Column: | |
BUTTON_FULL_X_LOC1_COL3 | Locates a full size button at left side of column three on form. |
BUTTON_HALF_X_LOC1_COL3 | Locates a half size button at left side of column three on form. |
BUTTON_HALF_X_LOC2_COL3 | Locates a second half size button in column three on form. |
BUTTON_THIRD_X_LOC1_COL3 | Locates a one third size button at the first location of column three on form. |
BUTTON_THIRD_X_LOC2_COL3 | Locates a second one third size button at the second location of column three on form.on form. |
BUTTON_THIRD_X_LOC3_COL3 | Locates a third one third size button in position 3 of column three on form. |
Button Center Location on a Small (Single Column) Form: | |
BUTTON_FULL_X_LOC_CEN | Center a full size button on a small single column form. |
BUTTON_HALF_X_LOC_CEN | Center a half size button on a small single column form. |
BUTTON_THIRD_X_LOC_CEN | Center a one third size button on a small single column form. |
Button Center Location on a Medium (Double Column) Form: | |
BUTTON_FULL_X_LOC_CEN_MED | Center a full size button on a medium double column form. |
BUTTON_HALF_X_LOC_CEN_MED | Center a half size button on a medium double column form. |
BUTTON_THIRD_X_LOC_CEN_MED | Center a one third size button on a medium double column form. |
Button Center Location on a Large (Triple Column) Form: | |
BUTTON_FULL_X_LOC_CEN_LRG | Center a full size button on a large triple column form. |
BUTTON_HALF_X_LOC_CEN_LRG | Center a half size button on a large triple column form. |
BUTTON_THIRD_X_LOC_CEN_LRG | Center a one third size button on a large triple column form. |
ui_button_create( @
/* parent */ “parent”, @
/* callback */ "callback", @
/* x */ BUTTON_SIZE_X_LOC_CEN, @
/* y */ y_loc, @
/* width */ BUTTON_WID_SIZE, @
/* height */ 0.0, @
/* label */ “button_label” @
/* labelinside */ TRUE, @
/* highlight */ FALSE )
y_loc = y_loc + BUTTON_DEFAULT_BORDER_HGT
ui_button_create( /* parent */ form-id, @
/* callback */ “callback”, @
/* x */ BUTTON_THIRD_X_LOC1, @
/* y */ y_loc, @
/* width */ BUTTON_WID_THIRD, @
/* height */ 0.0, @
/* label */ “button_label1”, @
/* labelinside */ TRUE, @
/* highlight */ TRUE )
Create the second button.
ui_button_create( /* parent */ form-id, @
/* callback */ “callback”, @
/* x */ BUTTON_THIRD_X_LOC2, @
/* y */ y_loc, @
/* width */ BUTTON_WID_THIRD @
/* height */ ZERO, @
/* label */ “button_label2”, @
/* labelinside */ TRUE, @
/* highlight */ FALSE )
Create the third button.
ui_button_create( /* parent */ form-id, @
/* callback */ “callback”, @
/* x */ BUTTON_THIRD_X_LOC3, @
/* y */ y_loc, @
/* width */ BUTTON_WID_THIRD @
/* height */ ZERO, @
/* label */ “button_label3”, @
/* labelinside */ TRUE, @
/* highlight */ FALSE ) @
Compute the next y location considering the border at the bottom of the default button.
y_loc = y_loc + BUTTON_HGT @
+ BUTTON_DEFAULT_BORDER_HGT @
+ INTER_WIDGET_SPACE
databox | Databoxes are used for entering data. Labels may be placed above or to the left of the databox. A label to the left of a databox has an equal sign “=” included. |
select databox | The select databox provides an opportunity to enter either typed input data or graphical data. Select databoxes must be enclosed in a select data frame. A select databox is labeled but no equal signs or colons are allowed. |
Function | Databoxes are used for entering data. |
Restrictions | • Labels are only placed above or to the left of the databox. • Labels above the databox cannot have equal signs or any symbols following the label. For example: • Labels to the left must have an equal sign following the label and nothing else. |
Placement | Databoxes are placed with respect to the upper left hand corner of their parent form. The following variables have been provided to help place databoxes. |
Databox Width: | |
DBOX_WID_SINGLE | A single column width databox. |
DBOX_WID_SPECIAL | A 1 1/2 column width databox. |
DBOX_WID_DOUBLE | A two column width databox. |
DBOX_WID_TRIPLE | A three column width databox. |
Databox Height: | |
DBOX_HGT_LABOVE | The height of one databox with a label above. |
DBOX_HGT_NO_LABOVE | The height of one databox without a label. |
Databox Label Width for Databoxes that are Labeled on the Left: | |
Use these parameters when “label_above” is FALSE. | |
DBOX_LABEL_LEN_SINGLE | Default label length for a single width databox when label is on left. |
DBOX_LABEL_LEN_SPECIAL | Default label length for a special (1 1/2 column) width databox when label is on left. |
DBOX_LABEL_LEN_DOUBLE | Default label length for a double width databox when label is on left. |
DBOX_LABEL_LEN_TRIPLE | Default label length for a triple width databox when label is on left. |
DBOX_LABEL_X_OFFSET | Distance between end of label and start of databox. |
wid = DBOX_WID_SIZE - @
DBOX_LABEL_LEN_SIZE - @
DBOX_LABEL_X_OFFSET
where SIZE = SINGLE, SPECIAL, DOUBLE or TRIPLE
ui_databox_create( /* parent */ “parent_frame”, @
/* callback */ EMPTY_STR, @
/* x */ UNFRAMED_L_MARGIN, @
/* y */ y_loc, @
/* label_length */ ZERO, @
/* box_length */ DOUBLE_WID_SINGLE, @
/* label */ "label”, @
/* value */ initial_value, @
/* label_above */ TRUE, @
/* datatype */ "STRING", @
/* num_vals */ num_values )
y_loc = y_loc + DBOX_HGT_LABOVE + INTER_WIDGET_SPACE
Functions | The select databox provides an opportunity to enter either typed input data or graphical data. |
Restrictions | All select databoxes require a select data frame. • Labels should be above the select databox. No Equal signs or colons are allowed. If it is a coordinate frame select databox and the coordinate frame is used for geometric construction purposes only, the label should be: Refer. Coordinate Frame If a nodal coordinate system is defined for the purpose of analysis, it should be referred to as: Analysis Coordinate Frame Likewise, the material coordinate frame should be referred to as: Material Coordinate Frame The same principle applies for other types of coordinate frames. |
Placement | Select databoxes are placed with respect to the upper left hand corner of their parent select frame. The following variables have been provided to help place databoxes. |
Select Databox Width: | |
SDBOX_WID_SINGLE | A single column width select databox. |
SDBOX_WID_SPECIAL | A 1 1/2 column width select databox. |
SDBOX_WID_DOUBLE | A two column width select databox. |
SDBOX_WID_TRIPLE | A three column width select databox. |
Select Databox Height: | |
SDBOX_HGT_LABOVE | The height of one select databox with a label above. |
SDBOX_HGT_NO_LABOVE | The height of one select databox without a label. |
Select Databox Placement Y Location: | |
SDBOX_Y_LOCn _LABOVE | Place a select databox with a label above inside a select frame.* |
SDBOX_Y_LOCn _NO_ABOVE | Place an unlabeled select databox inside a select frame.* |
*To calculate the location of each additional select databox, add the increment, n (from 1 to 5 only), to each select databox location. | |
SDBOX_Y_LABOVE_INCR | Increment for creating the y location for more than 5 select databoxes with labels inside a select frame. |
SDBOX_Y_NO_LABOVE_INCR | Increment for creating the y location for more than 5 select databoxes without labels inside a select frame. |
Label Width for Select Databoxes Labeled on the Left: | |
Use these parameters when “label_above” is FALSE. | |
SDBOX_LABEL_LEN_SINGLE | Default label length for a single width select databox when label is on left. |
SDBOX_LABEL_LEN_SPECIAL | Default label length for a special width (1 and 1/2 column) select databox when label is on left. |
SDBOX_LABEL_LEN_DOUBLE | Default label length for a double width select databox when label is on left. |
SDBOX_LABEL_LEN_TRIPLE | Default label length for a triple width select databox when label is on left. |
SDBOX_LABEL_X_OFFSET | Distance between end of label and start of select databox. |
wid = SDBOX_WID_SIZE @
- SDBOX_LABEL_LEN_SIZE @
- SDBOX_LABEL_X_OFFSET
where SIZE = SINGLE, SPECIAL, DOUBLE or TRIPLE
SFRAME_nSDB_HGT_LABOVE
n * (SFRAME_HGT_LABOVE_INCR)
sframe_height = SFRAME_2SDB_HGT_LABOVE
ui_selectframe_create (/* parent */ parent_form, @
/* callback */ “callback”, @
/* x */ FORM_L_MARGIN, @
/* y */ y_loc, @
/* width */ SFRAME_WID_SINGLE, @
/* height * sframe_height, @
/* label */ “toggle_label”, @
/* recycle */ logical_recycle )
The command to use to place the first select databox inside a select frame is:
/* x */ SFRAME_L_MARGIN, @
/* y */ SDBOX_Y_LOC1_LABOVE, @
/* label_length */ ZERO, @
/* box_length */ SDBOX_WID_SINGLE, @
/* label */ “label”, @
/* value */ initial_value, @
/* label_above */ TRUE, @
/* datatype */ “acceptable_datatype”, @
/* prompt */ “prompt” )
Create the second select databox.
/* x */ SFRAME_L_MARGIN, @
/* y */ SDBOX_Y_LOC2_LABOVE, @
/* label_length */ ZERO, @
/* box_length */ SDBOX_WID_SINGLE, @
/* label */ “label”, @
/* value */ initial_value, @
/* label_above */ TRUE, @
/* datatype */ “acceptable_datatype”,
/* prompt */ “prompt” )
sframe_height + SFRAME_2EDGE + INTER_WIDGET_SPACE
Functions | Switches are used for grouping items which allow only one of its items to be selected. |
Restrictions | • Positioned relative to the parent form. • Switch items appear in the order in which they are created. |
Placement | Switches are placed with respect to the upper left hand corner of their parent form. A switch contains an arbitrary number of item widgets. Only one of the item widgets may be set to ON at any given time; setting an item ON automatically sets all other items in the switch OFF. If one item is set to FALSE, clicking on an ON item may set it to OFF depending on the value of the always_one in the ui_switch_create() call. Items in switches are organized vertically. |
Switch Height: | |
SWITCH_1R_HGT_LABEL | The height of a one row switch with a label. |
SWITCH_2R_HGT_LABEL | The height of a two row switch with a label. |
SWITCH_3R_HGT_LABEL | The height of a three row switch with a label. |
SWITCH_4R_HGT_LABEL | The height of a four row switch with a label. |
Switch Height Unlabeled: | |
SWITCH_1R_HGT_NO_LABEL | The height of a one row switch without a label. |
SWITCH_2R_HGT_NO_LABEL | The height of a two row switch without a label. |
SWITCH_3R_HGT_NO_LABEL | The height of a three row switch without a label. |
SWITCH_4R_HGT_NO_LABEL | The height of a four row switch without a label. |
additional_row | = | SWITCH_4R_HGT_LABEL - SWITCH_3R_HGT_LABEL |