Jump to content
Developer Wiki and Function Reference Links ×

More about dialogs (VW_Help)


luiso

Recommended Posts

Good morning:

In the VW_Help (Dialogs) we have two basic dialog levels (BASIC DIALOG & BASIC DIALOG+CONTROLS)but both procedures display the same dialog (without controls).

This are the procedures. Where is/are the errors?

Thank you.

{BASIC DIALOG}

procedure CreateDialog_BD;

VAR

id: LONGINT;

result : LONGINT;

BEGIN

id := CreateLayout('Revise Layer Link', TRUE, 'Update', 'Cancel');

result := RunLayoutDialog(id,NIL);

END;

RUN(CreateDialog_BD);

{BASIC DIALOG + CONTROLS}

procedure CreateDialog_BDC;

VAR

id: LONGINT;

result : LONGINT;

BEGIN

id := CreateLayout('Revise Layer Link',TRUE,'Update', 'Cancel');

CreateStaticText(id,4,'Relink to:',-1);

CreatePulldownMenu(id,5,32);

CreateGroupBox(id,6,'Link Options',TRUE);

CreateCheckBox(id,7,'Link object is locked');

CreateCheckBox(id,8,'Name Link:');

CreateEditText(id,9,'Untitled Link',26);

result := RunLayoutDialog(id,NIL);

END;

RUN(CreateDialog_BDC);

Link to comment

Luiso,

you have to implement a callback procedure for driving the dialog. Then, when you call RunLayoutDialog, pass the callback procedure for the second argument. Your callback has to have the following syntax...

PROCEDURE Drive_MyDialog(VAR item:LONGINT; data:LONGINT);

begin

{code goes here}

end;

Then, instead of calling RunLayoutDialog like this:

result := RunLayoutDialog(id,NIL);

call it like this:

result := RunLayoutDialog(id,Drive_MyDialog);

You should find the information under "Vectorscript Guide...User Interface...Creating a Custom Dialog...Handling Events" in the VW Help. The procedure shown on that page is how the dialog callback procedure is implemented. In the "SetupDialogC" case, you would set the initial state and value of each control.

Using your example above, the skeleton of your case statement might look like this:

case item of

SetupDialogC: Begin

{set up your controls here}

End;

{ user selected OK button }

1: BEGIN

{...}

END;

{ user selected Cancel button }

2: BEGIN

{...}

END;

{user selected pulldown menu}

5: begin

{...}

end;

{user selected "Link object is locked" checkbox}

7: begin

{...}

end;

{user selected "Name Link" checkbox}

8: begin

{...}

end;

End; {case}

Good luck,

-Rick Francken

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...