{I have done plenty of classic custom dialog boxes. I like the procedures and I'm comfortable with screen co-ordinates .
However because these procedures have all been scrapped, I'm now trying to write a simple example script showing a
custom modern dialog into which real values a & b are entered in order to draw a rectangle (See below).
Once I've got this right, I can go on to do scripts for complex objects with many variables}
Procedure DialogTest;
Procedure SetUpDialog;
VAR
a,b:REAL;
ID: LONGINT;
Res:LONGINT;
BEGIN
ID:=CreateLayout('Parameters', False, 'OK', 'Cancel');
{Text fields}
CreateStaticText( ID, 05, 'Value-a', 15);
CreateStaticText( ID, 06, 'Value-b', 15);
{Box fields}
CreateEditReal( ID, 15, 1, 1.25, 10);
CreateEditReal( ID, 16, 1, 2.64, 10);
{Text layout}
SetFirstLayoutItem( ID, 05);
SetBelowItem( ID, 05, 06, 0, 0);
{Box layout}
SetRightItem( ID, 05, 15, 0, 0);
SetRightItem( ID, 06, 16, 0, 0);
Res:=RunLayoutDialog( ID, NIL);
END;
BEGIN
SetUpDialog;
{I now need to assign the field values entered for Value-a & Value-b
to the declared variables a & b.
The obvious step would be -
a:=GetEditReal(ID, 15, 1, true);
b:=GetEditReal(ID, 16, 1, true);
rect(0, 0, a, b);
END;
Run(DialogTest);
Dead simple and similar to the sort of script in version 2008.
However this does not work, and I have tried numerous workarounds with no success.
QUESTION: How do I put in this missing link?
Any constructive advice most welcome!}