Next: Other parameters
Up: Getting Started
Previous: Compiling DJ programs
When having a DJ program compiled, we can give the system the following parameters to specify the size and different margins of the main panel.
- w: width of the main panel.
- h: height of the main panel.
- lm: left margin.
- rm: right margin.
- tm: top margin.
- bm: bottom margin.
The values given to the parameters are all in pixels. We use the following names in DJ programs to refer to the values of different parameters:
- panelWidth: value for w
- panelHeight: value for h
- leftMargin: value for lm
- rightMargin: value for rm
- topMargin: value for tm
- bottomMargin: vaue for bm
The size of the layout area in the main panel is
.
If no value is given to a parameter, then the default value will be
used. The default value for panelWidth and panelHeight is 500
pixels, and the default value for the margins is 0.
The main panel forms a coordinate system ranging from (0, 0) to (w - 1, h - 1). The X coordinate increases to the right, and the Y coordinate increases downward. So, the left upper corner of the main panel is (0, 0) and the left upper corner of the layout area is (lm, tm).
For example, to have the HelloWorld button shown in a
panel, we compile the program using the following command:
dj -w 100 -h 100 HelloWorld
Next: Other parameters
Up: Getting Started
Previous: Compiling DJ programs
Neng-Fa Zhou
1999-02-16