Skip to end of metadata
Go to start of metadata

The DESIGN instruction changes form design.

Syntax

The syntax consists of nested blocks of design instructions. The outer block, beginning with the keyword DESIGN, defines a form whose design will change: 

DESIGN formName [caption] [CUSTOM] {
	designStatement1
	...
	designStatementN
}

Each  designStatement  describes one design instruction. Design instructions are of the following types: 

NEW name [insertPos] [{...}];
MOVE selector [insertPos] [{...}];  
selector [{...}];	
REMOVE selector;
propertyName = value;

The first three instructions – create (NEW), move (MOVE), and modify – may in turn contain nested blocks of design instructions. The design instructions remove (REMOVE) and change property value (=) are simple single instructions. Each navigator instruction must end with a semicolon if it does not contain a nested instruction block.

Each selector can be one of the following types:

componentName
PROPERTY(formPropertyName)
FILTERGROUP(filterGroupName)
PARENT(selector)
GROUP([propertyGroupSelector][,groupObjectTreeSelector])
noGroupObjectTreeContainerType
groupObjectTreeContainerType(groupObjectTreeSelector)

In turn, groupObjectTreeSelector can be one of two types:

groupObjectSelector
TREE treeSelector

Description

Using the DESIGN instruction the developer can manage the design of the interactive form view by creating, moving, and deleting containers and components, as well as changing their certain properties. By default, a default design  is created for each form, along with appropriate containers. If necessary, you can recreate the design without the default containers and previously configured settings. This is done using the keyword CUSTOM.  

Each block of design instructions enclosed in braces alows to modify a particular component and its descendants. Let's call this component the current component or the current container if we know that the component should be a container in our case. In the external block following the  DESIGN keyword, the main container is the current component. There are the following design instructions:

  • The create instruction (NEW) allows to create a new container, making it a descendant of the current one. The newly-created container will be the current component in the design instructions block contained in this instruction.
  • The move instruction (MOVE)  allows to make an existing component a direct descendant of the current container. This component is first removed from the previous parent container. The component being moved becomes the current component in the design instructions block contained in this instruction. 
  • The modify instruction allows to modify the specified component which must be a descendant (not necessarily a child) of the current container. The specified element will be the current component in the design instructions block contained in this instruction.
  • The remove instruction(REMOVE) allows to remove a specified component from the component hierarchy. The component to be removed has to be a descendant of the current container. 
  • The change property value instruction(=) allows to change the value of the specified property of the current component.

The component hierarchy described in this instruction can have an arbitrary number of nesting levels and describe any number of components and their properties at each level.

To access design components, you can use their names or address property components on the form (PROPERTY), the parent component (PARENT), property group components (GROUP), and other base components/default design components.

Parameters

Common parameters

formName

The name of the form being changed. Composite ID. 

caption

The new form caption in the interactive view mode. String literal. The form caption doesn't change in the navigator.

name

The name of the container being created. Simple ID.

insertPos

Component insertion or moving position. Specified with one of the following options:

BEFORE selector

AFTER selector 

Specifies that the component should be added or moved before (BEFORE) or after (AFTER) the specified components. The specified component must be a child of the current container. 

FIRST

A keyword specifying that the component should be added or moved to the first position in the list of the current container's children. 

propertyName

The name of the component property. The list of existing properties is provided in the tables below.

value

The value assigned to the corresponding container property. Acceptable value types are provided in the tables below.

Component properties

Property nameDescriptionValue typeDefault valueExamples
sizeThe base component size in pixels (a value of -1 means that the size is undefined)A pair of integer literals (width, height)(-1, -1)(100, 20)
heightThe base component height in pixels.Integer literal-150
widthThe base component width in pixels. Integer literal-120

background

The color to be used for the component background

Literal of class COLOR#FFFFFF#FFFFCC, RGB(255, 0, 0)
foregroundThe color to be used for the component textColor NULL#FFFFCC, RGB(255, 0, 0)
font

The font to be used for displaying the component text — for example, property value, action caption, table text

String literaldepends on the component'Tahoma bold 16', 'Times 12'
fontSizeThe size of the font to be used for displaying the component textNumeric literaldepends on the component10
fontStyleThe style of the font to be used for the component text May contain the words 'bold' and/or 'italic', or an empty stringString literal'''bold', 'bold italic'
defaultComponent

Specifying that this component should get the focus when the form is initialized. Can only be set for one component on the entire form

Extended Boolean literalFALSETRUE, FALSE
align, alignmentComponent alignment inside the container. Acceptable values: START (at the beginning), CENTER (in the center), END (at the end), STRETCH (stretched).Alignment typeSTARTSTRETCH
flexExtension coefficient. Value of a property similar to the CSS flex-grow property. Defines how much the component should grow in size relative to other components.NUMERIC type literal00.25
fillSimilar to the flex property, the only difference being that if a zero value is set, the align property is set to START, otherwise align is set to STRETCHNUMERIC type literal0

1.5

noSort No sortingLogical literalFALSE

TRUE, FALSE

defaultCompareDefault filter. Acceptable values: EQUALS, GREATER, LESS, GREATER_EQUALS, LESS_EQUALS, NOT_EQUALS, START_WITH, CONTAINS, ENDS_WITH, LIKE.String literalCONTAINS

START_WITH

marginTopTop marginInteger literal03
marginRightRight marginInteger literal01
marginBottomBottom marginInteger literal04
marginLeftLeft marginInteger literal01
marginMargin. Sets the same value to the following properties: marginTop, marginRight, marginBottom, marginLeftInteger literal05

Container properties

Property nameDescriptionValue typeDefault valueExamples
captionContainer headerString literalNULL'Caption'
type

Container type. Acceptable values:

CONTAINERV - vertical container

CONTAINERH - horizontal container

COLUMNS - column container

SPLITV - vertical splitter

SPLITH - horizontal splitter

TABBED - tabbed panel

SCROLL– a scrollable container, cannot have more than one child

Container typeCONTAINERVCONTAINERH, TABBED
childrenAlignmentAlignment of child components inside a container. Acceptable values: START, CENTER, ENDAlignment typeSTARTCENTER
columnsNumber of columns in a COLUMNS type containerInteger literal43
columnLabelsWidthWidth of component captions in a COLUMNS type container.Integer literal050
showIfSpecifies a condition under which the container will be displayed.ExpressionNULLisLeapYear(date), hasComplexity(a, b)

Properties of actions and properties on the form

Property nameDescriptionValue typeDefault valueExamples
captionCaption of a property or actionString literalcaption of a property or action'Caption'
askConfirmSpecifies that an attempt to change the property (execute an action) will show a confirmation requestExtended Boolean literalFALSETRUE, FALSE
askConfirmMessageText of the confirmation request shown when an attempt to change the property (execute the action) is madeString literaldefault message'Are you sure you want to modify this property?'
autoSizeAutomatic component size option. Applies to text components onlyExtended Boolean literalFALSETRUE, FALSE
valueWidthWidth of the property value cell in pixels Integer literaldepends on the property100
charWidthWidth of the property value cell in charactersInteger literaldepends on the property10
charHeightHeight of the property value cell in characters (rows).Integer literaldepends on the property2, 3
clearTextSpecifying that the current text should be reset when input startsExtended Boolean literalFALSETRUE, FALSE
echoSymbolsSpecifying that a set of '*' characters will be displayed instead of the property value. Used for passwords, for exampleExtended Boolean literalFALSETRUE, FALSE
changeKey

The key that will trigger the property change event. The definition principle is similar to specifying a parameter in Keystroke.getKeystroke(String)

String literalNULL'ctrl F6', 'BACK_SPACE', 'alt shift X'
showChangeKeySpecifying that the property caption will include that name of the key shortcut that will trigger the change eventExtended Boolean literalTRUETRUE, FALSE
editOnSingleClickSpecifying that change event should be triggered after the property component is clicked onceExtended Boolean literaldepends on the propertyTRUE, FALSE
focusableSpecifying that the property (action) component or a table column can get focusExtended Boolean literalchangeKey = NULLTRUE, FALSE
captionFontThe font that will be used to display the property captionString literaldepends on the component'Tahoma bold italic 16', 'Times 12'
hideSpecifying that the property (action) component should be always hiddenExtended Boolean literalFALSETRUE, FALSE
imagePathThe path to the file with the image to be displayed as an action icon. The path is specified relative to the images folderString literalNULL'image.png', 'pring.png' 
maxValueThe maximum numerical value that the property component can haveInteger literalNULL1000000, 5000000000L
notNullSpecifies that in case of a NULL property value, the component of this property should be highlightedExtended Boolean literalnotNull свойстваTRUE, FALSE
panelCaptionAboveIndicates that the captions of property or action components should be drawn above the value on the panelExtended Boolean literalFALSETRUE, FALSE

panelCaptionAfter

Indicates that the value should be drawn on the panel prior to thee property captionExtended Boolean literalFALSETRUE, FALSE
regexpThe regular expression that the property value must match during inputString literalNULL'^((8|\+7)[\- ]?)?(\(?\d{3}\)?[\- ]?)?[\d\- ]{7,10}$'
regexpMessageThe message to be shown to the user if they enter a value that does not match the regular expressionString literaldefault message'Incorrect phone number format'

toolTip

The tip to be shown when the cursor hovers over the caption of a property or actionString literalDefault toolTip'Tip'
patternProperty value formatting template. The syntax of template definition is similar to the DecimalFormat or SimpleDateFormat syntax, depending on the value typeString literalNULL
'#,##0.00'

Toolbar properties

Property nameDescriptionValue typeDefault valueExamples
showCalculateSumShow the column sum calculation buttonExtended Boolean literalTRUETRUE, FALSE
showCountQuantityShow the row quantity calculation buttonExtended Boolean literalTRUETRUE, FALSE
showGroupChangeShow the group adjustment buttonExtended Boolean literalTRUETRUE, FALSE
showGroupShow the grouping report buttonExtended Boolean literalTRUETRUE, FALSE
showPrintGroupShow the table printing buttonExtended Boolean literalTRUETRUE, FALSE
showPrintGroupXlsShow the XLS export buttonExtended Boolean literalTRUETRUE, FALSE
showSettingsShow the table setting buttonExtended Boolean literalTRUETRUE, FALSE

Other properties

Property nameApplies toDescriptionValue typeDefault valueExamples
tabVerticaltableSpecifying that focus will be moved from top to bottom (not from left to right)Extended Boolean literalFALSETRUE, FALSE
quickSearchtableSpecifying that the table will support quick element searchExtended Boolean literalFALSETRUE, FALSE
visiblecustom filter, class treeSpecifying the visibility of the component for setting custom filters (class tree)Extended Boolean literalTRUETRUE, FALSE

Selector parameters

componentName

Name of a design component. Simple ID.

formPropertyName 

Property/action name on the form.

filterGroupName

The name of a filter groupSimple ID.

propertyGroupSelector

The name of a property groupSimple ID.

groupObjectSelector

The name of an object group on the formSimple ID.

treeSelector

The name of an object tree on the formSimple ID.

noGroupObjectTreeContainerType

Type of form container:

  • BOX – a common form container
  • PANEL – contains components of properties that are displayed in PANEL view and display group of which is undefined.
  • TOOLBARBOX – a common toolbar container with property components that are displayed in the panel, marked for placement on the TOOLBAR, and for which no object group is defined.
  • TOOLBARLEFT - the left part of the toolbar
  • TOOLBARRIGHT - the right part of the toolbar
  • TOOLBAR contains components of properties that are displayed in TOOLBAR view and display group of which is undefined.

groupObjectTreeContainerType

The type of an object group / tree container.

  • All types of containers of the noGroupObjectTreeContainerType form (identical semantics)
  • GRIDBOX - a table container
  • GRID - a table component
  • TOOLBARSYSTEM - a system toolbar (number of records, group adjustment, etc.).
  • FILTERGROUPS - contains filter group components
  • USERFILTER - a component that displays custom filters

 Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
 DESIGN order { // customizing the design of the form, starting with the default design
    // marking that all changes to the hierarchy will occur for the topmost container 
    NEW orderPane FIRST { // creating a new container as the very first one before the system buttons, in which we put two containers - header and specifications
        fill = 1; // specifying that the container should occupy all the space available to it
        type = SPLITV; // specifying that the container will be a vertical splitter
        MOVE BOX(o) { // moving everything related to the object o to the new container
            PANEL(o) { // configuring how properties are displayed in the object o panel
                type = CONTAINERV; // making all descendants go from top to bottom
                NEW headerRow1 { // creating a container - the first row
                    type = CONTAINERH;
                    MOVE PROPERTY(date(o)) { // moving the order date property
                        caption = 'Date of the edited order'; // "override" the property caption in the form design (instead of the standard one)
                        toolTip = 'Input here the date the order was made'; //setting a hint for the order date property
                        background = #00FFFF; // making the background red
                    }
                    MOVE PROPERTY(time(o)) { // moving the order time property
                        foreground = #FF00FF; // making the color green
                    }
                    MOVE PROPERTY(number(o)) { // moving the order number property
                        charWidth = 5; // setting that the user should preferably be shown 5 characters
                    }
                    MOVE PROPERTY(series(o)); // moving the order series property
                }
                NEW headerRow2 {
                    type = CONTAINERV; // descendants - from top to bottom
                }
                MOVE PROPERTY(note(o));
            }
              
            size = (400, 300); //specifying that the container o.box should have a base size of 400x300 pixels
        }
        NEW detailPane { // creating a container that will store various specifications for the order
            type = TABBED; // marking that this container should be a tab panel, where its descendats are tabs
            MOVE BOX(d) { // adding a container with order lines as one of the tabs in the top panel
                caption = 'Lines'; // setting the caption of the tab panel
                PROPERTY(index(d)) { focusable = FALSE; } // making the row number column never have focus
                GRID(d) {
                    defaultComponent = TRUE; // making sure that by default the focus when opening the form is set to the row table
                }
            }
            MOVE BOX(s) { // adding a container with sku totals as one of the detailPane tabs
                caption = 'Selection';
            }
        }
    }
}
  
// splitting the form definition into two instructions (the second instruction can be transferred to another module)
DESIGN order {
    REMOVE TOOLBARLEFT; // removing from the hierarchy the container with the print and export buttons to xls, thereby making them invisible
}

The output is the following form:

  • No labels