Editing and Compilation of the Main Form

The most part of the user interface of the Life Game program is collected in the MainForm form. This form is in the MainForm package of the program. The form is called directly from the system generated main.pro file. The program has not Task Window and menus. This form is maximized when shown.

Modification of the main form

The design view of the forms under the Visual Prolog IDE does not allow enough width and height to design form expanded to the whole client area of the 1024×768 screen resolution. The properly defined anchors help to move the tightly placed controls. This is not enough. The playground must be as big as possible so it covers two other group boxes in design view. If you want to modify the contents of these group boxes the change the height of the territory_gb group box from 300 to 150 dialog base units in the Properties grid.
Playground covers two lower group boxes. Decrease the height
This way the group boxed embedding the parameters of the intoxication by the dead organisms and the change of the generations will be accessible.
Modify the revealed group boxes
You can see two other group boxes horizontally covering each other. Modify their contents by moving them to a free rectangle of the designed form. Two group boxes extend to the lower edge of design window. These are fully visible on the executed main form.
lower edge out (left) lower edge out (right)
Before you save the changes and call the automatic generation of the code, move the shifted group boxes to their original rectangle and reset the height of the territory_gb.

Modification of the automatically generated code

The automatic code generates calls SciLexer. The program needs the author's modified The form contains a colored multi-line window supported by the author's contribution to Visual Prolog Tip and Samples.The form contains a colored multi-line window supported by the author's contribution to You have to execute the following replacement. You must check the Whole Words check box in the find and replace dialog.
Find and replace SciLexer words to SciLexer_NF words
If you miss it, not only the 2 required occurrences will be replaced but other, too, which cause compilation errors.
Remark: The onShow procedure of the form contains two translations of group boxes and the adjustment of the territory of the images.

generations_gb:getPosition()=pnt(_,Y),
generations_gb:setPosition(5,Y),
dead_gb:getPosition()=pnt(_,Z),
dead_gb:setPosition(5,Z+100),
% Square territory.
territory_gb:setClientSize(TA,TA),
This:getClientSize(MW,MH),
territory_gb:getOuterRect()=rct(_,TT,_,TB),
territory_gb:setOuterRect(rct(MW-TA-5,TT,MW-5,TB)),